Mail changes...

The historic domain name, corresponding to the physical place named "Place Jussieu" in Paris, served two universities, Paris Diderot and Pierre et Marie Curie.

In a few months, it will be gone. If one does not want to see too much e-mail lost, it is necessary to take preventive measures. Here is my pick.

Since I have already moved from one institution to another, and I know what it means when you loose your mail, I have decided a long time ago to use only an unique e-mail address, attached to my physical person, and that is simply roberto at dicosmo dot org. By the way, if you want yours, I do suggest you register a domain name with Gandi.

Unfortunately, many institutions insist on giving you their own e-mail address, so I also inherited various variants and combinations of roberto, di, cosmo, with and without dashes at, and I still get quite a few messages to an e-mail address that will soon disappear.

... need to tell the world ...

To make sure that the people using this soon-to-be-gone e-mail address will be warned in time, I have an auto-responder mechanism that answer every incoming mail with a standard message telling the sender that I have a new e-mail address.

... procmail to the rescue!

Luckily, since this mail arrives into a server where I can run procmail, I could set up this kind of autoresponders by myself.


First, make sure that all your incoming mail goes to procmail, by putting a line like the following one in the .forward file

"|IFS=' ';exec /usr/bin/procmail -t -m /PATH/TO/MY/HOME/FOLDER/.procmailrc"

Hey, if you are unsure about your procmail skill, use this variant, while testing: that will make a copy of all incoming mails in your usual folder (and yes, you need the \ )!

\yourloginname, "|IFS=' ';exec /usr/bin/procmail -t -m /PATH/TO/MY/HOME/FOLDER/.procmailrc"


Then, we cook a procmail recipe for the autoresponder and we put it in the .procmailrc file; here is my simple version, adapted from the typical procmail vacation code skeleton you can find in the manual page for procmailex:

#Note: On some systems -xSubject: has to be -x"Subject: "
SUBJ_=`formail -c -xSubject: \
       | sed -e 's/^*//g' -e 's/*$//g'`
# Was it to me
* ^TO_.*osmo@pps\.jussieu\.fr
# Ignore messages for daemons
# Avoid email loops
  :0 c
  | formail -rD 8192 dejatold.cache
  :0 eh
  | (formail -r \
     -I"Subject: Changed email address" ; \
     echo "Dear Sender," ; \
     echo "" ; \
     echo "Thank you for your email about" ; \
     echo "\"${SUBJ_}\"" ; \
     echo "" ; \
     echo "Please notice that my email address has changed." ; \
     echo " " ; \
     echo "  Old: MYOLDADDRESS" ; \
     echo "  New: MYNEWADDRESS" ; \
     echo " " ; \
     echo "Your email has been forwarded to my new address." ; \
     echo "Please update your address book immediately, as" ; \
     echo "this old address will stop working in June 2012." ; \
     echo " " ; \
     echo "--Roberto Di Cosmo <>" ) \
     | /usr/lib/sendmail -oi -t
Hmm, may you just translate this please?

Basically, what all this says is :

  • take any mail that has been sent to an e-mail address that seems to be the old one; you should change the following line to use a regular expression matching your old address
# Was it to me
* ^TO_.*osmo@pps\.jussieu\.fr
  • drop messages from daemons
# Ignore messages for daemons
  • drop possible looping messages: here you put a regular expression matching your new e-mail address (hence, . must be escaped as \. in the X-Loop line!)
# Avoid email loops
  • send the message to my new address, adding an X-Loop tag that will be used to prevent loops: here you put your new email address (no escaping of .)
  • check, in a cache called dejatold.cache, that I have not replied already to this sender in a while
| formail -rD 8192 dejatold.cache
  • if not, send a warning message back to the sender indicating that an address change is in order: change MYOLDADDRES to your old address, and MYNEWADDRESS to your new address
  • store all other messages in a local mailbox (not-me-to-check) for manual inspection if and when I'll have the time to do it
That's (almost) all folks :-)

This has been in production for a little over two months, now, and seems to have been doing its job with humans.

Unfortunately, it did not work well with bots.

I found now a huge amount of mail in the not-to-me-check mailbox: these are messages arrived to the old address, but that were not sent explicitly to it... in general, from what I can see, these messages are:

  • sent to old-style mailing lists which are built using manual alias files (believe it or not, there are still some around), so I am sure they will not be fixed soon
  • sent to modern mailing lists where I was somehow subscribed with the old address (so it's my job to make the change)
  • sent in Bcc to me (*sigh*)
  • sent by spammers, which I do hope will not read the autoresponse :-)
Standard disclaimer

Please feel free to take and adapt this recipe for your own use, but remember that you do it at your own risk. If you have any suggestions on how to improve the recipe or the procedure, you will be very welcome.


1. On Saturday, March 24 2012, 09:02 by Roberto Di Cosmo

Why not just use the "vacation" functionality ? Well, I really wanted to separate the mail that is sent to me using my e-mail address from mail I receive as part of a mailing list, or some other sort of alias. It is useful to send a "mail changed" message to the first class of senders, while it is useless for the second class of messages, that I store in a separate folder.

Looking into this folder this week-end, I discovered quite a few mailing lists to which I was still subscribed with the old address : some of them are modern, so I could just log into the system and change the subscription. I could not have done this using "vacation".

They posted on the same topic

1. On Sunday, January 11 2015, 01:34 by

& puis il y a les imitation (je en parle pas de contre fasson mais des sacs qui ressemble vachement mais ou il n'y a pas marquer longchamps dessus)