Local MTA – advantages
Local mail servers such as Postfix or Sendmail are the most reliable ways to forward e-mail to EmailLabs™. Setting up your application in a way that sends e-mails to EmailLabs ™ by using a smart host, will use the mechanism of queueing, allowing you to get a higher stability and bandwidth. In addition, by excessive load, or a loss of connection between the EmailLabs™ server and the local server, the transmission will resume as soon as possible.
With high traffic, local relays are able to take advantage of more advanced SMTP mechanisms, such as pipelining and caching connections. Thanks to this, the mail server is able to send a lot more e-mails, than a single script reconnecting for every single message.
Mail server configuration
Postfix Configuration
To properly configure Postfix log in as root or obtain root privileges using the su or sudo command, then in the configuration file /etc/postfix/main.cf add the following entry:
1 2 3 4 5 6 7 8 9 |
relayhost = [smtp.emaillabs.net.pl]:587 smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/relay_password smtp_sasl_security_options = |
Next, create a password file in accordance with the path that we provided in the previous post:
1 2 |
cd /etc/postfix/ touch relay_password |
Add to the created file:
1 |
smtp.emaillabs.net.pl username:password |
Save the file and for security reasons change the permissions for the file with the command:
1 |
postmap /etc/postfix/relay_password |
1 |
chmod 600 /etc/postfix/relay_password |
If you do not have libsasl2 library (SASL) installed, install it before restarting postfix
Finally, restart the postfix server
1 |
/etc/init.d/postfix restart |