diff options
Diffstat (limited to 'script')
-rwxr-xr-x | script/about | 2 | ||||
-rwxr-xr-x | script/breakpointer | 2 | ||||
-rwxr-xr-x | script/dbconsole | 2 | ||||
-rwxr-xr-x | script/destroy | 2 | ||||
-rwxr-xr-x | script/generate | 2 | ||||
-rwxr-xr-x | script/handle-mail-replies | 28 | ||||
-rwxr-xr-x | script/performance/benchmarker | 2 | ||||
-rwxr-xr-x | script/performance/profiler | 2 | ||||
-rwxr-xr-x | script/performance/request | 2 | ||||
-rwxr-xr-x | script/plugin | 2 | ||||
-rwxr-xr-x | script/process/inspector | 2 | ||||
-rwxr-xr-x | script/process/reaper | 2 | ||||
-rwxr-xr-x | script/process/spawner | 2 |
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' |