Hello!
Does it update the remote ip for you if you already have a row for a user? I'm experimenting with a similar feature and it seems to be updating only the login time. I think it figures the other fields are all part of the primary key and therefore not supplied to ON DUPLICATE KEY UPDATE ...
Thanks, Reio
On 24.06.2019 17:25, Júlio Covolato via dovecot wrote:
Em 22/06/2019 22:41, Zhang Huangbin via dovecot escreveu:
On Jun 23, 2019, at 4:43 AM, @lbutlr via dovecot dovecot@dovecot.org wrote:
https://docs.iredmail.org/track.user.last.login.html This is cool, but I have a question:
For MySQL/MariaDB backends, we create the sql table in database vmail. Would this interfere with or confuse postfixadmin? I use that so that users can update their own passwords and domain admins can add users and aliases. The document is for iRedMail, it supports storing mail accounts in SQL or OpenLDAP, that's why the document mentions the difference. You're free to use any database on your own mail server.
Zhang Huangbin, founder of iRedMail project: https://www.iredmail.org/
What I did:
#$ cat dovecot-last-login.conf
connect = host=127.0.0.1 port=3306 dbname=vmail user=vmailadmin password=xxxxxxxxxxxxxxx
map { pattern = shared/last-login/$user/$domain/$rip/$service table = last_login value_field = last_login value_type = uint
fields { username = $user domain = $domain rip = $rip proto = $service } }
dovecot.conf:
plugin {
...
...
# Track last login time on imap and pop3 last_login_dict = proxy::lastlogin last_login_key = last-login/%u/%d/%r/%s }
Result on mysql:
mysql> select * from last_login where username = 'julio@xxx.com.br'; +------------------+------------+------------+---------------+-------+ | username | domain | last_login | rip | proto | +------------------+------------+------------+---------------+-------+ | julio@xxx.com.br | xxx.com.br | 1559921589 | 177.xxx.xxx.230 | imap | +------------------+------------+------------+---------------+-------+ 1 row in set (0.00 sec)
_ Engº Julio Cesar Covolato 0v0 julio@psi.com.br /(_)\ F: +55 11 99175-9260 ^ ^ PSI INTERNET
Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus