I've successfully set Postfix to relay emails via Mandrill using SASL and
sender_dependent_relayhost_maps with a MySQL table so that different senders connect to Mandrill using their own Mandrill username and API key.
So far so good, but I've got three users that all use an Email Service Provider and the Sender in the message envelope is set to "email@example.com" for all three users, and the only place containing the actual user's email address is in the From: email header.
I'm happy with the security (or lack thereof) of using the From: email header as I'm only forwarding mails sent to specific email addresses that are tightly controlled, but I'd be really grateful for suggestions as to how I can best specify the relayhost based on the value of the From: header. Is there any way to set the envelope value to be the same as the From field? Or any other way to do this?