Report this

What is the reason for this report?

Can not send or receive email on my cento7 postfix Mailserver

Posted on July 3, 2020

Hi, we try to build a public postfix mail server on a centos7 machine. all test on the internet give no error. But I could not send or receive email only if i add 0.0.0.0/0 to mynetwork line: mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 160.242.193.8/29 0.0.0.0/0 I know i shouldn’t do that. here my /etc/postfix/main.cf:

See /usr/share/postfix/main.cf.dist for a commented, more complete version

Debian specific: Specifying a file name will cause the first

line of that file to be used as the name. The Debian default

is /etc/mailname.

#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (CentOS) biff = no

appending .domain is the MUA’s job.

append_dot_mydomain = no

Uncomment the next line to generate “delayed mail” warnings

#delay_warning_time = 4h

readme_directory = no

TLS parameters

smtpd_tls_cert_file=/etc/letsencrypt/live/mymailserver.com/fullchain.pem smtpd_tls_key_file=/etc/letsencrypt/live/mymailserver.com/privkey.pem smtpd_use_tls=yes smtpd_tls_auth_only = yes smtp_tls_security_level = may smtpd_tls_security_level = may smtpd_sasl_security_options = noanonymous, noplaintext smtpd_sasl_tls_security_options = noanonymous

See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for

information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sender_restrictions = reject_unknown_sender_domain myhostname = mymailserver.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases mydomain = mymailserver.com myorigin = $mydomain mydestination = $mydomain, localhost, mail, mail.$mydomain relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 160.242.193.8/29 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = all

Handing off local delivery to Dovecot’s LMTP, and telling it where to store mail

virtual_transport = lmtp:unix:private/dovecot-lmtp

Virtual domains, users, and aliases

virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf, mysql:/etc/postfix/mysql-virtual-email2email.cf

please will you help me to solve the issue. Best regards Rachid



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

Checking the logs, you can see the following errors after some messages:

:25: Connection timed out

port 25 is closed for external use. There are a few ways to go about the problem

  • try using ports like 465 or 587 for SMTP
  • use a third party solution only for your E-mails. Good examples are sendgrid.

To expand more on blocking port 25 for new accounts, this is something DigitalOcean has been doing to reduce spam on it’s network. It is more that we simply cannot accurately determine who is going to send it.

Stopping spam is a constant fight, so DigitalOcean has implemented some restrictions on newer accounts. Having said that, you can always contact them and ask for the port block to be lifted on:

https://www.digitalocean.com/support/

More information here:

https://docs.digitalocean.com/support/why-is-smtp-blocked/

Hope that helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.