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
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.

  • Thank you for the quick and detailed response. My next venture will be to use Dynu as my relay. – Eric F Nov 21 '18 at 16:53

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.