I am building a web application on my MacBook Pro which needs to send email. When the application attempts to send, the connection times out. I am running postfix and I I followed the directions found here.

To troubleshoot the server, I used telnet to manually connect to localhost on port 25. I was able to connect to it successfully, but I received no response as I typed commands. Here is a transcript.

Benjamin-Brames-MacBook-Pro:LaunchDaemons bbrame$ telnet localhost 25
Connected to localhost.
Escape character is '^]'.
helo bbrame
mail from: ben@benbrame.com
rcpt to: ben@benbrame.com

I connected to working mail server and typed the same commands. The mail server gave a response to each command I typed as expected.

Benjamin-Brames-MacBook-Pro:~ bbrame$ telnet smtp.newnorth.net 25
Connected to relay.glb.frontiernet.net.
Escape character is '^]'.
220 relay03.roch.ny.frontiernet.net ESMTP Postfix
helo bbrame
250 relay03.roch.ny.frontiernet.net
mail from: made_up_email@frontiernet.net
501 5.1.7 Bad sender address syntax. See http://postmaster.frontiernet.net

The mail log on my MacBook shows that it recognizes when I connect, but doesn't register any subsequent commands.

Dec  1 18:53:50 Benjamin-Brames-MacBook-Pro postfix/postscreen[21354]: CONNECT from []:56145
Dec  1 18:53:50 Benjamin-Brames-MacBook-Pro postfix/postscreen[21354]: WHITELISTED []:56145
Dec  1 18:54:08 Benjamin-Brames-MacBook-Pro postfix/smtpd[21359]: fatal: open /etc/postfix/submit.cred: No such file or directory
Dec  1 18:54:09 Benjamin-Brames-MacBook-Pro postfix/master[21176]: warning: process /usr/libexec/postfix/smtpd pid 21359 exit status 1
Dec  1 18:54:09 Benjamin-Brames-MacBook-Pro postfix/master[21176]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

Any guesses why the connection is timing out?



The last three log messages turned out to be the culprit. Googling for them turned up this page;

In order to fix the problem your console is displaying, you should:

  • Create a submit.cred file in /etc/postfix directory (sudo touch /etc/postfix/submit.cred will do).
  • Create a header for that file: sudo echo "submitcred version 1" >> /etc/postfix/submit.cred
  • Add as many lines as the number of users you want to enable to submit mail, in the form hostname|user|passwd: sudo echo''hostname|username|password" >> /etc/postfix/submit.cred
  • Give the file the appropriate permissions: sudo chmod 600 /etc/postfix/submit.cred

Once you've done this you could restart postfix and everything sould run smoothly.

I created the file /etc/postfix/submit.cred and set the permissions to 0600. Everything started working after that.

| improve this answer | |

Just comment out the imap_submit_cred_file = /etc/postfix/submit.cred in the /etc/postfix/main.cf file. Then you don't have to configure any usernames and passwords. And Postfix listens to localhost only by default.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .