LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


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

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.

http://pastebin.com/jM9tDdGg

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
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

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

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 http://bookmarks.honewatson.com/2008...il-smtp-relay/ 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
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

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
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

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:
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)

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:47 PM.

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