7

From the Roundcube dashboard, it shows that the message is sent successfully.

However, when I check into /var/log/mail.log, it shows like this: https://pasteid.fledix.com/5mat

It's not even receiving messages from other emails.

  • I went to Hostname and DNS Client in Network Configuration and changed the DNS servers to 127.0.0.1, 8.8.8.8, and 8.8.4.4. (It had only one: that is my dedicated IP)

  • I restarted saslauthd and postfix several times.

  • I changed the TLS to default for the Dovecot server.

  • I am a total layman.

One thing that struck me is that when I log into the Webmin panel, the system hostname shows as my chosen hostname (xxx.xxx.xxx.xx), where xxx.xxx.xxx.xxx is my dedicated IP. In other Webmin installations, I have seen it shows as the hostname (127.0.1.1).

Can anyone please help me out?

6
  • Probably your server where postfix is running does not have outbound connectivity for port 25. You can test it by logging in to your server and using the command telnet gmail-smtp-in.l.google.com 25. Outbound SMTP (port 25) is disabled in most cloud providers including AWS, GCP (Google), etc.
    – FedKad
    Oct 22, 2020 at 12:12
  • When I am connecting to the SMTP server, I am using port 587.
    – schttrj
    Oct 22, 2020 at 13:03
  • For sending mails out (from your server towards other mail servers) always the port 25 is used. However, this port (only outbound connection to TCP 25) is generally disabled by cloud provider, for fighting spam. Please, specify on which cloud provider your (postfix) server runs.
    – FedKad
    Oct 22, 2020 at 13:10
  • The SMTP connection is working fine but the messages are ending up in the queue, both outgoing and incoming. pasteid.fledix.com/c8ko
    – schttrj
    Oct 22, 2020 at 13:14
  • 1
    Okay @FedonKadifeli you were right. Port 25 was blocked by the hosting provider. He unblocked it and it's working now.
    – schttrj
    Oct 23, 2020 at 2:00

1 Answer 1

9

Before even thinking of installing and configuring Postfix or any email server on your system, it is a good idea to test that your system (being a VPS on a cloud provider or a machine at home) has outbound TCP port 25 (SMTP) connectivity.

An email server needs to connect to TCP port 25 of other email servers to send outbound emails. Similarly other email servers need to connect to TCP port 25 of your server to deliver emails destined to your server.

An easy test is to connect to your Linux system using SSH or any other method that will allow you to access command line interface. You can then test outbound connectivity to a known email provider like this:

$ host -t mx gmail.com  ## Find out host names of their email servers...
gmail.com mail is handled by 10 alt1.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 5 gmail-smtp-in.l.google.com.
gmail.com mail is handled by 30 alt3.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 20 alt2.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 40 alt4.gmail-smtp-in.l.google.com.

Select one server from the list and run:

$ telnet gmail-smtp-in.l.google.com 25
Trying 64.233.166.26...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP f7si810252wro.562 - gsmtp
quit
221 2.0.0 closing connection f7si810252wro.562 - gsmtp
Connection closed by foreign host.

If your system has outbound TCP port 25 connectivity you will get the above output. (Note: You can enter the quit command as shown above to terminate the telnet connection.)

If your cloud provider, your ISP, or any type of firewall in between is preventing the outbound TCP port 25 connectivity, you will get an output like the one given below (after waiting a certain amount of time for telnet to time out):

$ telnet gmail-smtp-in.l.google.com 25
Trying 173.194.216.26...
Trying 2607:f8b0:400c:c06::1b...
telnet: Unable to connect to remote host: Network is unreachable

Most Cloud and Internet Service Providers (ISPs) now block all outgoing TCP port 25 traffic from their customers in a futile attempt to fight spam. So, you need to check with your provider if this is the case and whether your provider is going to lift this block or not. Some providers (like Google Cloud Platform or Amazon Web Services) will not do it. So, you will have no chance to run Postfix on such platforms.

You must log in to answer this question.

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