I setup my mail server based on postfix on cento7 server. when I use online checking tools everything works fine with no errors.Local mail send test runs ok too, but I still can not receive/send mail unless I edit add 0.0.0.0/0 to mynetwork line lie this: mynetworks = , 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 X.X.X.X/29 0.0.0.0/0 X.X.X.X/29 this is the subnet of my server I know I should not do that but I can not find my way out. please help! here is my main.cf:
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (CentOS) biff = no
append_dot_mydomain = no
#delay_warning_time = 4h
readme_directory = no
smtpd_tls_cert_file=/etc/letsencrypt/live/myserver.com/fullchain.pem smtpd_tls_key_file=/etc/letsencrypt/live/myserver.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
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 = myserver.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases mydomain = myserver.com myorigin = $mydomain mydestination = $mydomain, localhost, mail, mail.$mydomain relayhost = mynetworks = , 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 X.X.X.X/29 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = all
virtual_transport = lmtp:unix:private/dovecot-lmtp
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
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.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Heya,
Checking the logs, you can see the following errors after some messages:
port 25 is closed for external use. There are a few ways to go about the problem
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!