aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-05-02 14:59:48 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-05-02 14:59:48 +0100
commitfd7947966be2cd07caefd68c35e6f2d73d0693c1 (patch)
treeb37a6c89e8a66c4a0ccaa81c886144e63a76671d /script
parent091dfe1df5d47ada296f5bb2f6fc5ef8633c0934 (diff)
parenta7073881fed6ec3f46841da96380d4b5643393a2 (diff)
Merge branch 'develop' of github.com:sebbacon/alaveteli into purge-requests
Diffstat (limited to 'script')
-rwxr-xr-xscript/about2
-rwxr-xr-xscript/breakpointer2
-rwxr-xr-xscript/dbconsole2
-rwxr-xr-xscript/destroy2
-rwxr-xr-xscript/generate2
-rwxr-xr-xscript/handle-mail-replies28
-rwxr-xr-xscript/performance/benchmarker2
-rwxr-xr-xscript/performance/profiler2
-rwxr-xr-xscript/performance/request2
-rwxr-xr-xscript/plugin2
-rwxr-xr-xscript/process/inspector2
-rwxr-xr-xscript/process/reaper2
-rwxr-xr-xscript/process/spawner2
13 files changed, 37 insertions, 15 deletions
diff --git a/script/about b/script/about
index f2b98742d..49a7c2609 100755
--- a/script/about
+++ b/script/about
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/about'
diff --git a/script/breakpointer b/script/breakpointer
index 609564148..46a01d1b2 100755
--- a/script/breakpointer
+++ b/script/breakpointer
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/breakpointer'
diff --git a/script/dbconsole b/script/dbconsole
index c25c5afcd..39042fad3 100755
--- a/script/dbconsole
+++ b/script/dbconsole
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/dbconsole'
diff --git a/script/destroy b/script/destroy
index e63ac0ef5..fddc5160d 100755
--- a/script/destroy
+++ b/script/destroy
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/destroy'
diff --git a/script/generate b/script/generate
index 8c0486a09..fb8139d12 100755
--- a/script/generate
+++ b/script/generate
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/generate'
diff --git a/script/handle-mail-replies b/script/handle-mail-replies
index cc7595bed..7590f5848 100755
--- a/script/handle-mail-replies
+++ b/script/handle-mail-replies
@@ -43,9 +43,22 @@ def main(in_test_mode)
return 1
end
- if is_oof? message
- # Discard out-of-office messages
- return 2
+ # If we are still here, there are no permanent failures,
+ # so if the message is a multipart/report then it must be
+ # reporting a temporary failure. In this case we discard it
+ if message.content_type == "multipart/report"
+ return 1
+ end
+
+ # Another style of temporary failure message
+ subject = message.header_string("Subject")
+ if message.content_type == "multipart/mixed" && subject == "Delivery Status Notification (Delay)"
+ return 1
+ end
+
+ # Discard out-of-office messages
+ if is_oof?(message)
+ return 2 # Use a different return code, to distinguish OOFs from bounces
end
# Otherwise forward the message on
@@ -94,6 +107,15 @@ def permanently_failed_addresses(message)
end
end
+ subject = message.header_string("Subject")
+ # Then look for the style we’ve seen in WebShield bounces
+ # (These do not have a return path of <> in the cases I have seen.)
+ if subject == "Returned Mail: Error During Delivery"
+ if message.body =~ /^\s*---- Failed Recipients ----\s*((?:<[^>]+>\n)+)/
+ return $1.scan(/<([^>]+)>/).flatten
+ end
+ end
+
return []
end
diff --git a/script/performance/benchmarker b/script/performance/benchmarker
index a94253aba..28bfceea0 100755
--- a/script/performance/benchmarker
+++ b/script/performance/benchmarker
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/performance/benchmarker'
diff --git a/script/performance/profiler b/script/performance/profiler
index e9e5b071d..11baf44f2 100755
--- a/script/performance/profiler
+++ b/script/performance/profiler
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/performance/profiler'
diff --git a/script/performance/request b/script/performance/request
index 658c80ef2..fff6fe660 100755
--- a/script/performance/request
+++ b/script/performance/request
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/performance/request'
diff --git a/script/plugin b/script/plugin
index 18ae72620..49f5c441f 100755
--- a/script/plugin
+++ b/script/plugin
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/plugin'
diff --git a/script/process/inspector b/script/process/inspector
index 696551c6b..467962602 100755
--- a/script/process/inspector
+++ b/script/process/inspector
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/process/inspector'
diff --git a/script/process/reaper b/script/process/reaper
index a03da9387..2eea898db 100755
--- a/script/process/reaper
+++ b/script/process/reaper
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/process/reaper'
diff --git a/script/process/spawner b/script/process/spawner
index 6852fba27..ac417c3a7 100755
--- a/script/process/spawner
+++ b/script/process/spawner
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/process/spawner'