Hello, All.
I'd like to know if the way DBMail does logging is a bug or a feature.
I'm using FreeBSD. And in its syslog.conf there is a rule which
writes everything *.notice to /var/log/messages.
I'd like to have a log of all mail activity in maillog (just in case
it becomes necessary), but not to spam /var/log/messages that much.
So each time before building I change debug.c this way:
instead of
if (level <= TRACE_WARNING) {
I use
if ( (level <= TRACE_WARNING) && (level != TRACE_MESSAGE) ) {
and I also use
vsyslog(LOG_INFO, formatstring, argp);
instead of
vsyslog(LOG_NOTICE, formatstring, argp);
this way the logging is pretty good.
May be this could be useful for anybody.
BTW, I know I could try to change trace_t (change places of
TRACE_MESSAGE and TRACE_ERROR), but I didn't test such solution :)
Second, is getting the mail with POP3.
Some days ago I upgraded DBMail on our mail-server.
The point is that there are users who use POP3, and they feel
comfortable and don't get a lot of spam, and there are also users
(like me =) ) who prefer IMAP and the mailbox named Spam.
The possible spam gets into the Spam mailbox. But users of POP3
wouldn't ever get it (suggest false-positive), as POP3 only works with
INBOX.
So, to be sure that all POP3-users get all the mail :) I changed the
db.c a bit, and now the db_createsession looks this way
...
u64_t inbox_mailbox_idnr;
u64_t spam_mailbox_idnr;
...
if (db_findmailbox("INBOX", user_idnr, &inbox_mailbox_idnr) <= 0) {
trace(TRACE_ERROR, "%s,%s: error finding mailbox_idnr of "
"INBOX for user [%llu], exiting..",
__FILE__, __func__, user_idnr);
return -1;
}
if (db_findmailbox("Spam", user_idnr, &spam_mailbox_idnr) <= 0) {
spam_mailbox_idnr = inbox_mailbox_idnr;
}
...
"WHERE ( msg.mailbox_idnr = '%llu' OR msg.mailbox_idnr = '%llu' )"
"AND msg.status < '%d' "
"AND msg.physmessage_id = pm.id "
"order by status ASC",
inbox_mailbox_idnr, spam_mailbox_idnr, MESSAGE_STATUS_DELETE);
...
Well, this simple solution is rather clumsy, but it is just a
work-around for me, that I made today.
May be somebody having some similar situation will like this idea.
May be even the developers pay their attention to it =)) and decide to
make some kind of an option 'also_use_mailboxes' in [POP] section ;-)
--
With best regards, Danil.