-3

How to configure sendmail to use different SMTP relay servers.

For example: For all gmail.com recipients sendmail should use gmail SMTP server obviously with Gmail smtp auth. For all yahoo.com recipients it should use yahoo.com SMTP with yahoo.com username and password. And for rest of the recipients it should use my dedicated SMTP server.

0

1 Answer 1

3

Why would you want to do that this way?

  • It's not going to work. At least GMail rewrites all mail it receives via an authenticated connection to the mail address connected with this account, so a mail from [email protected] would be rewritten to come from [email protected]. Try to explain to your users why all mail they send to GMail appears to come from you to the recipients.
  • It's not necessary. If your mail server is setup correctly, Gmail etc. will deliver your mail anyway, otherwise everyone sending a mail to a GMail user would be forced to have a Google account as well.
  • Doing this the reverse way sometimes makes sense, and I have such a setup with a private server. It acts as a normal SMTP server/gateway, but when I use it as a relay, it will deliver mails with authenticated SMTP according to the sender address, so a message from my gmail address would be relayed via authenticated gmail SMTP etc. This is a very special case and doesn't scale into a real production system.

Not the answer you're looking for? Browse other questions tagged .