Can not send mail by port 25 but can with SSL on port 465

postfix

netstat -tunlp | grep :25
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      -
tcp6       0      0 :::25                   :::*                    LISTEN      -

i am having problem sending mails with postfix. I can send it by SSL and port 465 but not with port 25. When I use port 25 i can't get any error in /var/log/mail.log or mail.err

Port is opened:

telnet agadomarketing.com 25
Trying 84.255.253.186...
Connected to agadomarketing.com.
Escape character is '^]'.
220 mail.agadomarketing.com ESMTP Postfix

when i send by roundcube mail i get this:

Jul 15 10:06:07 ubuntu-server postfix/smtpd[9272]: lost connection
after UNKNOWN from localhost[127.0.0.1] Jul 15 10:06:07 ubuntu-server
postfix/smtpd[9272]: disconnect from localhost[127.0.0.1]

generally error

SMTP Error (-1): Connection to server failed

EDIT:

my /etc/hosts

127.0.0.1      localhost
127.0.1.1      ubuntu-server.agadomarketing.com        ubuntu-server

what can be wrong? Is etc/hosts correct?

Best Answer

I think you've typoed in a config file. See what I get when I do:

[madhatta@risby iplayer]$ telnet agadomarketing.com 25
Trying 84.255.253.186...
Connected to agadomarketing.com.
Escape character is '^]'.
220 mail.agadomatketing.com ESMTP Postfix

Note the incorrect spelling of the domain name in the ESMTP header. If your server really does believe that it's the authoritative mail repository for agadomatketing.com, it'll probably refuse to accept mail for agadomarketing.com, because it'll regard that as foreign traffic and thus relaying. When sending via SSL, you're probably also doing SMTP AUTH, and would therefore be allowed to relay. Though who knows what it's doing with mail it then accepts for your real domain?

If this does turn out to be the correct explanation, may I applaud you for not obscuring the domain name in your original question. That's a common enough practice on SF, but it's deeply annoying to those of us who'd like to help, as it blinds us to many channels of investigation.