On Feb 6, 2008, at 4:49 AM, Or Goshen wrote:
Is it possible to use libspamc.so to tell spamd that a message is either spam or ham ?
ie, imitate  "sa-learn --spam/--ham" using libspamc.so.

There dont seem to be any documentation about the library, all I could find are comments in the header file which weren't really helpful.


Yes, look at message_tell:

/* Process the message through the spamd tell command, making as many
* connection attempts as are implied by the transport structure. To make * this do failover, more than one host is defined, but if there is only
 * one there, no failover is done.
 */
int message_tell(struct transport *tp, const char *username, int flags,
                 struct message *m, int msg_class,
                 unsigned int tellflags, unsigned int *didtellflags);


You can look for some example usage in the actual spamc command:

       −L learn type, −−learntype=type
Send message to spamd for learning. The "learn type" can be either spam, ham or forget. The exitcode for spamc will be set to 5 if
           the message was learned, or 6 if it was already learned.

Note that the "spamd" must run with the "−−allow −tell" option for
           this to work.

       −C report type, −−reporttype=type
Report or revoke a message to one of the configured collaborative filtering databases. The "report type" can be either report or
           revoke.

Note that the "spamd" must run with the "−−allow −tell" option for
           this to work.


Michael

Reply via email to