[dovecot-cvs] dovecot/src/plugins/mail-log mail-log-plugin.c, 1.1.2.4, 1.1.2.5
tss at dovecot.org
tss at dovecot.org
Sat Mar 10 14:54:20 EET 2007
Update of /var/lib/cvs/dovecot/src/plugins/mail-log
In directory talvi:/tmp/cvs-serv32225
Modified Files:
Tag: branch_1_0
mail-log-plugin.c
Log Message:
Log the mailbox name, unless it's INBOX.
Index: mail-log-plugin.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/mail-log/mail-log-plugin.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- mail-log-plugin.c 28 Feb 2007 21:00:37 -0000 1.1.2.4
+++ mail-log-plugin.c 10 Mar 2007 12:54:18 -0000 1.1.2.5
@@ -38,11 +38,22 @@
static void mail_log_action(struct mail *mail, const char *action)
{
- const char *msgid;
+ const char *msgid, *mailbox_str;
+
+ mailbox_str = mailbox_get_name(mail->box);
+ if (strcmp(mailbox_str, "INBOX") == 0) {
+ /* most operations are for INBOX, and POP3 has only INBOX,
+ so don't add it. */
+ mailbox_str = "";
+ } else {
+ mailbox_str = str_sanitize(mailbox_str, 80);
+ mailbox_str = t_strconcat(", box=", mailbox_str, NULL);
+ }
msgid = mail_get_first_header(mail, "Message-ID");
- i_info("%s: uid=%u, msgid=%s", action, mail->uid,
- msgid == NULL ? "(null)" : str_sanitize(msgid, MSGID_LOG_LEN));
+ i_info("%s: uid=%u, msgid=%s%s", action, mail->uid,
+ msgid == NULL ? "(null)" : str_sanitize(msgid, MSGID_LOG_LEN),
+ mailbox_str);
}
static int mail_log_mail_expunge(struct mail *_mail)
More information about the dovecot-cvs
mailing list