summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fml/lib/Mail/Bounce/Exim.pm92
-rw-r--r--regress/testmails/error=exim52
2 files changed, 144 insertions, 0 deletions
diff --git a/fml/lib/Mail/Bounce/Exim.pm b/fml/lib/Mail/Bounce/Exim.pm
new file mode 100644
index 00000000..d30d832a
--- /dev/null
+++ b/fml/lib/Mail/Bounce/Exim.pm
@@ -0,0 +1,92 @@
+#-*- perl -*-
+#
+# Copyright (C) 2001 Ken'ichi Fukamachi
+# All rights reserved. This program is free software; you can
+# redistribute it and/or modify it under the same terms as Perl itself.
+#
+# $FML: Exim.pm,v 1.4 2001/04/10 11:52:26 fukachan Exp $
+#
+
+
+package Mail::Bounce::Exim;
+
+use strict;
+use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+use Carp;
+
+=head1 NAME
+
+Mail::Bounce::Exim - Exim error message format parser
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+
+ $result = {
+ addr => {
+ Original-Recipient => 'rfc822; addr'
+ Final-Recipient => 'rfc822; addr'
+ Diagnostic-Code => 'reason ...'
+ Action => 'failed'
+ Status => '4.0.0'
+ }
+ }
+
+=head1 Exim Error Formats
+
+ Received: from fukachan by eriko.fml.org with local (Exim 2.04 #5)
+ id 11fxjP-0005MW-00
+ for enterprise-admin@shumi.fml.org; Tue, 26 Oct 1999 12:57:07 +0900
+ X-Failed-Recipients: rudo@nuinui.net
+ From: Mail Delivery System <Mailer-Daemon@eriko.fml.org>
+ To: enterprise-admin@shumi.fml.org
+ Subject: Mail delivery failed: returning message to sender
+ Message-Id: <E11fxjP-0005MW-00@eriko.fml.org>
+
+=head1 METHODS
+
+=head2 C<new()>
+
+=cut
+
+
+# need to guess MTA as "exim" ???
+# if (/^Message-ID:\s+\<[\w\d]+\-[\w\d]+\-[\w\d]+\@/i) {
+# $MTA = "exim";
+# }
+
+
+sub analyze
+{
+ my ($self, $msg, $result) = @_;
+ my $m = $msg->rfc822_message_header();
+ my $addr = $m->get('X-Failed-Recipients');
+
+ $addr =~ s/\s*$//;
+
+ # set up return buffer
+ $result->{ $addr }->{ 'Final-Recipient' } = $addr;
+ $result->{ $addr }->{ 'Status' } = '5.x.y';
+}
+
+=head1 AUTHOR
+
+Ken'ichi Fukamachi
+
+=head1 COPYRIGHT
+
+Copyright (C) 2001 Ken'ichi Fukamachi
+
+All rights reserved. This program is free software; you can
+redistribute it and/or modify it under the same terms as Perl itself.
+
+=head1 HISTORY
+
+Mail::Bounce::DSN appeared in fml5 mailing list driver package.
+See C<http://www.fml.org/> for more details.
+
+=cut
+
+
+1;
diff --git a/regress/testmails/error=exim b/regress/testmails/error=exim
new file mode 100644
index 00000000..7fec3320
--- /dev/null
+++ b/regress/testmails/error=exim
@@ -0,0 +1,52 @@
+Received: by hikari.fml.org (8.9.2/3.4W6+Hikari-2.1) with ESMTP id MAA20938 for <fukachan@fml.org>; Tue, 26 Oct 1999 12:57:41 +0900 (JST)
+Received: by eve.fml.org; id MAA20406; Tue, 26 Oct 1999 12:57:41 +0900 (JST)
+Received: from eriko.fml.org(10.20.30.3) by eve.fml.org via smap (V3.1)
+ id xma020392; Tue, 26 Oct 99 12:57:33 +0900
+Received: by eriko.fml.org (8.9.3/3.4W6+Eriko1.3+fml.org01/Hikari-1.7) with SMTP id MAA20626 for <<enterprise-admin@shumi.fml.org>>; Tue, 26 Oct 1999 12:57:31 +0900 (JST)
+Received: from wsclark.huie.hokudai.ac.jp(10.20.30.6) by eriko.fml.org via sraq (V1.3)
+ id sma020622; Tue Oct 26 12:57:21 1999
+Received: from eriko.fml.org (eriko.fml.org [10.20.30.8]) by huie.hokudai.ac.jp (8.8.7+2.7Wbeta7/2.8Wb) with ESMTP id MAA03017; Tue, 26 Oct 1999 12:57:09 +0900 (JST)
+Received: from fukachan by eriko.fml.org with local (Exim 2.04 #5)
+ id 11fxjP-0005MW-00
+ for enterprise-admin@shumi.fml.org; Tue, 26 Oct 1999 12:57:07 +0900
+X-Failed-Recipients: rudo@nuinui.net
+From: Mail Delivery System <Mailer-Daemon@eriko.fml.org>
+To: enterprise-admin@shumi.fml.org
+Subject: Mail delivery failed: returning message to sender
+Message-Id: <E11fxjP-0005MW-00@eriko.fml.org>
+Date: Tue, 26 Oct 1999 12:57:07 +0900
+X-UIDL: 5f6c912938ac41095f38aef614886cbe
+
+This message was created automatically by mail delivery software.
+
+A message that you sent could not be delivered to all of its recipients. The
+following address(es) failed:
+
+ rudo@nuinui.net:
+ Connection timed out:
+ retry timeout exceeded
+
+------ This is a copy of the message, including all the headers. ------
+
+From owner-elena@elena.fml.org Fri Jan 26 00:11:07 2001
+Return-Path: <fukachan@fml.org>
+Received: from hikari.fml.org (hikari.fml.org [10.20.30.33])
+ by elena.fml.org (Postfix) with ESMTP id C995C1D8C9
+ for <mailbox@elena.fml.org>; Tue, 2 Jan 2001 17:08:05 +0900 (JST)
+Received: by hikari.fml.org (8.9.3/3.4W6+Hikari-2.1) with ESMTP id RAA17788 for <caesar@fml.org>; Tue, 2 Jan 2001 17:08:04 +0900 (JST)
+Received: by iris.fml.org (Postfix, from userid 0)
+ id 1BCBE15024; Tue, 2 Jan 2001 17:08:03 +0900 (JST)
+From: fukachan@fml.org (Ken'ichi Fukamachi)
+To: elena@nuinui.net
+Reply-To: rudo@nuinui.net
+Subject: [elena:00300] test 01
+ appended_mesg
+Message-Id: <20010102080803.1BCBE15024@iris.fml.org>
+Date: Tue, 2 Jan 2001 17:08:03 +0900 (JST)
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-2022-JP
+Content-Transfer-Encoding: 7bit
+
+test message
+
+-- rudo's mabuachi