Advanced Email Setup

About this HowTo

MoinMoin versions
1.9.4
Platforms
Debian Linux

A basic email setup is easy to achieve by following your nose, however if you want to have an advanced setup with different Envelope and Header "From" addresses then read on. This Howto currently assumes (and depends on) you sending mail via local "sendmail" and not directly over SMTP.

Basic Email Setup

Basic email setup to send via local "sendmail". This is documented fully elsewhere.

mail_from = u"My Wiki <NO_REPLY@example.com>"
mail_sendmail = u'/usr/sbin/sendmail -t -i'

This will send every email TO: NO_REPLY@example.com and BCC the real recipients. Also the email will be From NO_REPLY@example.com. In email like on paper mail the From address on the "envelope" can differ from that on the "letter". With this basic setup the envelope From address will be NO_REPLY@example.com so if the message bounces that is where the bounce will go... also it is in the body Header From which means if the recipient hits "reply" then NO_REPLY@example.com will get an email.

Advanced Email Setup

Theory

I prefer to send automated email like this with a real envelope From address which can collect bounce messages to aid account maintenance and freshness. I also like the header From to differ from the envelope From address as the end recipient need never know about the bounce address.

At first I thought I would have to patch the moinmoin sendmail code to achive this but then I realised I could do it simply with configuration of the mail_sendmail config variable.

I should note here that it is still my belief that a patch will be required to achieve this goal if using SMTP submission of email.

Assuming you are using local "sendmail" sumbission of email you can specifiy an envelope From on the sendmail command line by using the -f switch (and the -F switch for the human readable part).

Basic email setup will actually send every email to the "mail_from" address... which I don't want. As sendmail (or in this example the drop in replacement exim) will take any further arguments to the sendmail command as addresses to IGNORE from the delivery list then we can easily stop delivery to "mail_from" by explicitly stating it on the command line. #

Practice

Confirmed working:

mail_from = u"My Wiki <NO_REPLY@example.com>"
mail_sendmail = u'/usr/sbin/exim4 -bm -t -i -F"My Wiki" -f real-bounce-address@example.com NO_REPLY@example.com'

Unconfirmed but probably more portable:

mail_from = u"My Wiki <NO_REPLY@example.com>"
mail_sendmail = u'/usr/sbin/sendmail -t -i -F"My Wiki" -f real-bounce-address@example.com NO_REPLY@example.com'

MoinMoin: HowTo/AdvancedEmailSetup (last edited 2014-08-11 13:46:01 by PaulBoddie)