Re: lastlogindate, lastloginipv4, lastloginprotocol ?

Thank you.

Your script is working, if I modify something: remove the double quotes from the INET_ATON('$IP') and NOW(). Otherwise mysql will literally try to write in the field `lastlogindate` the text "NOW()" instead of the actual result of the function NOW() (which is current datetime).

Re: lastlogindate, lastloginipv4, lastloginprotocol ?

Re: lastlogindate, lastloginipv4, lastloginprotocol ?

That won't work either, because the first argument of the script is sent to the "imap" and "pop3" binaries. There is no such command line switches for them, so they crash. You need to make 2 separate scripts, one for IMAP and one for POP3, and don't feed them any arguments.

And, don't put them in libexec/dovecot, it won't work! (maybe because of SELinux?)