Difference between revisions of "Postgrey"
Jump to navigation
Jump to search
Wiki-Sbarnes (talk | contribs) |
|||
(6 intermediate revisions by 3 users not shown) | |||
Line 9: | Line 9: | ||
* For more install instructions see the manual (man) pages for postgrey on the server. | * For more install instructions see the manual (man) pages for postgrey on the server. | ||
* Edit /etc/postfix/main.cf file adding: | * Edit /etc/postfix/main.cf file adding: | ||
− | + | ||
− | smtpd_recipient_restrictions = permit_mynetworks, | + | smtpd_recipient_restrictions = permit_mynetworks, |
permit_sasl_authenticated, | permit_sasl_authenticated, | ||
reject_invalid_hostname, | reject_invalid_hostname, | ||
Line 25: | Line 25: | ||
check_policy_service unix:postgrey/socket, | check_policy_service unix:postgrey/socket, | ||
permit | permit | ||
− | . | + | |
+ | Note: The reject_rbl_client lines are for real time blacklisting and have been | ||
+ | commented because this is most likely more aggressive spam filtering | ||
+ | than we require. I put them there as examples of additional filtering that | ||
+ | could be done. | ||
* start postgrey daemon/service | * start postgrey daemon/service | ||
Line 39: | Line 43: | ||
Edit /etc/postfix/main.cf and comment out lines 222 to 236 | Edit /etc/postfix/main.cf and comment out lines 222 to 236 | ||
− | + | ||
smtpd_recipient_restrictions = permit_mynetworks, | smtpd_recipient_restrictions = permit_mynetworks, | ||
permit_sasl_authenticated, | permit_sasl_authenticated, | ||
Line 55: | Line 59: | ||
check_policy_service unix:postgrey/socket, | check_policy_service unix:postgrey/socket, | ||
permit | permit | ||
− | + | ||
Restart postfix | Restart postfix | ||
− | $ sudo | + | $ sudo systemctl restart postfix |
== References == | == References == | ||
Line 66: | Line 70: | ||
[[Category: Infrastructure]] | [[Category: Infrastructure]] | ||
+ | [[Category:Services]] |
Latest revision as of 07:55, 7 March 2022
- "Postgrey is a Postfix policy server implementing greylisting" -- [web site]
- Responding to this SAC ticket
Dependencies
It uses the BerkeleyDB, and other, perl modules. Perl's -MCPAN install option was failing on building BerkeleyDB module, so RPMs were gathered from searches to pbone.net for RHEL4. Then they were installed like this:
sudo rpm -i perl-BerkeleyDB-0.33-1.el4.rf.i386.rpm perl-IO-Multiplex-1.09-3.el4.pp.noarch.rpm perl-Net-Server-0.97-2.el4.pp.noarch.rpm postgrey-1.31-1.el4.rf.noarch.rpm
Install & Config
- For more install instructions see the manual (man) pages for postgrey on the server.
- Edit /etc/postfix/main.cf file adding:
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_hostname, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_unauth_destination, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_unauth_destination, #reject_rbl_client list.dsbl.org, #reject_rbl_client sbl.spamhaus.org, #reject_rbl_client zen.spamhaus.org, #reject_rbl_client lists.spam.sux.com, check_policy_service unix:postgrey/socket, permit
Note: The reject_rbl_client lines are for real time blacklisting and have been commented because this is most likely more aggressive spam filtering than we require. I put them there as examples of additional filtering that could be done.
- start postgrey daemon/service
$ sudo /sbin/service postgrey start
- set postgrey to start on boot
$ sudo /sbin/chkconfig --level 2345 postgrey
- restart postfix daemon/service
$ sudo /sbin/service postfix restart
- you can watch the greylisting in : /var/log/maillog
$ sudo tail -f /var/log/maillog |grep Greylist
To revert back to original (pre greylisting) config
Edit /etc/postfix/main.cf and comment out lines 222 to 236
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_hostname, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_unauth_destination, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_unauth_destination, #reject_rbl_client list.dsbl.org, #reject_rbl_client sbl.spamhaus.org, #reject_rbl_client zen.spamhaus.org, #reject_rbl_client lists.spam.sux.com, check_policy_service unix:postgrey/socket, permit
Restart postfix
$ sudo systemctl restart postfix