Linode (Debian) box with multiple web apps - is it possible to send emails from multiple domains via sendmail?

Solution 1:

  1. Yes. Some apps support specifying the "from" address. Otherwise you can make use of sendmail's genericstable feature, which

will cause unqualified addresses (i.e., without a domain) and addresses with a domain listed in class {G} to be looked up in a map and turned into another (“generic”) form, which can change both the domain name and the user name.

Example:

FEATURE(masquerade_envelope)
FEATURE(genericstable, `hash -o /etc/mail/genericstable')
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain') 

In /etc/mail/genericstable

bob [email protected]
sally [email protected]
  1. You need to have forward and reverse DNS of the mailserver match. You need to set up SPF for the domains that you will be using. If the IP appears in http://www.anti-abuse.org/multi-rbl-check/ you need to get a different IP. (Consider using a managed mail service. Running a mail server is annoying due to spammers ruining everything. However, since you are using sendmail you must like pain.)

  2. sendmail by default only listens on localhost so you don't need to do anything. If you've configured to listen on all interfaces then undo that.