-   Linux - Server (
-   -   Postfix is not sending via my Gmail account smtp. (

Usalabs 02-11-2011 01:42 AM

Postfix is not sending via my Gmail account smtp.
I'm trying to set up my postfix server to relay mail (via a php cms) using Gmail's smtp on my account, but for some reason, Gmail returns an error code that STARTTLS must be sent first, my postfix main.cnf file can be found at pastebin, because of this forum's text length I can not paste my postfix main.cnf file,,,as can be seen I have everything set and configured for Gmail, but postfix (for some unseen reason) can not send STARTTLS.

If the configuration is wrong, can someone please change it and re-post to pastebin?,,, thanks

Noway2 02-11-2011 05:41 AM

See this link:

Specifically, look at the section titled Enabling TLS in the Postfix SMTP server. In your you have smtpd_use_tls = no as well as smtpd_tls_security_level = encrypt. These two settings conflict each other. As the smtpd_use_tls is obsolete, I would remove this reference. It is also recommended that you set smtpd_tls_security_level to may instead of encrypt. If the other end supports it, may will tell it to announce starttls first.

I would also recommend that you look very closely at your and review what each of these settings do. I notice that you have settings for smtp_xxx and smtpd_xxx, which something that I haven't seen before. Looking at the document I referenced above, see the section titled TLS support in the LMTP delivery agent - and the one right below it where it says that the smtp_xxx functions are for client certificates for local delivery and that it is an uncommon option that tends to cause problems.

Usalabs 02-11-2011 12:48 PM

OK, I changed the settings recommended, and postfix is still not announcing STARTTLS, I still get the error sent back from Gmail, 'STARTTLS must be sent first', and the log files 'mail', and 'mail.err' don't show anything relating to tls.

I've always had problems with postfix, first I couldn't, and still can't set it as a closed relay (currently even though my isp block ports 25 and 110, my linux box firewall is closed to ports 25 and 110), and now, I can't set it as a local relay to send emails from a local php script (running on the same system as postfix) to a Gmail's smtp (via my Gmail account), then Gmail would route it out to a recipients address.

The error I get is when postfix receives the Gmail error and sends that error as an internal email.

Maybe I may have better results using sendmail.

The setting up of postfix, I followed the instructions here and there many other tutorials on the subject, but they are all basically the same.

repo 02-11-2011 12:55 PM

Did you compiled postfix with TLS support?
Did you create the certificat?

Kind regards

Usalabs 02-11-2011 01:03 PM

Yes I checked the config with ldd /usr/lib/postfix/smtp and it showed sasl and ssl support, and yes I created the certificate, stored in /etc/postfix/certs

Code: =>  (0xffffe000) => /usr/lib/ (0xb789d000) => /usr/lib/ (0xb788e000) => /usr/lib/ (0xb7888000) => /usr/lib/ (0xb7854000) => /usr/lib/ (0xb7820000) => /usr/lib/ (0xb7805000) => /lib/ (0xb7665000) => /lib/ (0xb74fa000) => /lib/ (0xb74a3000) => /lib/ (0xb748b000) => /lib/ (0xb7486000) => /usr/lib/ (0xb7341000) => /lib/ (0xb7327000) => /lib/ (0xb7313000)
        /lib/ (0xb78c0000) => /lib/ (0xb72f7000)

All times are GMT -5. The time now is 08:01 PM.