Question

530 5.7.0 Must issue a STARTTLS command first

Asked by: Surefoot3


I have RedHat 9 and I’ve followed the ‘Gmail on Home Linux Box using Postfix and Fetchmail” instructions with what I thought was great success. (I didn’t see any errors through the process)  I’ve got the fetchmail piece working just fine, but I just can’t seem to find what I’ve done wrong with the postfix config.  I’ve search google for the error below  and got some hits but no answers that fixed my problem.  You can see the errorlog below.

Postfix Error: 530 5.7.0 Must issue a STARTTLS command first

My Network Arch
lnxsrv01.domain01.sw(RH9, Postfix) --> Cisco Firewall--> INTERNET-->smtp.google.com

Can you point me in a direction to figure out what is causing this.

Thanks for your help
Dave

 /var/log/maillog
Apr  7 14:57:54 lnxsrv01 postfix/qmgr[4584]: A5BF21C050: from=<root@domain01.sw>, size=428, nrcpt=1 (queue active)
Apr  7 14:57:54 lnxsrv01 postfix/smtp[4587]: initializing the client-side TLS engine
Apr  7 14:57:54 lnxsrv01 postfix/smtp[4587]: A5BF21C050: to=<user100@companyx.com>, relay=smtp.gmail.com[64.233.167.109], delay=10, status=bounced (host smtp.gmail.com[64.233.167.109] said: 530 5.7.0 Must issue a STARTTLS command first v50sm12660pyv (in reply to MAIL FROM command))
Apr  7 14:57:54 lnxsrv01 postfix/cleanup[4585]: D987D1C052: message-id=<20060407185754.D987D1C052@lnxsrv01.domain01.sw>
Apr  7 14:57:54 lnxsrv01 postfix/qmgr[4584]: D987D1C052: from=<>, size=2346, nrcpt=1 (queue active)
Apr  7 14:57:54 lnxsrv01 postfix/qmgr[4584]: A5BF21C050: removed
Apr  7 14:57:55 lnxsrv01 postfix/smtp[4587]: D987D1C052: to=<root@domain01.sw>, relay=smtp.gmail.com[64.233.167.111], delay=1, status=bounced (host smtp.gmail.com[64.233.167.111] said: 530 5.7.0 Must issue a STARTTLS command first d13sm44592pyd (in reply to MAIL FROM command))
Apr  7 14:57:55 lnxsrv01 postfix/qmgr[4584]: D987D1C052: removed

Not to confuse the issue but I was doing some trouble shooting by taking postfix out of the equation by using the openssl s_client command and I get the following error message from smtp.gmail.com . 502 5.5.1 Unrecognized command after the STARTTLS has been issued which results in SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:601  Does this help?


lnxsrv01:/root# openssl s_client -starttls smtp -debug -CApath /usr/share/ssl/certs/ -connect smtp.gmail.com:25
CONNECTED(00000003)
read from 08194320 [08174D80] (8192 bytes => 39 (0x27))
0000 - 32 32 30 20 2a 2a 2a 2a-2a 2a 2a 2a 2a 2a 2a 2a   220 ************
0010 - 2a 2a 2a 2a 2a 2a 2a 2a-2a 2a 2a 2a 2a 2a 2a 2a   ****************
0020 - 2a 2a 2a 2a 2a 0d 0a                                            *****..
write to 08194320 [BFFFEAA0] (21 bytes => 21 (0x15))
0000 - 45 48 4c 4f 20 73 6f 6d-65 2e 68 6f 73 74 2e 6e   EHLO some.host.n
0010 - 61 6d 65 0d 0a                                                   ame..
read from 08194320 [08174D80] (8192 bytes => 106 (0x6A))
0000 - 32 35 30 2d 6d 78 2e 67-6d 61 69 6c 2e 63 6f 6d   250-mx.gmail.com
0010 - 20 61 74 20 79 6f 75 72-20 73 65 72 76 69 63 65    at your service
0020 - 0d 0a 32 35 30 2d 53 49-5a 45 20 32 30 39 37 31   ..250-SIZE 20971
0030 - 35 32 30 0d 0a 32 35 30-2d 38 42 49 54 4d 49 4d   520..250-8BITMIM
0040 - 45 0d 0a 32 35 30 2d 58-58 58 58 58 58 58 41 0d   E..250-XXXXXXXA.
0050 - 0a 32 35 30 20 45 4e 48-41 4e 43 45 44 53 54 41   .250 ENHANCEDSTA
0060 - 54 55 53 43 4f 44 45 53-0d 0a                               TUSCODES..
write to 08194320 [BFFFEAA0] (10 bytes => 10 (0xA))
0000 - 53 54 41 52 54 54 4c 53-0d 0a                               STARTTLS..
read from 08194320 [08172D78] (8192 bytes => 47 (0x2F))
0000 - 35 30 32 20 35 2e 35 2e-31 20 55 6e 72 65 63 6f    502 5.5.1 Unreco
0010 - 67 6e 69 7a 65 64 20 63-6f 6d 6d 61 6e 64 20 32    gnized command 2
0020 - 34 73 6d 33 32 38 30 30-39 31 6e 7a 6e 0d 0a       4sm3280091nzn..
write to 08194320 [081AF8D0] (148 bytes => 148 (0x94))
0000 - 80 92 01 03 01 00 69 00-00 00 20 00 00 39 00 00   ......i... ..9..
0010 - 38 00 00 35 00 00 16 00-00 13 00 00 0a 07 00 c0   8..5............
0020 - 00 00 33 00 00 32 00 00-2f 00 00 07 05 00 80 03   ..3..2../.......
0030 - 00 80 00 00 66 00 00 05-00 00 04 01 00 80 08 00   ....f...........
0040 - 80 00 00 63 00 00 62 00-00 61 00 00 15 00 00 12   ...c..b..a......
0050 - 00 00 09 06 00 40 00 00-65 00 00 64 00 00 60 00   .....@..e..d..`.
0060 - 00 14 00 00 11 00 00 08-00 00 06 04 00 80 00 00   ................
0070 - 03 02 00 80 b0 c3 5e 1d-87 5a ea 1c 64 d5 ef 94   ......^..Z..d...
0080 - 17 c0 9b b0 84 cc a5 68-75 2f 18 7e 76 1d ea 3f   .......hu/.~v..?
0090 - 2d dc 1c c4                                       -...
read from 08194320 [081B4E30] (7 bytes => 7 (0x7))
0000 - 35 30 32 20 35 2e 35                              502 5.5
11686:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:601:

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2006-04-13 at 12:05:12ID21813187
Tags

starttls

,

issue

,

command

,

must

,

first

Topic

Email Software

Participating Experts
4
Points
500
Comments
8

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. SSL Cert
    Greetings! I'm wanting to setup SSL encryption for a web server that will be used by employees to enter data. Is there a way to setup a SSL certificate in IIS 5 on Windows 2000 without getting a cert from Verisign? This site will only be used by employees for entering comp...
  2. Accessing SSL Certs on a linux (redhat) shared server
    Hi, Is it possible to transfer SSL certs from a shared server (redhat linux) to a new server (with full access)? If so what kind of steps are needed? Thanks, Suzy
  3. keytool, IIS and SSL cert
    I created a cert on II6 (win2003) by using selfssl.exe. This worked fine and automatically attached the cert in my IIS, so now i can run all my asp pages over ssl successfully. However there is one piece of my webapp that uses Java to request an ASP page over SSL. But this re...
  4. Unable to connect using Citrix SSL Relay
    Im configuring a Citrix Presentation Server on Windows Server 2003 that needs to be securely accessed via SSL. To that end I have implemented Citrix SSL Relay on the same server. Everything works fine as long as I access the web interface with HTTP, but the moment I try for ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: Cyclops3590Posted on 2006-04-13 at 19:52:59ID: 16450934

first lets turn up the logging for postfix.  In the master.cf file one of the first lines (uncommented that is) you should see is something like this:
smtp  inet - - - - smtpd
add to this line so that the end says "smtpd -v -v" instead of just "smtpd"

this will turn on verbose logging so that you will be able to see the entire smtp communication in the logs.

WARNING: if you server has a lot of traffic than do not have this active for long or your logs will really balloon out of control.
After you get that changed restart postfix (not just a reload; my personal preference to ensure the entire postfix daemon is running correctly)
then post the relevant logs.

you might want to post a sanitized copy of the main.cf as well.  i don't want to speculate aon what I think it is until I get a little more information.

 

by: NopiusPosted on 2006-04-16 at 18:27:20ID: 16466537

Read gmail docs.
http://mail.google.com/support/bin/answer.py?answer=13285
STARTTLS command  is available on port 587, not on 25.

 

by: Cyclops3590Posted on 2006-04-16 at 18:58:00ID: 16466614

in which case should be a simple change of the relay you are using.  Instead of "smtp.google.com" it should just be "smtp.google.com:587"

 

by: ridPosted on 2006-04-17 at 02:07:06ID: 16467731

I don't think the gmail smtp server listens on port 25 for mail, anyway, but a custom port. It also uses SMTPAUTH, if I'm not mistaken. At least for regular, non-paying customers.
/RID

 

by: Cyclops3590Posted on 2006-04-19 at 09:24:09ID: 16489396

Surefoot3, are you finding any of this to be any help at all?

 

by: Surefoot3Posted on 2006-04-20 at 05:57:17ID: 16497640

Thank you all for the help.  I actually solved this myself (I continued working the problem) by buying the "The book of Postfix" and finding the out how to turn on deeper level logging.

I'm going to award 450 points to Cyclops3590 because He/She would have lead me down the right path to figuring out the multiple issues that I had in my configuration and 50 points to Nopius for picking up the port 587 issue i had.  

The answer was multi-layered and I began to find it out by locating where to turn on the additional logging for the smtp process.  In my scenorio, postfix was acting as the client connecting to google smtpd server so I found the master.cf file and modified the smtp line to include an smtp -v on it.  Then the /var/log/maillog started include a bunch of good error messages to help me track it down.

A. Turn on logging.
master.cf
smtp      unix  -       -       n       -       -       smtp -v

B. main.cf  changes.  ( see my comment below on what I changed to get it to work)

relayhost = [smtp.gmail.com]:587    --> Can't use the default port with gmail, it must be 587
disable_dns_lookkups = yes
queue_directory = /var/spool/postfix
program_directory = /usr/libexec/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_spool_directory = /var/spool/mail
mailbox_command = /usr/bin/procmail
mail_owner = postfix
default_privs = nobody
debug_peer_level = 1
local_destination_concurrency_limit = 2
default_destination_concurrency_limit = 20
mynetworks = 10.1.1.0/24, 127.0.0.0/8
myhostname = lnxsrv01.domain01.sw
mydomain = domain01.sw
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, $mydomain
smtp_tls_loglevel = 1
smtp_enforce_tls = no               ---> I had this set to YES and had to change to NO.
                                               ---- smtp.gmail.com is actually a CNAME value and this postfix setting forces a
                                               ---- comparision of the dns A record gmail-smtp.l.google.com that smtp.gmail.com
                                               ---- CNAME points to with the common name (CN) value in the public certificate i
                                               ---- downloaded from gmail.com.   The CN value in the certificate is smtp.gmail.com
                                               ---- so the tls session was not authenticating gmails public certificate.  
                                               ----  dig smtp.gmail.com  
                                               ----       smtp.gmail.com.     300     IN      CNAME   gmail-smtp.l.google.com.
                                               ----       gmail-smtp.l.google.com. 300    IN      A       64.233.163.111
                                               ----      gmail-smtp.l.google.com. 300    IN      A       64.233.163.109

smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_certfile = /etc/postfix/lnxsrv01-cert.pem
smtp_tls_keyfile = /etc/postfix/lnxsrv01-key.pem
smtp_tls_session_cache_database = btree:/var/run/smtp_tls_session_cache
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd  ---> the next changes took place in here.  Because the
                                                                                         ---   relay host value changed above, postfix actually
                                                                                         ---   looks for the exact same value in your passwd file
                                                                                         ---   my sasl_passwd file contains the following
                                                                                         ---  
                                                                                         ---  [smtp.gmail.com]:587    xxxxxx@gmail.com:yyyyyy
smtp_sasl_security_options = noanonymous
inet_interfaces = all
default_transport = smtp
sender_canonical_maps = hash:/etc/postfix/sender_canonical
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
transport_maps = hash:/etc/postfix/transport

 

by: Cyclops3590Posted on 2006-04-20 at 06:09:01ID: 16497749

for future ref, i'm a he.

You'll love that book.  I own 5 postfix books and that one is no contest the best one I've come across for explaining everything in postfix.

 

by: ikfrancisPosted on 2008-06-04 at 05:18:15ID: 21709204

I had the same problem but using IMAP in Outlook 2003. The Google specific help page is: - http://mail.google.com/support/bin/answer.py?answer=77661&topic=12920.

Kind regards

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...