3 # Script called by Dovecot when an user log in
4 # Log that the user just log in
6 # /!\ Script is launched by dovecot with root permissions /!\
8 # Do not use parameters, Dovecot give environnment vars
9 # The only parameters is the expected binary server
11 ALTERNC_CONFIG_FILE="/usr/lib/alternc/functions.sh"
12 if [ ! -r "$ALTERNC_CONFIG_FILE" ]; then
13 echo "Can't access $ALTERNC_CONFIG_FILE."
16 . "$ALTERNC_CONFIG_FILE"
18 mysql_query "update address a, domaines d, mailbox m set m.lastlogin=now() where a.domain_id=d.id and m.address_id=a.id and concat_ws('@',a.address,d.domaine) = '$USER';"
20 # Now launch the expected binary server