I send mail using ssmtp (a simple standalone SMTP library) and one of the SMTP servers for the different freemail addresses I have.
When receiving an email to ad...@gmx.de, I'd like to reply using that as the From line, and also the corresponding SMTP account, of course. Same thing for ad...@gmx.de, ad...@googlemail.com and so on. set from = "ad...@gmx.de" # main address set alternates = "^(ad...@gmx.de|ad...@gmx.de|ad...@googlemail.com)$" set use_from = yes # generate From: header set reverse_name = yes # use alternates when replying This seems to set my sender address as desired. But in order for the mail to get accepted by the SMTP server, I have to select matching SMTP server settings (addr1 account for addr1 etc), and I can't seem to figure out how to change the sendmail command based on the sender address. A send-hook, for instance, is for "Chang[ing] settings based upon message recipients", which is fine, but not what I beed in this case. Is the best option to write a shell or Perl script to parse the mail, determine the appropriate SMTP server from the "From" line (first line of the mail), and then to exec ssmtp with the appropriate arguments or configuration file? -- Michael Ludwig