Hello,
I am trying to set up postfix with googlemail relay on a small server at my workplace but it desperately refuses to work. First I tried to edit /etc/postfix/main.cf manually and then restart postfix by running “systemctl reload postfix” as it is described at many internet sources but it was not successful. As I have the same version of OpenSuse installed on my laptop, I just tried to configure postfix by using YAST and this was successful. The problem is that the same settings made in yast for my server PC just do not work. Any email I am trying to send returns back and I can see the following message in the mail folder on the server (/var/mail/admin):
Error message:
Final-Recipient: rfc822; example@example.com (there is a real E-mail address in there)
Action: failed
Status: 5.7.0
Remote-MTA: dns; smtp.googlemail.com
Diagnostic-Code: smtp; 530 5.7.0 Must issue a STARTTLS command first.
bs2sm475454pbd.74 - gsmtp
–6A04CAC0A54.1425378203/linux.local
Content-Description: Undelivered Message
Content-Type: message/rfc822
If I do the same on my laptop, it just works fine.
I tried to compare the YAST-generated settings in /etc/postfix/main.cf on these two machines, but they seem to quite similar with one strange difference:
The broken conf:
############################################################
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_auth_enable = no
#smtpd_sasl_path = private/auth
#smtpd_sasl_type = dovecot
############################################################
TLS stuff
############################################################
#tls_append_default_CA = no
relay_clientcerts =
#tls_random_source = dev:/dev/urandom
smtp_use_tls = yes
#smtp_tls_loglevel = 0
smtp_enforce_tls = no
smtp_tls_CAfile =
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_cert_file = /etc/ssl/
smtp_tls_key_file = /etc/ssl/
The working conf:
############################################################
SASL stuff
############################################################
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_auth_enable = no
############################################################
TLS stuff
############################################################
#tls_append_default_CA = no
relay_clientcerts =
#tls_random_source = dev:/dev/urandom
smtp_use_tls = yes
#smtp_tls_loglevel = 0
smtp_enforce_tls = no
smtp_tls_CAfile =
smtp_tls_CApath = /etc/postfix/ssl/certs
smtp_tls_cert_file =
smtp_tls_key_file =
The three parameters highlighted in bold are different between the two machines, but:
If I just copy the three bold lines from the working conf and paste them on the place of the bold lines in the broken one and then restart postfix, it just stops working (any sent mail will be neither delivered nor returned).
If I first replace the bold lines in the broken conf and then run yast on the server and go there through the settings and save them, the broken conf file is restored completely.
Interestingly, there is no directory or file /etc/postfix/ssl/certs on the working machine, but there is a directory /etc/ssl/certs on both machines. So, somehow the working conf refers to a non-existent directory whereas the broken one refers to an existent one and still fails.
I have also tried to remove postfix from the server, delete the /etc/postfix directory completely and reinstall it using yast or zypper on the server, but all results remained the same: any email returns undelivered with the message shown above. Restart of the server does not help as well.
The googlemail configuration (account name, password) is completely identical on both machines.
Does anyone have any idea what might cause such a bug and what could be a solution for this?
Konstl