Postfix email not sending outbound mails. All mails are in que

Operating system:
OS version:
The operating system Ubuntu 18.04.5 LTS installed virtualmin . everything is fine . Hosted 2 sites by adding virtual server. The postfix was installed along with virtualmin . I can send mail internally (between the 2 hosted sites) and can receive mail from outside. All mail send to outside domains are in que. I have googled many articles realted to postfix and tried many buit still the issue was not sorted.
the status of mail in webmin is as below
|3FED07E1C8 |2020/11/16 10:42:28 AM | | |977 bytes |connect to[]:25: Connection timed out|

Can anyone can support or help

IP address:
Domains hosted are as below

    Kindly let me know what i have to do in config

What you must do on your server:

add to
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps

create file /etc/postfix/relayhost_maps and put into it:       []:587      []:587

Then on the CLI:

postmap /etc/postfix/relayhost_maps
chown root:root /etc/postfix/relayhost_maps.db
chmod 400 /etc/postfix/relayhost_maps.db
service postfix reload

Set in DNS records for each domain (,…)

v=spf1 a mx ip4: ip6:2600:3c03::f03c:91ff:fe25:1d3b -all


"v=DKIM1; k=rsa; t=s; 

And that is all. You will be able to create unlimited number of mailboxes under each domain and receive unlimited email but can send only 100 email per day.


Thanks Mr calport,
The setting you have provided was done and the email service for both inbound and outbound works perfect. As its sending via ur smtp. Is my smtp configuration wrong or the AWS blocks 25 and 587 by default. I have allowed port 25 and 587 in security group in VPC and when testing using portforwarding tester online i can see 25 and 587 is open for and other. so is it bcz of reverse DNS or SMTP blocked by AWS or my SMTP config in postfix.
Kindly help

I got the same problems, the only difference is self-hosting. I did open/allow port 25, 587 then checked with the port scan (canyouseeme, pentest-tools) and I could see ISP not blocking these ports, so I don’t know what wrong. Any suggestions guys? Wish someone could Teamviewer and check my setting.

I fixed my problem. Can i know where you hosted your server. mine was with AWS. Although while testing port 25 and 587, it seemed open for my server. But actually the outgoing mails was blocked by AWS. I requested to waive the restriction via the form in this page Once it was approved the mail start working. pls verify the DNS records for SPF, DKIM are proper

I hosted my server on my PC. I found that my ISP (Suddenlink) blocked the outbound port, and as you said “while testing port 25 and 587, it seemed open for my server. But actually the outgoing mails was blocked”. So in case, they not approved to unblock the outbound for these ports, what should I do next?

If its from ISP. there will be a SMTP of ISP ( and port) to be used while configuring outlook and other clients. Pls get that and assign in SMTP or else u can use third party SMTPs like or Gmail

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.