summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2000-04-09 23:43:00 +0000
committerbwarsaw2000-04-09 23:43:00 +0000
commit1362a143bb25ab811e9e72ff42e03c6f666e6c92 (patch)
treea7aa053b1e22d7fc854b80a5a4ef7f9d423f00e8
parent5cbe8098fb137c9baafcc0aa1448b5208dec5991 (diff)
downloadmailman-1362a143bb25ab811e9e72ff42e03c6f666e6c92.tar.gz
mailman-1362a143bb25ab811e9e72ff42e03c6f666e6c92.tar.zst
mailman-1362a143bb25ab811e9e72ff42e03c6f666e6c92.zip
Simple detector for messages that contain X-Failed-Recipient headers,
even though I don't know what MTA generates such messages.
-rw-r--r--Mailman/Bouncers/Exim.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/Mailman/Bouncers/Exim.py b/Mailman/Bouncers/Exim.py
new file mode 100644
index 000000000..4568c87f3
--- /dev/null
+++ b/Mailman/Bouncers/Exim.py
@@ -0,0 +1,35 @@
+# Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+"""Parse messages that contain X-Failed-Recipients headers.
+What MTA generates these?
+"""
+
+import string
+
+
+
+def process(mlist, msg):
+ failures = msg.getallmatchingheaders('x-failed-recipients')
+ if not failures:
+ return None
+ addrs = []
+ for failed in failures:
+ i = string.find(failed, ':')
+ if i < 0:
+ continue
+ addrs.append(string.strip(failed[i+1:]))
+ return addrs or None