diff options
Diffstat (limited to 'oftc-listmod-process-outbox')
-rwxr-xr-x | oftc-listmod-process-outbox | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/oftc-listmod-process-outbox b/oftc-listmod-process-outbox index 032c88b..a0b634d 100755 --- a/oftc-listmod-process-outbox +++ b/oftc-listmod-process-outbox @@ -1,6 +1,8 @@ #!/usr/bin/ruby OUTBOX="mail/outbox" +HUMANS="mail/outbox-tolistmods" +HUMAN="listmoderators@lists.oftc.net" def check_maildir(d) throw "#{d} is not a maildir" unless FileTest.directory?(d) @@ -11,6 +13,7 @@ def check_maildir(d) end check_maildir OUTBOX +check_maildir HUMANS Dir[OUTBOX+"/new/*"].each do |filename| if system("/usr/sbin/sendmail -t -oi < #{filename}") @@ -19,3 +22,11 @@ Dir[OUTBOX+"/new/*"].each do |filename| STDERR.puts "Mailing of #{filename} failed." end end + +Dir[HUMANS+"/new/*"].each do |filename| + if system("/usr/sbin/sendmail -oi #{HUMAN} < #{filename}") + File.unlink(filename) + else + STDERR.puts "Mailing of #{filename} failed." + end +end |