Postfix anti-spam settings

Source: Internet
Author: User

Next, I will use postfix to add anti-spam methods to prevent sender spoofing configurations. I hope this article will be helpful to you.

Added the following configurations to prevent sender spoofing:

The Code is as follows: Copy code

# Smtpd related config
Smtpd_recipient_restrictions =
Permit_mynetworks,
Permit_sasl_authenticated,
# Reject_non_fqdn_hostname,
Reject_non_fqdn_sender,
Reject_non_fqdn_recipient,
Reject_unauth_destination,
Reject_unauth_pipelining,
Reject_invalid_hostname

 

Smtpd_sender_restrictions =
Permit_mynetworks,
Check_recipient_access hash:/etc/postfix/local_recipient,
Permit_sasl_authenticated,
Reject_sender_login_mismatch,
Reject_authenticated_sender_login_mismatch,
Reject_unauthenticated_sender_login_mismatch,
Reject_unknown_sender_domain

# Smtp auth config here
Broken_sasl_auth_clients = yes
Smtpd_sasl_auth_enable = yes
Smtpd_sasl_security_options = noanonymous

 

Supplement:

Configuring extmail does not allow spoofing of non-existent local email addresses to send emails, and does not allow sending emails with counterfeit others' email addresses.

Cd/etc/postfix/

Cat> mysql_virtual_sender_maps.cf <EOF
User = extmail
Password = extmail
Hosts = localhost
Dbname = extmail
Table = mailbox
Select_field = username
Where_field = username
Additional_conditions = AND active = '1'
EOF

Vim main. cf
Smtpd_sender_login_maps =
Mysql:/etc/postfix/mysql_virtual_sender_maps.cf

Smtpd_sender_restrictions =
Permit_mynetworks,
Reject_sender_login_mismatch,
Reject_authenticated_sender_login_mismatch,
Reject_unauthenticated_sender_login_mismatch

Make the configuration take effect

Postfix reload

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.