Em 22/06/2019 22:41, Zhang Huangbin via dovecot escreveu:> >> On Jun 23, 2019, at 4:43 AM, @lbutlr via dovecot <dovecot at 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 at xxx.com.br'; +------------------+------------+------------+---------------+-------+ | username???????? | domain???? | last_login | rip?????????? | proto | +------------------+------------+------------+---------------+-------+ | julio at 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 at psi.com.br> /(_)\ F: +55 11 99175-9260 ^ ^ PSI INTERNET ---------------------------------- --- Este email foi escaneado pelo Avast antiv?rus. https://www.avast.com/antivirus
On 24 Jun 2019, at 08:25, J?lio Covolato via dovecot <dovecot at dovecot.org> wrote:> #$ cat dovecot-last-login.conf[ ? ]> 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 > }Thank you, that is very clear. Where is the file dovecot-last-login.conf referenced in the dovecot.conf? Or it is enabled by virtue of being in conf.d/? -- "I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they've always worked for me." --Hunter Thompson
Em 24/06/2019 11:48, @lbutlr via dovecot escreveu:> On 24 Jun 2019, at 08:25, J?lio Covolato via dovecot <dovecot at dovecot.org> wrote: >> #$ cat dovecot-last-login.conf > [ ? ] > >> 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 >> } > Thank you, that is very clear. > > Where is the file dovecot-last-login.conf referenced in the dovecot.conf? Or it is enabled by virtue of being in conf.d/?Sory, forgot this: dovecot.conf: dict { ??? #expire = db:/var/lib/dovecot/expire/expire.db ??? quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf ??? lastlogin = mysql:/etc/dovecot/dovecot-last-login.conf ??? acl = mysql:/etc/dovecot/dovecot-share-folder.conf } ---------------------------------- _ Eng? Julio Cesar Covolato 0v0 <julio at psi.com.br> /(_)\ F: +55 11 99175-9260 ^ ^ PSI INTERNET ---------------------------------- --- Este email foi escaneado pelo Avast antiv?rus. https://www.avast.com/antivirus
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 at 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 at xxx.com.br'; > +------------------+------------+------------+---------------+-------+ > | username???????? | domain???? | last_login | rip?????????? | proto | > +------------------+------------+------------+---------------+-------+ > | julio at 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 at psi.com.br> > ? /(_)\? F: +55 11 99175-9260 > ?? ^ ^?? PSI INTERNET > ---------------------------------- > > > --- > Este email foi escaneado pelo Avast antiv?rus. > https://www.avast.com/antivirus >