Score:0

Postfix can send, but not receive external email with configuration in CentOS 8

us flag

I have two problems, and I believe they are somewhat related. First, I can receive email from domains in my local server in Roundcube and Horde, but not in Thunderbird or Mac Mail. Secondly, I can't receive external email anywhere, and this is the main problem that concerns me. When I send a message, I get a flash on the screen saying the message is being sent, and I get NO error message. But, the email is not received by the recipient. This is the code I added at the end of the original /etc/postfix/main.cf:

myhostname = mail.charlotsa.com
mydomain = charlotsa.com
myorigin = $mydomain
home_mailbox = mail/
mynetworks = 24.197.10.0/24, 127.0.0.0/8
inet_interfaces = $myhostname, localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reje$
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_key_file = /etc/letsencrypt/live/mail.charlotsa.com/privkey.pem
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.charlotsa.com/fullchain.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

I made only two other changes to the original "/etc/postfix/main.cf" file. First, I commented out the ssl paths, because I already had a certificate for my email server, which I added at the bottom of the file. Second, I added this code to the alias section of the file:

virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = hash:/etc/postfix/virtual_domains

But I haven't tried another domain yet because I want to get this resolved first. When I test port 25 with the command, "netstat -plnt |grep :25", this is the result:

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 24.197.10.18:25         0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -                   
tcp6       0      0 ::1:25                  :::*                    LISTEN      -

Here's my configuration in Thunderbird: Thunderbird email configuration

Finally, I have set up my DNS name server in "/var/named" and it is pointing to my ip. I believe the issues with Thunderbird and Mac Mail will no longer be a problem, once I am able to receive external emails. If someone can help me, I will be very grateful. Thank you so much in advance.

Score:0
us flag

I figured it out. All I did was comment out the line

mynetworks = 24.197.10.0/24, 127.0.0.0/8

and change inet_interfaces to all.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.