Unable to connect to SMTP

Hello,

I have been having a few issues with setting up email services. I followed this guide here: http://library.linode.com/email/postfix … 0.04-lucid">http://library.linode.com/email/postfix/postfix-dovecot-mysql-ubuntu-10.04-lucid

I am able to connect via imaps and retrieve mail. However, I am having issues trying to send mail. I can telnet to localhost on port 25 from the server itself. But using my own remote client, I am unable to telnet to port 25.

I tried enabling smtps from postfix's master.cf, restarting it and trying port 465. I can connect to the port remotely, but it doesn't seem to work correctly still.

I have gone over the guide a couple times to make sure I didn't miss anything. I have been at this for hours, so I am sure it is just something really simple I am missing.

Thanks for your help :)

10 Replies

Post master.cf

Post the output of (as root): netstat -anp | grep "LISTEN .*master"

What's your server's IP?

Can you telnet to your server's IP from the server on port 25?

Is your server running a firewall?

Does your local ISP block outbound port 25 except to its own mail servers?

> root@server:~# netstat -anp | grep "LISTEN .*master"

tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2592/master

IP: 173.230.153.211

Yes I can telnet locally:
> root@server:~# telnet localhost 25

Trying 127.0.0.1…

Connected to localhost.

Escape character is '^]'.

220 server.mydomain.com ESMTP Postfix (Ubuntu)

quit

221 2.0.0 Bye

Connection closed by foreign host.

I do not remember setting up a firewall. Although the default Ubuntu install may have.

Ohh, that is a possibility. I can't telnet from my client (remote) machine to any other server running smtp either. Although, I have never had an issue trying to get my mail client (Apples mail.app) to work with any mail server before.

I didn't say to localhost, I said to your public IP. But it's moot now; you're listening on 0.0.0.0 and I can connect (see below).

Find another client to test with.

From my Linode:

$ telnet 173.230.153.211 25
Trying 173.230.153.211...
Connected to 173.230.153.211.
Escape character is '^]'.
220 server.sleepycode.com ESMTP Postfix (Ubuntu)
^]
telnet> quit
Connection closed.

Any suggestions then for getting around the port 25 issue then?

Should I change the port? Could I possibly use 465 or 587 (I think its that)?

To enable port 587 (works fine where port 25 is blocked by your isp) just add:

submission inet n - n - - smtpd

to /etc/postfix/master.cf

You can enable the same options you have on the smtp entry

by adding the like this:

-o content_filter=spamassassin

service restart postfix

and test it by telnet localhost 587

Does that work with SSL?

I can get it to work via telnet, but I can't login. It wants me to do a starttls or similar. It is refusing the login command.

Thanks for all the help so far. It is greatly appreciated :)

Alright I found something that works.

I disabled submission and smtp, then enabled smtps (without the options below it). This seems to work.

@Jay3ld:

I disabled submission and smtp
Without the smtp entry you will not be receiving any mail on this server - is that really what you want?

> then enabled smtps (without the options below it). This seems to work.
You should consider enabling those options and setting up your client to use SSL - it is generally not a great idea to be sending your login info through an unencrypted connection these days.

I guess I will have to play with it some more and try to get it to work with those options enabled. When I tried it with all the options enabled, I couldn't get it to work. My mail.log didn't show anything in regards to when I tried to connect to smtp.

So, what is the idea of having "smtps" in my master.cf, if it isn't already being made with a secure connection of some sorts? That just seems like a false positive.

The "smtps" field simply specifies the port that that process is going to listen on - it is the following lines of options that actually configure it to use SSL.

Other people sending mail to you will always try to connect on port 25, which is what the original "smtp" line enables, so unless you really know better you want to leave that in place all the time.

There is more to setting up SSL or TLS on the server though - you need a certificate for the server and postfix needs to know about it.

http://www.postfix.org/TLS_README.html

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct