Yikes, this is my bad! I AM using the LMTP service for delivery. What I meant was that I do not necessarily need to track the logins to the LMTP service. I suppose it wouldn’t hurt to track them though. Any idea why it would be throwing this error? Which key is it expecting to be mapped? Am I missing a configuration specifically for this? Should the last login for LMTP use the same dict as the IMAP configuration?
Here’s my IMAP configuration:
protocol imap {
mail_plugins = $mail_plugins imap_sieve imap_quota last_login
}
Here’s my LMTP configuration:
protocol lmtp {
mail_plugins = $mail_plugins sieve
}
And then here’s my main mail_plugins configuration:
mail_plugins = $mail_plugins quota mailbox_alias last_login
Finally, here’s my dict for the last_login:
plugin {
last_login_dict = proxy::sql
last_login_key = last-login/%{service}/%{user}/%{remote_ip}
last_login_precision = ms
}
dict {
sql = mysql:/etc/dovecot/inc.d/inc.lastlogin.sql.conf
}
All the documentation I have seen everywhere shows that to enable a plugin, you must add it to the main mail_plugins as well as in each protocol you want the plugin enabled but it appears that the $mail_plugins is a variable and adding them there anyways. Is this correct? If so, why does most of the documentation I am reading on a daily basis show to add plugins to the main mail_plugins as well as the protocol?
Any further help is definitely appreciated so I can get this figured out.
Thank you!
------ Original Message ------ From "John Fawcett via dovecot" <dovecot@dovecot.org> To dovecot@dovecot.org Date 7/17/2024 10:23:24 AM Subject Re: Invalid/Unmapped Key with Last Login Plugin
On 17/07/2024 16:03, dovecot--- via dovecot wrote:
Hello all! I have the last login plugin working with the IMAP service however with LMTP, it errors. I do not necessarily need / want the LMTP service and did not explicitly enable it but it is throwing an error in my logs.
Jul 17 10:22:14 lmtp(184051):Error: last_login_dict: Failed to write value: dict-server returned failure: sql dict set: Invalid/unmapped key:shared/last-login/lmtp/username@domain.com/ (reply took 0.234 secs (0.001 in dict wait, 0.033 in other ioloops, 0.030 in locks, as ync-id reply 0.000 secs ago, started on dict-server 0.220 secs ago, took 0.000 secs))
It would be nice to get rid of this error one or another: either disable last login for LMTP or get it working.
Current Configuration from doveconf -n
...
protocols = imap lmtp
service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix mode = 0666 user = postfix } }
But LMTP is being explicitly enabled in your config. Remove it from the protocols= line. And optionally remove the service {...} block for it. However just taking it out of protocols should be good enough.
Hi Adam
My recommendation, before disabling lmtp, would be to investigate and maybe revise this point "I do not necessarily need / want the LMTP service and did not explicitly enable it". That error is being generated by a login to lmtp. So what is logging in despite you not needing lmtp?
If for example you are using lmtp to deliver email from postfix to dovecot, disabling lmtp will stop the flow of new email.
John
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org