• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved VPS mail Postfix external relay

shogunswb

Basic Pleskian
Server operating system version
CentOS Linux 7.9.2009
Plesk version and microupdate number
18.0.50 Update #2
I am trying to set up a VPS on Heart Internet which turns out to be a Godaddy VPS.
They use a mail relay server & block port 25 but Plesk support told me that port 25 is needed to communicate with other mail servers but that it sends mail via port 587.
I have Postfix installed as the MTA & I have been told by Heart Internet (WHO ARE F^&%$£@!G USELESS) that I need to use "n1smtpout.europe.secureserver.net" as my SMTP relay server but I cannot get it to work.
I have edited the main.cf file with the addition of:

relayhost = [n1smtpout.europe.secureserver.net]:587
smtp_tls_security_level = encrypt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
header_size_limit = 4096000
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous

I think it might have something to do with the sail_passwd which I dont know how to create.
Has anyone else managed that could point me in the right direction
 
Create a text file password in /etc/postfix folder using the following command:
# touch /etc/postfix/password

You need to add a username and password in /etc/postfix/password in this format:
Code:
#smtp.isp.com       username:password
n1smtpout.europe.secureserver.net    <SMTP username>:<password>

Next:
Code:
# chown root:root /etc/postfix/password
# chmod 0600 /etc/postfix/password
# postmap hash:/etc/postfix/password

Restart Postfix and test if it works:
Code:
# systemctl restart postfix
# echo 'This is a test.' > /tmp/test
# mail -s 'Test' [email protected] < /tmp/test
# tail -f /var/log/maillog
# rm /tmp/test
 
Hi
Thank you for your assistance the code & explanation were brilliant.
I followed the instructions but got a warning:

# postmap hash:/etc/postfix/password
postmap: warning: /etc/postfix/main.cf, line 698: overriding earlier entry: smtp_tls_security_level=encrypt

I believe this refers to another line in the main.cf file which is:

line 698: smtp_tls_security_level = may

Initially I had my additional code at the end of the file but I moved it above the line above thinking it would supersede it but apparently not.

When I try to run the test email I get:

send-mail: warning: /etc/postfix/main.cf, line 698: overriding earlier entry: smtp_tls_security_level=encryptpostdrop: warning: /etc/postfix/main.cf, line 698: overriding earlier entry: smtp_tls_security_level=encrypt

I changed line 698 to: smtp_tls_security_level = encrypt

and changed the file name password.db to sasl_passwd.db & tried to send the test email but the connection to the relay server kept on timing out.

I have since been told by Heart Internet that I shouldn't need to authenticate against the relay server "because of the way it works"

I have restored the backed up main.cf file & just added the relay host in & renamed the two password files but still times out against the relay server.

Any other help would be appreciated.
 
I have just cracked it.

When I contacted Plesk support about the problem they referred me to a page on how to set Postfix to send via an external relay which was:

relayhost = [ansmtp.server.somewhere]:587

In order to finally get mine working I noticed in the postfix main.cf file that there are several relayhosts hashed out but none of them have a port number at the end.

I deleted the port number & placed this line under the hashed out relayhosts, saved the file,

relayhost = [n1smtpout.europe.secureserver.net]

restored postfix & sent a test email successfully.

Heart Internet support could have very easily told me how to do this especially as they offer fully managed VPS's with Plesk but since being taken over by Godaddy they have become increasingly obnoxious.

I am only having to set up a VPS because they are switching off my dedicated server at the end of the month (with two months notice) after years of building up an email reputation with the likes of Microsoft & google & now I have to use a mail relay that all the Godaddy VPS's in Europe have to use & probably has a worst reputation than Putin.
 
Back
Top