X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=email.awk;fp=email.awk;h=a417f9e3bf659304511703496c43ae7bb450e580;hb=520dcb84adcd9af6b1f3734495650c862bc9f55e;hp=270836e12dafe8153e0158c3239d9a20c0450d5d;hpb=6906556aeafc8375b5de8ce479f0967d7696e647;p=~andy%2Frhawk diff --git a/email.awk b/email.awk index 270836e..a417f9e 100644 --- a/email.awk +++ b/email.awk @@ -1,3 +1,9 @@ +@include "json.awk" + +# Save email addresses +BEGIN { json_load("var/mail.txt", mail_enable) } +END { json_save("var/mail.txt", mail_enable) } + # Email notifications BEGIN { mail_hist = 60 # Send 60 seconds of backlog @@ -6,6 +12,9 @@ BEGIN { mail_from = NICK "" mail_err = "If you received this message in error,\n" \ "someone in #rhnoise is being a jerk" + + for (_user in mail_enable) + debug("watching " mail_enable[_user] " for " _user) } function mail_send(addr, subj, body, @@ -67,7 +76,7 @@ FROM ~ OWNER && } /^e?mail *[^ ]*$/ { - reply("notifying " $2) + reply("notifying " $2 " for " FROM) mail_enable[FROM] = $2 }