I'm writing my own discussion mailing list in PHP. I need some input on recovery methods in case the process is interrupted.
What I'm doing now is placing incoming messages into a queue directory and then starting my PHP CLI script. This script loops through each file in the queue, reads the message contents, extracts the subscribed email addresses from a SQL database, then uses SMTP to send the message to those addresses.
I'm concerned about what happens if the process is interrupted. How do I keep track of which addresses have already been delivered and which haven't? How do I resume from where it left off?
Should I keep a file with all the addresses for each message? If I did that, I'd have to rewrite the file after each address was sent. That doesn't seem very efficient.
Or I could replicate each message and place a copy of the message for each recipient in another queue folder, then delete them as they are sent. That seems pretty wasteful of space, though, especially if the message is large.
Any other ideas?
Mailing list error recovery
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
that's more a problem with your server's database core, than with the information needed to keep everyone up to date..
If you require integrity protection of the data then you should have dedicated hosting.. This can happen if the file system is corrupted as well.. the only fail safe systems are massively redundant and distributed.. and even then, there's a slight chance of total failure.
If you require integrity protection of the data then you should have dedicated hosting.. This can happen if the file system is corrupted as well.. the only fail safe systems are massively redundant and distributed.. and even then, there's a slight chance of total failure.