mail_log plugin and uid=error in log file
Hi,
I enabled notify and mail_log plugins to log the message uid for new emails delivered via LMTP. All works fine except that the uid is not always logged (see uid=error instead of uid=NUMBER)
from dovecot.log:
Dec 01 10:03:08 lmtp(alessio@domain.com): Info: copy from <lmtp DATA>: box=INBOX, uid=error, msgid=14489594@domain.com, from="WordPress" wordpress@domain.com, subject=Enquiry from Joy
Dec 01 10:03:09 lmtp(alessio@domain.com): Info: copy from <lmtp DATA>: box=INBOX, uid=92, msgid=03c4e16d@www.domain.com, from="WordPress" wordpress@domain.com, subject=Enquiry from Joy
When the uid number is missing the message have is uid in dovecot-uidlist file but is represented in different format:
92 G1448960589.M630964P41853.qb-dev :1448960589.M630964P41853.qb-dev,S=35341,W=35856 93 :1448960586.M423202P41802.qb-dev,S=35378,W=35890
It seems that the uid is determined after the log is written ...
I'm running Dovecot 2.2.19, Maildir as storage format and LMTP for delivery.
Is a bug or a "feature"? Can be fixed?
Thanks
this is my configuration:
# dovecot -n # 2.2.19: /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.9 # OS: Linux 2.6.32-573.7.1.el6.x86_64 x86_64 CentOS release 6.7 (Final) auth_master_user_separator = * dict { expire = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext sqlquota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext } first_valid_gid = 89 first_valid_uid = 89 last_valid_gid = 89 last_valid_uid = 89 lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes log_path = /var/log/dovecot/dovecot.log mail_fsync = always mail_location = maildir:~/Maildir mail_plugins = quota zlib fts fts_lucene acl mail_log notify managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate namespace inbox { inbox = yes location = mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix = separator = / } passdb { args = /etc/dovecot/dovecot-deny-sql.conf.ext deny = yes driver = sql } passdb { args = /etc/dovecot/extra/master-users driver = passwd-file master = yes pass = yes } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } plugin { acl = vfile:/etc/dovecot/global-acls:cache_secs=300 fts = lucene fts_lucene = whitespace_chars=@. mail_log_events = copy save mail_log_fields = uid box msgid from subject quota = dict:User quota::noenforcing:proxy::sqlquota sieve_default = /etc/dovecot/sieve/default.sieve zlib_save = gz zlib_save_level = 6 } protocols = imap sieve lmtp service auth { unix_listener auth-userdb { group = vchkpw mode = 0660 user = vmail } } service dict { unix_listener dict { group = vchkpw mode = 0660 user = vmail } } service imap-postlogin { executable = script-login /etc/dovecot/scripts/imap-postlogin.sh unix_listener imap-postlogin { group = vchkpw mode = 0660 user = vmail } user = vmail } service imap { executable = imap imap-postlogin } service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix mode = 0660 user = postfix } } ssl_cert =
-- Alessio Cecchi Postmaster @ http://www.qboxmail.it https://www.linkedin.com/in/alessice
On 01 Dec 2015, at 11:36, Alessio Cecchi alessio@skye.it wrote:
Hi,
I enabled notify and mail_log plugins to log the message uid for new emails delivered via LMTP. All works fine except that the uid is not always logged (see uid=error instead of uid=NUMBER)
from dovecot.log:
Dec 01 10:03:08 lmtp(alessio@domain.com): Info: copy from <lmtp DATA>: box=INBOX, uid=error, msgid=14489594@domain.com, from="WordPress" wordpress@domain.com, subject=Enquiry from Joy
Dec 01 10:03:09 lmtp(alessio@domain.com): Info: copy from <lmtp DATA>: box=INBOX, uid=92, msgid=03c4e16d@www.domain.com, from="WordPress" wordpress@domain.com, subject=Enquiry from Joy
Does this help? http://hg.dovecot.org/dovecot-2.2/rev/25d63d9c7f5a
On 01/12/2015 16:31, Timo Sirainen wrote:
Does this help? http://hg.dovecot.org/dovecot-2.2/rev/25d63d9c7f5a
Hi Timo,
Sorry about the thread hijacking but, speaking about the mail_log plugin, what do you think about the ability to add the session number to the log lines produced by this plugin?
This could be a useful information to have too, especially on a large traffic mailhost.
Regards, Gilles
On 2015-12-01 17:08:01 +0100, Gilles Chauvin wrote:
Sorry about the thread hijacking but, speaking about the mail_log plugin, what do you think about the ability to add the session number to the log lines produced by this plugin?
This could be a useful information to have too, especially on a large traffic mailhost.
mail_log_prefix = "%s(%u): %{session} "
only downside is some lines will then end up with the session ID twice. When i asked Timo said he doesnt want to change that behavior in 2.2. but in 2.3 it might be an option to unify that.
hth
darix
-- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org
On 01/12/2015 17:14, Marcus Rueckert wrote:
mail_log_prefix = "%s(%u): %{session} "
only downside is some lines will then end up with the session ID twice. When i asked Timo said he doesnt want to change that behavior in 2.2. but in 2.3 it might be an option to unify that.
Hi Marcus,
I will try this soon.
Thanks for the tip.
Regards, Gilles
Il 01/12/2015 16:31, Timo Sirainen ha scritto:
On 01 Dec 2015, at 11:36, Alessio Cecchi alessio@skye.it wrote:
Hi,
I enabled notify and mail_log plugins to log the message uid for new emails delivered via LMTP. All works fine except that the uid is not always logged (see uid=error instead of uid=NUMBER)
from dovecot.log:
Dec 01 10:03:08 lmtp(alessio@domain.com): Info: copy from <lmtp DATA>: box=INBOX, uid=error, msgid=14489594@domain.com, from="WordPress" wordpress@domain.com, subject=Enquiry from Joy
Dec 01 10:03:09 lmtp(alessio@domain.com): Info: copy from <lmtp DATA>: box=INBOX, uid=92, msgid=03c4e16d@www.domain.com, from="WordPress" wordpress@domain.com, subject=Enquiry from Joy
Does this help? http://hg.dovecot.org/dovecot-2.2/rev/25d63d9c7f5a
I applied the patch and seems works fine.
Thanks!
Alessio Cecchi Postmaster @ http://www.qboxmail.it https://www.linkedin.com/in/alessice
participants (4)
-
Alessio Cecchi
-
Gilles Chauvin
-
Marcus Rueckert
-
Timo Sirainen