Configure Amavisd-new to skip anti-spam check in the local region

Source: Internet
Author: User

Next, let's take a look at the article about how to configure Amavisd-new to skip the anti-spam check in this region. I hope this article will help you.

Amavisd-new is a very powerful anti-spam software, but many times we need to skip anti-spam checks for emails in our own region, this article discusses how to skip amavisd-new Anti-Spam checks in the local region.

Overview: This article explains how to skip anti-spam check in the current region using four methods. The first three methods have shortcomings. The fourth method is a better implementation method.

Skip anti-spam in the current region

The first two methods are from: http://scanty.blog.51cto.com/242145/406515. both of them contain disadvantages.

Method 1:

Skip detection through submission.
The only drawback of this method is that users using proxy software such as OE Or Foxmail must modify the default smtp port number (25 by default ).
Edit postfix/master. cf
Enable the submission process, add the authentication method and filtering policy, save and exit
Submission inet n--smtpd
-O smtpd_etrn_restrictions = reject
-O smtpd_sasl_auth_enable = yes
-O smtpd_client_restrictions = permit_sasl_authenticated, reject
-O content_filter = smtp-amavis: [127.0.0.1]: 10026
Here, the filter policy uses smtp-amavis: [127.0.0.1]: 10026.
Modify amavisd. conf
Open the listening port of amavisd. amavisd will listen to ports 10024,10025 and 10026.
$ Inet_socket_port = [10024,100 26];
Most people only turn on 10024, for example, $ inet_socket_port = 10024.
Add a policy for port 10026. If your configuration already has a policy for port 10026, comment it out.
$ Interface_policy {'000000'} = 'checkbypass ';

$ Policy_bank {'checkbypass'} = {# mail from submission and smtps ports
Bypass_spam_checks_maps => [1], # don't spam-check this mail
Bypass_banned_checks_maps => [1], # don't banned-check this mail
Bypass_header_checks_maps => [1], # don't header-check this mail
};
Save and exit www. bKjia. c0m
Restart postfix and amavisd
Netstat-tnlp check port status
Tcp 0 0 0.0.0.0: 587 0.0.0.0: * LISTEN 18525/master
587 is the listener port of submission.
Now set outlook or foxmail
Modify the smtp port number in the sending settings to 587. Do not forget to release 587 in the firewall.
Use this domain user to try out an email.
Amavis [30236]: (30236-16) Passed CLEAN, CHECKBYPASS [222.45.26.133] [222.45.26.133]->, Message-ID:

, Mail_id: ALw5YMALJbGF, Hits:-, size: 1605, queued_as: 1FFA8474002, 182 MS
If the "Hits:-" section appears, the setting is successful.

Method 2:

Modify @ mynetworks.
Edit amavisd. conf
Default Value:
@ Mynetworks = qw (127.0.0.0/8 [: 1] [FE80:]/10 [FEC0:]/10
10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 );
Add the IP segment you want to skip Filtering
For example:
@ Mynetworks = qw (127.0.0.0/8 [: 1] [FE80:]/10 [FEC0:]/10
10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 222.45.26.0/24 );
Modify the MYNETS policy as follows:

$ Policy_bank {'mynetts' }={# mail originating from @ mynetworks
Originating => 1, # is true in MYNETS by default, but let's make it explicit
OS _fingerprint_method => undef, # don't query p0f for internal clients
Bypass_spam_checks_maps => [1], # don't spam-check internal mail
Bypass_banned_checks_maps => [1], # don't banned-check internal mail
Bypass_header_checks_maps => [1], # don't header-check internal mail
};
Save and restart amaivsd
Check. bKjia. c0m will be skipped for emails from 222.45.26.0/24.
The following record is also displayed:
Amavis [15750]: (15750-11) Passed CLEAN, mynets local [222.45.26.132] [222.45.26.132]->, Message-ID:

, Mail_id: VbR2kBqI-F1W, Hits:-, size: 11378, queued_as: E741F1D94001, 450 MS
This method is not a panacea. He can only skip emails from @ mynetworks addresses.
The second method only supports sending via local region. Sending via direct mail client may cause problems, unless the IP address used by the client is in mynetworks,

Method 3:

Add the following two lines to amavisd. conf:
@ Bypass_spam_checks_maps = (% bypass_spam_checks, @ bypass_spam_checks_acl, $ bypass_spam_checks_re );
@ Bypass_spam_checks_maps = qw (localdomain1 localdomain2 );

This method does not perform anti-spam checks on the sent and received emails.

Method 4:

Set whitelist
$ Sa_auto_whitelist = 1; # turn on AWL (default: false)

Set the location of the whitelist below. Note that the specified files must exist; otherwise, Amavis will not be able to start and pay attention to the permissions of these files. Amavis must be able to access these files.
# Specifying a whitelist
Read_hash (% whitelist_sender, '/var/lib/amavis/whitelist ');
# Specifying a blacklist
Read_hash (% blacklist_sender, '/var/lib/amavis/blacklist ');
# If the recipient is in this list, no spam detection is performed.
Read_hash (% spam_lovers, '/var/lib/amavis/spam_lovers ');
Will not check the sent mail, but check the received mail

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.