From d14bcf7bddcd97fe9e6248e157c932bb354ac804 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Sat, 4 Aug 2001 06:08:07 +0000 Subject: intermediate --- Mailman/Bouncers/LLNL.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Mailman/Bouncers/LLNL.py diff --git a/Mailman/Bouncers/LLNL.py b/Mailman/Bouncers/LLNL.py new file mode 100644 index 000000000..51b4205c4 --- /dev/null +++ b/Mailman/Bouncers/LLNL.py @@ -0,0 +1,35 @@ +# Copyright (C) 2001 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. + +"""LLNL's custom Sendmail bounce message.""" + +import re +from mimelib.MsgReader import MsgReader + +acre = re.compile(r',\s*(?P\S+@[^,]+),', re.IGNORECASE) + + + +def process(msg): + mi = MsgReader(msg) + while 1: + line = mi.readline() + if not line: + break + mo = acre.search(line) + if mo: + return [mo.group('addr')] + return [] -- cgit v1.3.1