mirror of
https://github.com/GRFreire/nthmail.git
synced 2026-01-09 04:49:39 +00:00
add an optinal rcpt_addr to not delete mails
This commit is contained in:
parent
a88e5e90dc
commit
2ff5817490
@ -5,7 +5,12 @@ if [ -z "$DB_PATH" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
min_date="$(date -d '-1 day' +%s)"
|
min_date="$(date -d '-1 day' +%s)"
|
||||||
sql="DELETE FROM mails WHERE mails.arrived_at < $min_date;"
|
sql="DELETE FROM mails WHERE mails.arrived_at < $min_date"
|
||||||
|
|
||||||
|
if [ -n "$EXCLUDE_IGNORE_ADDR" ]; then
|
||||||
|
sql="$sql AND not (rcpt_addr = '$EXCLUDE_IGNORE_ADDR')"
|
||||||
|
fi
|
||||||
|
sql="$sql;"
|
||||||
|
|
||||||
echo "$sql" | sqlite3 "$DB_PATH"
|
echo "$sql" | sqlite3 "$DB_PATH"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user