[pmwiki-users] Newsletter throttling
editor at fast.st
Sun Oct 29 10:31:20 CST 2006
Actually, I've been thinking a bit more about doing my own newsletter
recipe within PmWiki as I can already do most of the necessary
functions (subscribe, unsubscribe, authenticate emails, sending
emails, etc) using zap (or with minimal modification at least).
The only thing I'm not sure how to do is throttle the emails which I
would need to do for my isp. Can someone give me a hint how to do
this conceptually? Here's what I envision so far:
1) Use various zap forms to subscribe, unsubscribe, etc. Emails are
stored as plain lists in admin protected pages. (Probably sandwiched
in [@ @]). Each list would have its own page in some predefined
2) ZAP can already dynamically create a simple authentication page and
process get variables, so confirming registrations is as simple as
sending out an email with a click this link to confirm your email.
3) Admins would have a simple interface which would allow him to
add/delete specific emails manually. It would be nice to
automatically check for duplicates. And sort.
4) At first, at least, I will probably need to manually handle
bounces. Might be able to add something later for common bounce
messages--but I don't have any way to handle incoming emails. Later
could perhaps write a script processed by cron which would handle
5) Use a admin protected form to send the email. Select the list, cut
and paste the message into a textbox. Click submit. Given the right
parameter, the ZAP emailer function sends the email message to a
ZAPnews separate scipt.
Now here is the point where I need help:
6) On submit I would need to process the email in such a way it only
sends out 100 emails every 60 minutes (both configurable). My thought
was, on the newsletter submit, the full mailing list could be split
into groups of 100 (any size), and saved as a series of small text
files based on the current timestamp (each one incremented by an
additional 60 minutes), and given an extra random number identifier to
separate them from any other messages that happen to be in the
queue--that ties the list to a specific message. That message of
course would also be saved in the same folder, also as a simple text
Next, set cron (I don't really know anything about this, but I think
you can use it to run a php script on a schedule?). Cron calls a
separate php function that checks for any text files in the queue with
a name less than 60 minutes old, retrieves the corresponding message,
and mails it out. Then, it deletes that list and quits the function.
Any thoughts on how this would work? If it sounds good, I think the
only part I would need much help with is actually the cron, and how to
run a function in php completely independent of PmWiki. If I could
somehow just set cron to every hour run a specific php function, that
could probably do it. The php doesn't seem too hard unless there's
something I'm missing.
More information about the pmwiki-users