Koozali.org: home of the SME Server

Make use of external smtp-server depend on virtual domain?

Offline holck

  • *
  • 322
  • +1/-0
In the server manager, I can choose between sending emails directly to their destination or going through an external SMTP-server. Is there a way for me to use an external SMTP-server for only some of the hosted domains? I.e. to send email directly to recipients, if the email comes from user@domain1.org, but go through the external SMTP-server, if the email comes from user@domain2.org?

Jesper H, Denmark
......

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Make use of external smtp-server depend on virtual domain?
« Reply #1 on: May 20, 2016, 03:47:56 PM »
If you want to use an external smtp server for some destination domains, but not others, you can do it via custom templates for /var/qmail/control/smtproutes.

I know of no method to use a different smtp server based on what the sender address is. Why do you want to do that?

Offline holck

  • *
  • 322
  • +1/-0
Re: Make use of external smtp-server depend on virtual domain?
« Reply #2 on: May 20, 2016, 11:06:44 PM »
I am struggling a bit with getting emails from my server accepted at the recipients' SMTP servers. Recently one such server has denied emails from my server, because my server doesn't have a proper name when doing reverse DNS lookup on its IP address. So I am considering to use an external SMTP service for my outgoing emails.

This external service requires proper SPF records for the domains in question. Instead of having to wait for these records to work for all my domains, I want to move one domain to using the external service at a time. And that is why I want to choose SMTP server based on the sender address. I hope this makes some kind of sense ...

Jesper H, Denmark
......

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Make use of external smtp-server depend on virtual domain?
« Reply #3 on: May 21, 2016, 12:50:41 AM »
holck

You need to request your ISP to configure reverse DNS lookup.
Use your ISPs smtp server.
Your ISP will usually accept all mail from your server as bona fide, or to say it another way, your ISP considers your server to be bona fide as it connects directly to their servers by a known physical connection.

Refer also to the SME Server Manual, Appendix section.

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Make use of external smtp-server depend on virtual domain?
« Reply #4 on: May 21, 2016, 12:11:31 PM »
I agree 120% with Janet

Offline holck

  • *
  • 322
  • +1/-0
Re: Make use of external smtp-server depend on virtual domain?
« Reply #5 on: May 27, 2016, 10:33:19 PM »
Unfortunately, my ISP will neither configure reverse dns for me nor provide a smtp-server...
......

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Make use of external smtp-server depend on virtual domain?
« Reply #6 on: May 27, 2016, 10:58:29 PM »
Use sendgrid.. A free account gives you 12000 e-mail/month

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Make use of external smtp-server depend on virtual domain?
« Reply #7 on: May 28, 2016, 05:48:17 AM »
Use sendgrid.. A free account gives you 12000 e-mail/month

Maybe that's not such a good idea - from Sendgrid's privacy policy:

"We may also share certain personally identifiable information we collect through the Site or Services with third party companies so that they may offer products and services to users of our Site or Services that we believe will be of interest to those users."

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Make use of external smtp-server depend on virtual domain?
« Reply #8 on: June 06, 2016, 05:35:52 AM »
I am struggling a bit with getting emails from my server accepted at the recipients' SMTP servers. Recently one such server has denied emails from my server, because my server doesn't have a proper name when doing reverse DNS lookup on its IP address. So I am considering to use an external SMTP service for my outgoing emails.

This external service requires proper SPF records for the domains in question. Instead of having to wait for these records to work for all my domains, I want to move one domain to using the external service at a time. And that is why I want to choose SMTP server based on the sender address. I hope this makes some kind of sense ...

Jesper H, Denmark

Hi Jesper,

Mostly your dns should update in less than 24h. Tipically 1 to 3 hours unless defined otherwise. If so just change the default ttl of your domains to one hour. Then the day after just change all your spf fields at the same time and switch sme a one hour after to use your external provider.

You might also adapt your spf to allow both your sme and your external service. If you send there the spf line they asked maybe we could help or point ressources to help you to adapt this. With spf policy allowing the both smtp server (yours and their) you can even wait few days before moving all your domains at once.


An alternative could also to run a sme remotly as a hosted server to act as your smtp server with static ip and comfigured reverse dns.

ISP are making it harder and harder to send mail, even if done in a proper way.