Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 02-11-2011, 12:42 AM   #1
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 124

Rep: Reputation: 15
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

Last edited by Usalabs; 02-11-2011 at 12:45 AM.
Old 02-11-2011, 04:41 AM   #2
Senior Member
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
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.
Old 02-11-2011, 11:48 AM   #3
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 124

Original Poster
Rep: Reputation: 15
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.

Last edited by Usalabs; 02-11-2011 at 11:55 AM.
Old 02-11-2011, 11:55 AM   #4
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Did you compiled postfix with TLS support?
Did you create the certificat?

Kind regards
Old 02-11-2011, 12:03 PM   #5
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 124

Original Poster
Rep: Reputation: 15
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)

Last edited by Usalabs; 02-11-2011 at 12:07 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with perl sending email with Gmail SMTP sadarax Programming 3 09-12-2009 07:17 PM
Can sbdy give config files for gmail account for sending with mutt for a normal user? frenchn00b Linux - Newbie 1 07-24-2007 01:14 PM
Why is PostFix sending mail using the email address of the smtp account? taigon Linux - Server 34 02-09-2007 01:09 AM
How to setup an SMTP account in Postfix? phph Linux - Software 3 11-22-2006 08:06 AM
Postfix Help - Sending via third party smtp scarstens Linux - Networking 3 01-27-2004 05:55 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:19 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration