NAME
karmad - Karmasphere daemon for postfix and exim
DESCRIPTION
This is a small daemon which listens on a Unix domain socket and interfaces between Postfix or Exim and Mail::Karmasphere::Client.
See the sample configuration and startup files in the eg/ directory of the source distribution for more information.
COMMAND LINE PARAMETERS
- --username
- --password
-
Query credentials for authenticated queries. You probably need to set this.
These parameters are mandatory unless you are relying on IP authentication. For more information, see http://www.karmasphere.com/devzone/client/configuration#credentials
If you have registered for a Karmasphere account, you should use the permanent credentials that have been assigned. See http://www.karmasphere.com/app/account/auth#query_credentials
If you have not registered for a Karmasphere account, you can use temporary credentials, but those credentials will expire after a few weeks. See the URL above and choose the username and password for either "exim" or "postfix".
- --socket
-
Where to listen. Defaults to /tmp/karmad. You probably don't need to set this.
- --server
-
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.
- --feedset
-
The name of the feedset you want to query. Defaults to karmasphere.email-sender. You probably don't need to set this.
- --socketuser
- --socketgroup
-
Who to listen as; defaults to 'nobody'. The socket file will be chowned to this user and group. You probably don't need to set this.
- --socketmode
-
Mode to chmod the socket. You probably don't need to set this.
- --user =item --group
-
When running, setuid to this user and group. Defaults to 'nobody', 'nobody'. You probably don't need to set this.
OPERATIONAL USAGE
Connect to the socket (default: /tmp/karmad) and send the following newline-terminated stanza:
ip=192.0.2.1
helo=host.example.com
sender=localpart@example.com
Each of the above lines is optional; you may omit whatever is unavailable.
If all goes well, Karmad will return the following stanza:
value=NN
opinion=(good|bad|neutral)
data=.....
"Value" is a number between -1000 and +1000.
"Opinion" is one of good, bad, or neutral. If the value is greater than 300, opinion is good. If the value is less than -300, the opinion is bad. If it's between, opinion is neutral.
"Data" contains a brief explanation of how the verdict was reached.
If an error occurs, Karmad will return:
error=...
usually, something like
error=timeout
error=Incorrect user and/or password.
HOW TO TEST THAT IT'S WORKING
First, run karmad:
% ./karmad --username=foo --password=bar
Then, connect to it:
% perl -MIO::Socket::UNIX -le 'my $sock = IO::Socket::UNIX->new("/tmp/karmad"); print $sock "ip=127.0.0.2\n"; print <$sock>;'
value=-1000
opinion=bad
data=some.feedname: if-bad(0) => return-bad(1.0)
You should expect to see some STDERR from the karmad.
If troubleshooting is necessary, try running karmaclient: that does in one step what karmad-plus-the-socket-call do in two.
BUGS
In the response, "opinion" might be more correctly termed "verdict".
SEE ALSO
Mail::Karmasphere::Client Mail::Karmasphere::Query Mail::Karmasphere::Response karmaclient http://www.karmasphere.com/
COPYRIGHT
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.