Dear Aki,

For a very busy server ,if using post login script for record last login ,what is the difference between post login script and last login plugins about performance and limitation ? thanks  

https://wiki.dovecot.org/PostLoginScripting

https://doc.dovecot.org/configuration_manual/lastlogin_plugin/




Henry (<hl1723@yahoo.com.hk>) 在 2021年3月3日星期三 下午06:04:14 [GMT+8] 寫道:


oh! cannot see the last_login_key at logging



Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Added userdb setting: plugin/quota_rule=*:backend=19922944S
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Effective uid=89, gid=89, home=/home/vpopmail/domains/2/6/x/testing.com/email
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Quota root: name=User quota backend=maildir args=
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Quota rule: root=User quota mailbox=* bytes=19922944 messages=0
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Quota grace: root=User quota bytes=1992294 (10%)
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Namespace inbox: type=private, prefix=, sep=., inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/Maildir:INDEX=/home/vpopmail/domains/2/6/x/testing.com/email
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: maildir++: root=/home/vpopmail/domains/2/6/x/testing.com/email/Maildir, index=/home/vpopmail/domains/2/6/x/testing.com/email, indexpvt=, control=, inbox=/home/vpopmail/domains/2/6/x/testing.com/email/Maildir, alt=
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Mailbox INBOX: Mailbox opened because: STATUS
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Mailbox INBOX: Mailbox opened because: SELECT
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Mailbox Drafts: Mailbox opened because: SELECT
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Mailbox Sent: Mailbox opened because: SELECT
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Mailbox Trash: Mailbox opened because: SELECT
Mar  3 17:57:10 cnt8-testing dovecot[650754]: imap(email@testing.com)<650774><yFPl3568ZIXfHfj4>: Debug: Mailbox 寄件備份: Mailbox opened because: SELECT



Aki Tuomi (<aki.tuomi@open-xchange.com>) 在 2021年3月3日星期三 下午05:51:55 [GMT+8] 寫道:


Can you enable `mail_debug=yes` and see what the last_login_key value is when imap session starts? It should show up on logs.

Aki

> On 03/03/2021 11:12 Henry <hl1723@yahoo.com.hk> wrote:
>
>
> but when I remove the last_login_key at plugins, error log as below
>
>
>
> Error: last_login_dict: Failed to write value: dict-server returned failure: sql dict set: Invalid/unmapped key: shared/last-login/email@testing.com (reply took 0.006 secs (0.000 in dict wait, 0.002 in other ioloops, 0.001 in locks, async-id reply 0.000 secs ago, started on dict-server 0.000 secs ago, took 0.000 secs))
>
>
>
> Aki Tuomi (<aki.tuomi@open-xchange.com>) 在 2021年3月3日星期三 下午04:23:20 [GMT+8] 寫道:
>
>
> Looks promising, can you try removing "plugin { last_login_key=.. }" from your configuration file completely and see if it works then?
>
> Aki
>
>
> > On 03/03/2021 10:17 Henry <hl1723@yahoo.com.hk> wrote:
> >
> >
> > Dear Aki
> >
> >
> > Below for output, it is normal?
> >
> > [root@cnt8-testing dovecot]# doveadm user email@testing.com
> >
> > doveadm user email@testing.com
> > field value
> > uid 89
> > gid 89
> > home /home/vpopmail/domains/2/6/x/testing.com/email
> > mail maildir:~/Maildir:INDEX=/home/vpopmail/domains/2/6/x/testing.com/email
> > quota_rule *:bytes=19922944
> > last_login_key last-login/email@testing.com/testing.com///0
> >
> >
> >
> >
> >
> > Aki Tuomi (<aki.tuomi@open-xchange.com>) 在 2021年3月2日星期二 下午10:47:39 [GMT+8] 寫道:
> >
> >
> > Did you try
> >
> > doveadm user account
> >
> > to see that last_login_key appears in output in correct form?
> >
> > Aki
> >
> >
> > On March 2, 2021 2:44:43 PM UTC, Henry <hl1723@yahoo.com.hk> wrote:
> > > Dear Aki,
> > >
> > > I try it as your recommend but still no luck, same error
> > >
> > > Error: Failed to expand plugin setting last_login_key = 'last-login/%u/%d/%r/%l/%a': Unknown variable '%a'
> > >
> > > If I remark #last_login_key = last-login/%u/%d/%r/%l/%a at plugin , error as below
> > >
> > > Error: last_login_dict: Failed to write value: dict-server returned failure: sql dict set: Invalid/unmapped key: shared/last-login/
> > >
> > >