mail_log plugin and uid=error in log file

Alessio Cecchi alessio at skye.it
Tue Dec 1 09:36:30 UTC 2015


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 at domain.com): Info: copy from <lmtp DATA>: 
box=INBOX, uid=error, msgid=<14489594 at domain.com>, from="WordPress" 
<wordpress at domain.com>, subject=Enquiry from Joy

Dec 01 10:03:09 lmtp(alessio at domain.com): Info: copy from <lmtp DATA>: 
box=INBOX, uid=92, msgid=<03c4e16d at www.domain.com>, from="WordPress" 
<wordpress at 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 = </etc/dovecot/ssl/wildcard.pem
ssl_key = </etc/dovecot/ssl/wildcard.key
ssl_protocols = !SSLv2 !SSLv3
userdb {
   driver = prefetch
}
userdb {
   args = /etc/dovecot/dovecot-sql.conf.ext
   driver = sql
}
verbose_proctitle = yes
protocol lmtp {
   mail_plugins = quota zlib fts fts_lucene acl mail_log notify sieve
}
protocol imap {
   mail_plugins = quota zlib fts fts_lucene acl mail_log notify 
imap_quota imap_zlib imap_acl
}

-- 
Alessio Cecchi
Postmaster @ http://www.qboxmail.it
https://www.linkedin.com/in/alessice


More information about the dovecot mailing list