LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix is not sending via my Gmail account smtp. (http://www.linuxquestions.org/questions/linux-server-73/postfix-is-not-sending-via-my-gmail-account-smtp-861973/)

Usalabs 02-11-2011 12: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.

http://pastebin.com/jM9tDdGg

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

Noway2 02-11-2011 04:41 AM

See this link: http://www.postfix.org/TLS_README.html

Specifically, look at the section titled Enabling TLS in the Postfix SMTP server. In your main.cf 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 main.cf 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 11:48 AM

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 http://bookmarks.honewatson.com/2008...il-smtp-relay/ and there many other tutorials on the subject, but they are all basically the same.

repo 02-11-2011 11:55 AM

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

Kind regards

Usalabs 02-11-2011 12: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:

linux-gate.so.1 =>  (0xffffe000)
        libpostfix-master.so.1 => /usr/lib/libpostfix-master.so.1 (0xb789d000)
        libpostfix-tls.so.1 => /usr/lib/libpostfix-tls.so.1 (0xb788e000)
        libpostfix-dns.so.1 => /usr/lib/libpostfix-dns.so.1 (0xb7888000)
        libpostfix-global.so.1 => /usr/lib/libpostfix-global.so.1 (0xb7854000)
        libpostfix-util.so.1 => /usr/lib/libpostfix-util.so.1 (0xb7820000)
        libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb7805000)
        libcrypto.so.1.0.0 => /lib/libcrypto.so.1.0.0 (0xb7665000)
        libc.so.6 => /lib/libc.so.6 (0xb74fa000)
        libssl.so.1.0.0 => /lib/libssl.so.1.0.0 (0xb74a3000)
        libresolv.so.2 => /lib/libresolv.so.2 (0xb748b000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7486000)
        libdb-4.5.so => /usr/lib/libdb-4.5.so (0xb7341000)
        libnsl.so.1 => /lib/libnsl.so.1 (0xb7327000)
        libz.so.1 => /lib/libz.so.1 (0xb7313000)
        /lib/ld-linux.so.2 (0xb78c0000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb72f7000)



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