![]() These headers can be very helpful to compare why one email was detected as spam while another email was not. To be prepered for the next step, spamassasin, amavisd-new can be configured to always add “X-Spam-…” headers. ![]() # this entry when running chrooted one may prefer a socket under $MYHOME. # NOTE: match socket name (LocalSocket) in nf to the socket name in # uid such as clamav, add user clamav to the amavis group, and then add # NOTE: run clamd under the same user as amavisd - or run it under its own $allowed_added_header_fields\n", "/var/run/clamav/clamd.sock"], # disable the "Received" headers to be added to the mail header If you don’t want to show this information on outgoing emails, the following configuration added to the /etc/nf configuration file will avoid these headers being added. When the email is passed on to amavisd-new, an additional “Received” header is added to the email. $mydomain = '' # a convenient default for other = qw( 127.0.0.0/8 ) To do this, edit the /etc/nf configuration file with you favourite editor. In the amavisd-new configuration the following settings need to be changed. For more options, please check the manual page available on your server via “ perldoc postgrey“. max-age defines how long Postgrey will remember a successful delivery and allow subsequent messages straight through. These options will instruct Postgrey to delay the delivery of the email by 60 seconds. OPTIONS="-max-age=365 -delay=60 -unix=/var/spool/postfix/postgrey/socket" This line will contain all configuration options for the Postgrey daemon. In this configuration file add the following line. To configure Postgrey on a CentOS server, create the file /etc/sysconfig/postgrey and open it with your favourite editor. For more details, see the Postgrey website. When the sender retries to deliver the mail, Postgrey accepts it. To identify the sender the triplet CLIENT_IP / SENDER / RECIPIENT is used. Postgrey will reject emails with a temporary error code when received for the first time. It counts on the non-RFC conformant behaviour of spam mail servers. This is also the default location as it is configured in CentOS. ![]() The unix socket shown above for the Postgrey policy server will be configured in the next step. smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks, check_policy_service unix:/var/spool/postfix/postgrey/socket,reject_unauth_destination To instruct postfix to ask the Postgrey policy server, the highlighted item needs to be added to the “smtpd_recipient_restrictions” configuration of the /etc/postfix/main.cf config file. Such a policy server is used by Postfix to delegate the decision to accept or deny emails to an external process. Postgrey acts as a so-called Policy Server. virusalert: rootĪlso Postgrey needs to be integrated into the postfix configuration. You might find that this line has already been added when installing the amavisd-new package via yum. Therefore edit the /etc/aliases file and add the following line. # smtpd deamon for amavisd-new to send mails back to postfixĪs amavisd-new will send alert messages, the alias should be configured to send those messages to root or some other recipient. As well as as some for the amavisd-new daemon itself. To allow amavisd-new to send them back to postfix, we need to add additional configuration. The above configuration will send the emails to amavisd-new. Add a line with “-o content_filter=smtp-amavis::10024” directly underneath it. In the /etc/postfix/master.cf configuration file you will find a line for the smtpd. This is done by adding a line of parameters to the smtpd. Configuring PostfixĪmavisd-new needs to be integrated into postfix to receive the unfiltered emails from the postfix queue. If you have both repositories installed, make sure you have configured yum repository priorities with yum-plugin-priorities to avoid errors during installation and later system updates via “yum update”. Here you can find details about the error message and a temporary solution. yum install spamassassin amavisd-new clamav clamd pyzor perl-Mail-SPF perl-Mail-DKIM postgrey tmpwatch lzopĪt the time of writing, I have noticed problems while installing amavisd-new while having the “epel” repository installed, but the package is available from the rpmforge repository as well. They include Postgrey policy server implementing greylisting, amavisd-new as a wrapper between postfix and other components like Spamassasin as the spam filter, ClamAV as the virus scanner, and SPF and DKIM libraries. The following commands will install the required components for this setup. After the emails are checked, they are sent back to postfix for delivery. There, the emails get checked for viruses and spam. In the setup described in this post, postfix passes incoming mail on to amavisd-new.
0 Comments
Leave a Reply. |