From cbac254d605afbdfcc39072847a57f32861c099c Mon Sep 17 00:00:00 2001 From: Thanassis Zakopoulos Date: Fri, 23 Jul 2021 12:56:03 +0300 Subject: [PATCH] Update Password_Expiration.md This line should be like this: echo -e "Dear User, \n Your password will expire on ${RESULT[1]}" | mail -s "Password $INTERVAL days before expiration notication" -r $REPLY_ADDRESS ${RESULT[0]} instead of echo -e "Dear User, \n Your password will expire on ${RESULT[1]}" | mail -s "Password 30 days before expiration notication" -r $REPLY_ADDRESS ${RESULT[0]} otherwise the subject will always be 30 days no matter what the $INTERVAL is --- DOCUMENTS/Password_Expiration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DOCUMENTS/Password_Expiration.md b/DOCUMENTS/Password_Expiration.md index 0d9fb826..6e64d2ba 100644 --- a/DOCUMENTS/Password_Expiration.md +++ b/DOCUMENTS/Password_Expiration.md @@ -86,7 +86,7 @@ do QUERY="SELECT username,password_expiry FROM mailbox WHERE password_expiry > now() + interval $LOWER DAY AND password_expiry < NOW() + interval $INTERVAL DAY" mysql --defaults-extra-file="$MYSQL_CREDENTIALS_FILE" "$POSTFIX_DB" -B -N -e "$QUERY" | while IFS=$'\t' read -a RESULT ; do - echo -e "Dear User, \n Your password will expire on ${RESULT[1]}" | mail -s "Password 30 days before expiration notication" -r $REPLY_ADDRESS ${RESULT[0]} + echo -e "Dear User, \n Your password will expire on ${RESULT[1]}" | mail -s "Password $INTERVAL days before expiration notication" -r $REPLY_ADDRESS ${RESULT[0]} done done