I'm running multiple websites on a single server. I'm using sendgrid to send my email.
Right now, I have postfix relay all outgoing mail to a single sendgrid account, using smtp_sasl for authentication.
I need to be able to send each domain's email to a different sendgrid account. So, for domain1.com, I'd want to relay to sendgrid using one account, and for domain2.com, I'd need postfix to use a different account to authenticate.
Best Answer
It's a shame that this one went for so long without a correct answer. And for that matter it's a shame it's not a dealt with by sendgrid's own documentation. The required directives are dealt with succinctly at http://www.postfix.org/SASL_README.html#client_sasl_sender, which I'll quote here, with some sendgrid specific modifcation:
/etc/postfix/main.cf:
/etc/postfix/sasl_passwd:
/etc/postfix/sender_relay:
A few notes here though.