Basic Postfix configuration not working?

0

So all I am trying to do is send a test email from my web server. I do own the domain name and viewing my website itself works perfectly fine.

I have installed postfix brand new out of the box and modified the following in my /etc/postfix/main.cf per tutorials online:

enter image description here

After this I try the following command to send an email to myself at gmail:

echo "Body of email" | mail -s "This is the test Subject" x@gmail.com

but nothing gets sent. I do see that they go in the queue:

enter image description here

I do see in the logs that my connection times out when trying to send.

So a bit of detail that may affect the sending:

  • Port 25 is blocked by my ISP. Would this prevent sending email? I thought that would only block incoming email
  • Do I have to do anything different to my main.cf or am I looking in the wrong place?
  • I have confirmed that the service postfix is running

Eric F

Posted 2018-11-21T15:42:46.967

Reputation: 3 070

Answers

1

Port 25 is blocked by my ISP. Would this prevent sending email?

Yes.

I thought that would only block incoming email

Entirely depends on how the block was configured. The ISP can choose either to block in one direction (by checking srcip + dstport, or dstip + dstport, or other combination) – or block in both directions by checking just the dstport.

Do I have to do anything different to my main.cf

It depends on whether the problem is solvable via main.cf, so determine the problem before searching for a solution – see next reply.

Postfix cannot bypass ISP-level port blocking and still remain able to directly deliver messages. If outgoing connections to port 25 are indeed blocked, there's nothing you can do except relay/tunnel through another server which doesn't have such blocks.

I have confirmed that the service postfix is running

Also confirm what the service is actually doing. Postfix writes information about mail delivery to syslog (e.g. /var/log/mail.log). If it says it has encountered a timeout, that's probably ISP-level blocking. If it says it successfully reached the server but got told off, that's another topic.

user1686

Posted 2018-11-21T15:42:46.967

Reputation: 283 655

Thank you for the quick and detailed response. My next venture will be to use Dynu as my relay. – Eric F – 2018-11-21T16:53:10.193