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/

 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/

 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.




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.



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.

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.



Query credentials for authenticated queries. You only need to set this if you're querying a restricted feedset. For more information, see


Hostname of the Karmasphere Query Server to connect to. Defaults to 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 You probably don't need to set this.


Syslog verbosely to and mail.debug.



Mail::Karmasphere::Client Mail::Karmasphere::Query Mail::Karmasphere::Response karmaclient


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.