So, let's do this with postfix.
The EASY way to do is, if the provider supports submission protocol (port 587).
Then in main.cf we set a relayhost
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
then we create /etc/postfix/sasl_passwd:
we create hash file:
#> postmap /etc/postfix/sasl_passwd
then we make:
#> chmod 400 /etc/postfix/sasl_passwd*
#> /etc/init.d/postfix restart
#> systemctl restart postfix (8 and above)
The HARD way is to do it with stunnel program.
We should do this ONLY if provider supports only ssl smtp connection.
Make sure stunnel is installed:
#> apt-get install stunnel4
First, make same steps as above BUT relayhost is with other valie:
then in /etc/postfix/main.cf check
relayhost = 127.0.0.1:10465
After setting relay to localhost at random port, we setup stunnel.
We create /etc/stunnel/mail.server.com.conf
It holds this:
client = yes
chroot = /var/lib/stunnel4/
setuid = stunnel4
setgid = stunnel4
pid = /stunnel4.pid
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
accept = 127.0.0.1:10465
connect = mail.hostit.bg:465
Then, we restart stunnel and postfix and we are ready.
TrackbacksTrackback specific URI for this entry
This link is not meant to be clicked. It contains the trackback URI for this entry. You can use this URI to send ping- & trackbacks from your own blog to this entry. To copy the link, right click and select "Copy Shortcut" in Internet Explorer or "Copy Link Location" in Mozilla.