Alternc  latest
Alternc logiel libre pour l'hébergement
popimap-log-login.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 # Script called by Dovecot when an user log in
4 # Log that the user just log in
5 
6 # /!\ Script is launched by dovecot with root permissions /!\
7 
8 # Do not use parameters, Dovecot give environnment vars
9 # The only parameters is the expected binary server
10 
11 ALTERNC_CONFIG_FILE="/usr/lib/alternc/functions.sh"
12 if [ ! -r "$ALTERNC_CONFIG_FILE" ]; then
13  echo "Can't access $ALTERNC_CONFIG_FILE."
14  exit 1
15 fi
16 . "$ALTERNC_CONFIG_FILE"
17 
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';"
19 
20 # Now launch the expected binary server
21 exec "$@"