Log messages

Serguei Miridonov mirsev at cicese.mx
Tue Mar 3 16:36:47 CET 2009


Thanks for your reply.

On Tuesday 03 March 2009, David Relson wrote:
> On Sun, 1 Mar 2009 08:52:10 -0800
>
> Serguei Miridonov wrote:
> > Regarding logging facility of bogofilter when run by user, isn't
> > it more logical to add an option to place log messages in a user
> > log file instead of sending it to syslog?
>
> Bogofilter sets up for logging with:
>
>    openlog("bogofilter", LOG_PID, LOG_MAIL);
>
> and logs with:
>
>     syslog(LOG_INFO, "%s\n", msg_bogofilter);
>
> Syslog is highly configurable and is flexible in how/where it saves
> logging messages.  Try configuring it and let us know what happens.
> The info will make a good entry for the FAQ!

Syslog configuration is not accessable for regular user who may run 
bogofilter with procmail on his last mail relay. So, logging to user 
file may be the only option. Well, this part of code is easiest to 
write. The only problem is locking: to avoid writing to log file from 
two bogofilters running in parallel.

[...]

> > And finally, if the log may inclide MessageID header, why not
> > include "From: " header, as well as others specified by user?
>
> Non-trivial.  Two issues come to mind:
>
> Bogofilter breaks a message into tokens and doesn't care about
> "lines" as do you and I.  The parsing code (in src/lexer_v3.l)
> recognizes "To", "CC", "From",  etc and uses this info to set tags
> to create tokens like "From:example.com".  It doesn't have a "From
> line" to include in a log record.

Hmm... This is strange... I think headers and text of the message must 
be processed differently. Headers part is like an envelope with 
several distinct stamps out of spammers control and it should be 
parsed without breaking dates, addresses, etc. These stamps have 
standard syntax, so their contents should be easy to analyze.

> > Anyway, bogofilter is a great program, thanks!
>
> Glad you like bogofilter.  I'll give your ideas some thought, but
> no promises...  However if _you_ feel like contributing some code
> ...

I'll see... But no promises :-)

> > Please, send replies to my address because I'm not subscribed to
> > the list.
>
> Consider subscribing. 

I will.

Thank you and best regards,

Serguei.






More information about the bogofilter-dev mailing list