[Dovecot] Enable mail logger plugin
Hello,
I'm trying to get more info about user activity (especially when they delete some email). So, I follow info from http://wiki2.dovecot.org/Plugins/MailLog to enabled mail logger plugin, but I don't see anything in my logs.
Can you tell me what I'm missing ?
Thanks.
# doveconf -n # 2.2.10.3: /etc/dovecot/dovecot.conf # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.4 ext4 auth_mechanisms = plain login base_dir = /var/run/dovecot/ hostname = mail.numeezy.com imap_capability = +XLIST lda_mailbox_autocreate = yes listen = 188.165.154.169 login_greeting = Ready. mail_gid = 5000 mail_location = maildir:/var/vmail/%d/%n/Maildir mail_plugins = quota mail_log notify mail_privileged_group = mail mail_uid = 5000 namespace inbox { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk { auto = subscribe special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { auto = subscribe special_use = \Trash } mailbox name { special_use = \Drafts \Junk \Sent \Trash } prefix = } passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } plugin { antispam_backend = mailtrain antispam_mail_notspam = --ham antispam_mail_sendmail = /usr/local/bin/sa-learn-pipe.sh antispam_mail_spam = --spam antispam_spam = Junk antispam_trash = Trash mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename mail_log_fields = uid box msgid size quota = dict:user::file:/var/vmail/%d/%n/.quotausage quota_grace = 10%% quota_rule = Trash:storage=+200M quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=80%% quota-warning 80 %u sieve = /var/vmail/%d/%n/.sieve sieve_before = /etc/dovecot/sieve_before sieve_vacation_send_from_recipient = yes } postmaster_address = postmaster@numeezy.com protocols = imap pop3 service auth-worker { user = vmail } service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0660 user = postfix } unix_listener auth-userdb { group = vmail mode = 0600 user = vmail } user = dovecot } service imap-login { inet_listener imap { port = 143 } inet_listener imaps { port = 993 ssl = yes } service_count = 1 } service pop3-login { inet_listener pop3 { port = 110 } inet_listener pop3s { port = 995 ssl = yes } service_count = 1 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { mode = 0666 user = vmail } user = vmail } ssl_cert =
Am 2014-02-19 22:24, schrieb Alexandre Ellert:
Hello,
I'm trying to get more info about user activity (especially when they delete some email). So, I follow info from http://wiki2.dovecot.org/Plugins/MailLog to enabled mail logger plugin, but I don't see anything in my logs.
Can you tell me what I'm missing ?
Thanks.
It is quite tough to read through such a long config. Skimming through though, and I am not an expert at all, it looks like your mail_plugins line comes in front of other mail_plugins lines. Maybe the later ones override yours?
mail_plugins = $mail_plugins mail_log notify and this works nicely, maybe because local.conf will be executed after
In /etc/dovecot/local.conf I have the other config files? (That line also keeps the previously requested ones…)
# doveconf -n # 2.2.10.3: /etc/dovecot/dovecot.conf # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.4 ext4 auth_mechanisms = plain login base_dir = /var/run/dovecot/ hostname = mail.numeezy.com imap_capability = +XLIST lda_mailbox_autocreate = yes listen = 188.165.154.169 login_greeting = Ready. mail_gid = 5000 mail_location = maildir:/var/vmail/%d/%n/Maildir mail_plugins = quota mail_log notify mail_privileged_group = mail mail_uid = 5000 namespace inbox { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk { auto = subscribe special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { auto = subscribe special_use = \Trash } mailbox name { special_use = \Drafts \Junk \Sent \Trash } prefix = } passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } plugin { antispam_backend = mailtrain antispam_mail_notspam = --ham antispam_mail_sendmail = /usr/local/bin/sa-learn-pipe.sh antispam_mail_spam = --spam antispam_spam = Junk antispam_trash = Trash mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename mail_log_fields = uid box msgid size quota = dict:user::file:/var/vmail/%d/%n/.quotausage quota_grace = 10%% quota_rule = Trash:storage=+200M quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=80%% quota-warning 80 %u sieve = /var/vmail/%d/%n/.sieve sieve_before = /etc/dovecot/sieve_before sieve_vacation_send_from_recipient = yes } postmaster_address = postmaster@numeezy.com protocols = imap pop3 service auth-worker { user = vmail } service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0660 user = postfix } unix_listener auth-userdb { group = vmail mode = 0600 user = vmail } user = dovecot } service imap-login { inet_listener imap { port = 143 } inet_listener imaps { port = 993 ssl = yes } service_count = 1 } service pop3-login { inet_listener pop3 { port = 110 } inet_listener pop3s { port = 995 ssl = yes } service_count = 1 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { mode = 0666 user = vmail } user = vmail } ssl_cert =
-- peter
On Feb 19, 2014, at 1:24 PM, Alexandre Ellert aellert@numeezy.com wrote:
Hello,
I'm trying to get more info about user activity (especially when they delete some email). So, I follow info from http://wiki2.dovecot.org/Plugins/MailLog to enabled mail logger plugin, but I don't see anything in my logs.
Can you tell me what I'm missing ?
Thanks.
# doveconf -n ... mail_location = maildir:/var/vmail/%d/%n/Maildir mail_plugins = quota mail_log notify mail_privileged_group = mail mail_uid = 5000 ... protocol imap { mail_max_userip_connections = 80 mail_plugins = quota imap_quota antispam } protocol pop3 { mail_max_userip_connections = 30 mail_plugins = quota }
I see "mail_plugins = quota mail_log notify" at the top there, but in the protocol imap block it's "mail_plugins = quota imap_quota antispam". Doesn't the imap block override the global setting?
Sean
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 19 Feb 2014, Sean Kamath wrote:
From: Sean Kamath kamath@moltingpenguin.com On Feb 19, 2014, at 1:24 PM, Alexandre Ellert aellert@numeezy.com wrote:
Hello,
I'm trying to get more info about user activity (especially when they delete some email). So, I follow info from http://wiki2.dovecot.org/Plugins/MailLog to enabled mail logger plugin, but I don't see anything in my logs.
Can you tell me what I'm missing ?
# doveconf -n ... mail_location = maildir:/var/vmail/%d/%n/Maildir mail_plugins = quota mail_log notify mail_privileged_group = mail mail_uid = 5000 ... protocol imap { mail_max_userip_connections = 80 mail_plugins = quota imap_quota antispam } protocol pop3 { mail_max_userip_connections = 30 mail_plugins = quota }
I see "mail_plugins = quota mail_log notify" at the top there, but in the protocol imap block it's "mail_plugins = quota imap_quota antispam". Doesn't the imap block override the global setting?
@Alexandre: You've removed the "$mail_plugins" in the IMAP section as Peter already pointed out?
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUwXT8XD1/YhP6VMHAQJmawf8CJOhyC7HLdGe0uUNlXJgYmFyCD12FpmF DufwuCfVMxe+ce4H6q4QgTdCn91CWsUpsjnqnAsUUnFGUQvLOaswx0paoZLzotci V0OjzhmEz8cTMOiswCEoLJQ8nzAxL7FKcy1eBdzj3+wDd5kH1kBd6DKzaIBLRSWB iVoTke3A0wi9ZIwwABJNNhxR6x+/5/8tkCO6UUi+5kxVkDtX3mBnTAdU5g3xUc/x Z4luip/JaI4MD26lq00RNgTmqW1OSKiRyPvQrVwjRMvOdjcNqw/yPjjpep2VoOv1 gqQYJpfXPJAdo9NWAsdrYtjsi5iRj0tRS6xms4A4FdvAH6NA2/7Drw== =jAiR -----END PGP SIGNATURE-----
@Alexandre: You've removed the "$mail_plugins" in the IMAP section as Peter already pointed out?
I'm not sure to fully understand how mail_plugins directive works.
Please correct, if I'm wrong :
Global mail_plugins lists common plugin used by all protocol :
mail_plugins = quota mail_log notify Later, within each protocol declaration, I need to reference $mail_plugins variable (i.e. mail_plugins = $mail_plugins …)
Each protocol can use its own mail_plugins with an override :
protocol imap { mail_max_userip_connections = 80 mail_plugins = quota imap_quota antispam } In that case mail_log notify are not enabled for protocol imap.
So, I have two options :
List all mail_plugins explicitly for protocol imap, like this : mail_plugins = quota mail_log notify protocol imap { mail_max_userip_connections = 80 mail_plugins = quota imap_quota antispam mail_log notify }
Use $mail_plugins variable to include global mail_plugins into protocol imap : mail_plugins = quota mail_log notify protocol imap { mail_max_userip_connections = 80 mail_plugins = $mail_plugins imap_quota antispam }
Alexandre
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 20 Feb 2014, Alexandre Ellert wrote:
From: Alexandre Ellert aellert@numeezy.com
@Alexandre: You've removed the "$mail_plugins" in the IMAP section as Peter already pointed out?
I'm not sure to fully understand how mail_plugins directive works.
consider it as a variable like in the shell, PHP or perl....
Please correct, if I'm wrong :
Global mail_plugins lists common plugin used by all protocol :
global mail_plugins just assigns a variable, which is used as default, if the setting is missing.
mail_plugins = quota mail_log notify Later, within each protocol declaration, I need to reference $mail_plugins variable (i.e. mail_plugins = $mail_plugins …)
yes, if you want to include the previously defined value.
Each protocol can use its own mail_plugins with an override :
protocol imap { mail_max_userip_connections = 80 mail_plugins = quota imap_quota antispam } In that case mail_log notify are not enabled for protocol imap.
Yep.
So, I have two options :
- List all mail_plugins explicitly for protocol imap, like this :
- Use $mail_plugins variable to include global mail_plugins into protocol imap :
Yes, whichever suits your particular need more.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUwX393D1/YhP6VMHAQKIDAf9HeombYlYE3a35cpjOy7dE/behrF4oLpH 9rDIx7HqfTruiMuT1jkQxcb/aXvWYgrardxrVzS+AOGE5ctU3gbYnqHZWH/ldHD0 jJwfJVpFSM5LuxEWG9djgKZegcYjTwIUIhJYAdIfXdKjVUCpJcSgzaWq2Qp96a28 4Kl6T8wQjWmUSnryPtlC3Ge7rTtvjf46wtzYs9sBWSCyjX/jAGsQG/i5dyzNL4J6 bOKaeXSZz29+MOo67TT0dYR02hsRgHx+4AwqyN8/4P9PH6Xm/DPYHSA4HadTbbO6 vIjmf30YnTKevtdIJsR4UAkmVsRP6xOmn5APIW4JOKbpMUFklpsdlw== =73UN -----END PGP SIGNATURE-----
I've reworked my configuration and now it works as expected. Here is what it looks like now :
mail_plugins = quota mail_log notify
protocol lda { mail_plugins = $mail_plugins sieve }
protocol imap { mail_plugins = $mail_plugins imap_quota antispam }
protocol pop3 { mail_plugins = $mail_plugins }
Thanks all for your help and for good explanations.
Alexandre.
participants (4)
-
Alexandre Ellert
-
Peter Chiochetti
-
Sean Kamath
-
Steffen Kaiser