Forum OpenACS Q&A: About email bounce back

Collapse
Posted by Taka Chan on
I have mailing list and I would like to spam all users on my list.
However, is it possible that I can keep track of the status of each
email being sent?  (i.e. if the mail is failed to deliver to the
user, I will be acknowledged of it so that I can re-sent the mail).

Is the spam module capable to do it?

Collapse
Posted by Steve Crossan on
The spam module in the aD ACS had some code that used VERP tags to track bounces and log them in the database. I think this was actually a perl script rather than TCL - and it relied on quickmail, though it could probably be made to work with another mail server too. I guess that code's been ported over to ACS3.2.5 at least. The module was called bulkmail - I don't know if it got ported (it was more of an add on to spam than a separate module) but the documentation for it is still there under /doc/bulkmail.html.

steve

Collapse
Posted by Henry Minsky on
In reality, you don't want to use the whole bulkmail machinery, which is really hairy because it attempts to use multithreading in Tcl
to stream email to multiple qmail servers in parallel, and that code was written before the nsv stuff was added to aolserver, so it is, well, too hairy.

What you do want to do is look at the code in bulkmail_sendmail.tcl,
which is a modified version of ns_sendmail, but it sets the envelope header to a custom address (i.e., the data that is sent in the SMTP command "MAIL FROM: xxxx@yyyy", rather than the "From:" header inside the mail message contents. This allows you to set the so-called envelope return address, which is where the foreign mailer will bounce message back if there is a delivery problem.

The stock ns_sendmail routine forces the "MAIL FROM:" SMTP command
to be the same as the "From:" field in the headers, effectively making it impossible to handle bounces correctly.

Once you have specified the envelope return address of your choice as a "bounce address" on your system (like maybe "mailto:my-web-mailer-errors@mysite.com";, you can configure qmail (or, God help you, sendmail) to handle
mail back to the "bounce" address in some smart way.

For the bulkmail system, we generated a unique key for the return
address of each spam, encoding the ACS user id in that key, so that we could track down the specific cause of each bounce; if you got a bounce when mailing to user 102934, you would mark his email address
as "bouncing_p = true".

The qmail
script we had merely touched a file with a unique id in a spool directory, and then
we had a tcl script which would periodically sweep that dir looking for these files, decoding their filename to find the user id, and
then marking the user's email address as "bouncing". Actually we gave them three bounces ,and then marked the address as bad.

Hope this helps. The docs in the doc/bulkmail file have some
notes on configuring qmail, but they are not complete I fear.

Good luck