karmad - Karmasphere policy daemon for Postfix
This is a small postfix policy server. It is spawned by spawn(8). It offers an interface between Postfix and Mail::Karmasphere::Client.
Add the following to /etc/postfix/master.cf:
karma unix - n n - 0 spawn user=nobody argv=/usr/local/bin/karmad-postfix --action=prepend --verbose-header --syslog
Add the following to /etc/postfix/main.cf:
karma_time_limit = 3600
Append the following to smtpd_recipient_restrictions, somewhere AFTER reject_unauth_destination:
check_policy_service unix:private/karma
Watch your mail.debug syslog go by; you should see queries and responses.
Recommended.
Scores below cutoff-fail will turn into a "fail/reject". Scores above cutoff-pass will turn into a "pass". You should set these thresholds yourself: Karmasphere provides the score, but you decide policy. If you do not, they will default to +300 and -300.
cutoff-fail
cutoff-pass
Optional.
If you're running postfix, you can set --action to one of prepend (default) or reject. Prepend will prepend an X-Karma header. Reject will cause any mail with a karma score below cutoff-fail to be rejected. Use this only if you are happy with the results you've observed.
prepend
reject
If not specified, defaults to prepend.
If you've set action to prepend, this flag will add two fields to the X-Karma header: identities shows what was queried, and query_id includes the timestamp and (if available) the MTA's queue ID.) This is useful for debugging purposes: it allows one to replay the query.
action
identities
query_id
Query credentials for authenticated queries. You only need to set this if you're querying a restricted feedset. For more information, see http://www.karmasphere.com/devzone/client/configuration#credentials
Hostname of the Karmasphere Query Server to connect to. Defaults to query.karmasphere.com. You probably don't need to set this, unless you have set up a local query server, in which case you should be following the directions provided with that server.
The name of the feedset you want to query. Defaults to karmasphere.email-sender. You probably don't need to set this.
Syslog verbosely to mail.info and mail.debug.
Mail::Karmasphere::Client Mail::Karmasphere::Query Mail::Karmasphere::Response karmaclient http://www.karmasphere.com/ http://www.postfix.org/SMTPD_POLICY_README.html
Copyright (c) 2005 Shevek, Karmasphere. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mail::Karmasphere::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Karmasphere::Client
CPAN shell
perl -MCPAN -e shell install Mail::Karmasphere::Client
For more information on module installation, please visit the detailed CPAN module installation guide.