0

i want to make a specific setup for my site but im not sure if its possible or how to do it... The thing is, my site had a few issues which i tracked to connectivity problems to mandrill, so i temprary fixed the issue changing the settings to use my own SMTP, but what i want to accomplish is send mail to my local SMTP ("faster") using exim or postfix, and then try to forward it via mandrill to the end user, if it gives timeout try direct delivery...

thanks

Luis M
  • 5
  • 4

1 Answers1

0

The recommended setup is always to deliver emails to localhost postfix and have the local postfix forward the email to the correct mail server. This makes the web sites emails more robust, as it avoids any remove mail problem by queuing the email locally. The fallback to direct delivery is tricky, as you can't do it directly, you have to use a fallback server that will do the delivery

So setup your site to deliver to localhost (or use the sendmail command) and add to the postfix the relayhost = [remote-smtp.domain] (keep the [] to keep postfix from using the any MX for remote-smtp.domain )

when the delivery fails, you need to use the fallback parameter to use another server, that will do the direct delivery. Setup the smtp_fallback_relay=[other.server.domain] to deliver the emails to another server. This server can be a different server (simpler) or the same machine, running a second instance of postfix (more work, check this)

you can use your ISP mail server, with SASL auth as a fallback mail server or some friend server. If not, let the emails wait in queue until the relayhost recovers and all emails are flushed

higuita
  • 1,173
  • 9
  • 13