# HG changeset patch # User HIROSE Yuuji # Date 1587421523 -32400 # Node ID 5f1d4bbf9dea2498042cc279be57918f7d6f25ca # Parent 9d053819cbc089e7e3173fe5a4769a8b32e2754f smail_queue frequency control diff -r 9d053819cbc0 -r 5f1d4bbf9dea s4-funcs.sh --- a/s4-funcs.sh Mon Apr 20 12:44:57 2020 +0900 +++ b/s4-funcs.sh Tue Apr 21 07:25:23 2020 +0900 @@ -17,6 +17,7 @@ listentlimit=${LISTENTLIMIT:-30} admin=${ADMIN:-hostmaster@example.org} noreply=${NOREPLY:-noreply@example.org} +noreply_from="${S4NAME:-s4} message notification <$noreply>" templ=${TEMPL:-templ} layout=${LAYOUT:-$templ/default} formdir=${FORMDIR:-$templ/form} @@ -1148,14 +1149,7 @@ } smail_queue_flush() { # $1=timelimit - timelimit=`sq $workdb "SELECT datetime('now', 'localtime', '-1 minutes');"` - err timelimit="$timelimit" rowid=$rowid - err r===="$(sq $workdb <<-EOF - SELECT rowid FROM smailq - GROUP BY rcpts, subj - HAVING min(time) < '$timelimit'; - EOF - )" + timelimit=`query "SELECT datetime('now', 'localtime', '-6 hours');"` rowids=$(sq $workdb <<-EOF SELECT rowid FROM smailq GROUP BY rcpts, subj @@ -1166,12 +1160,12 @@ sq $workdb \ "SELECT hex(rcpts),hex(subj) FROM smailq WHERE rowid in ($rid)" \ | if IFS='|' read hexr hexs; then - err "hexrcpt=[$hexr] hexsubj=[$hexs]" + # err "hexrcpt=[$hexr] hexsubj=[$hexs]" rcpt=`echo "$hexr"|unhexize` subj=`echo "$hexs"|unhexize` # err ROWID==$rowid "sql=<