1

Topic: trackLastLogin.sh doesn't update all fields with mysql

the provided script here http://iredmail.googlecode.com/hg/extra … stLogin.sh has a problem with mysql. the fields `lastlogindate`and `lastloginipv4` are not set due to the "" around the two functions in the update statement. 

the following should be changed

old

#if [ X"${USER}" != X"dump-capability" ]; then 
#   mysql -u${MYSQL_USER} -p${PASSWD} ${VMAIL_DB_NAME} >/dev/null 2>&1 <<EOF 
#       UPDATE mailbox SET \ 
#       lastloginipv4="INET_ATON('$IP')", \ 
#       lastlogindate="NOW()", \ 
#       lastloginprotocol="${1}" \ 
#       WHERE username='$USER'; 
#EOF 
#fi

new

#if [ X"${USER}" != X"dump-capability" ]; then 
#   mysql -u${MYSQL_USER} -p${PASSWD} ${VMAIL_DB_NAME} >/dev/null 2>&1 <<EOF 
#       UPDATE mailbox SET \ 
#       lastloginipv4=INET_ATON('$IP'), \ 
#       lastlogindate=NOW(), \ 
#       lastloginprotocol="${1}" \ 
#       WHERE username='$USER'; 
#EOF 
#fi

now the both fields are updated right, else they are not updated at all only `lastloginprotocol`is updated else

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.