Bugs item #1771320, was opened at 2007-08-10 01:19
Message generated for change (Comment added) made by christian_boltz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1771320&group_id=191583
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Thomas Witzenrath (tom_witzenrath)
Assigned to: Nobody/Anonymous (nobody)
Summary: vacation.pl dies with very long recipient e-mail addresses
Initial Comment:
When receiving a message to a realy long e-mail address (i.e. "myrealylongfirstname myrealylongfamilyname <myr...@my...>"), the recipient mail address is not on the same header-line as the "To:", so
-------------snip------------------
# Take headers apart
while (<STDIN>) {
last if (/^$/);
if (/^from:\s+(.*)\n$/i) { $from = $1; }
if (/^to:\s+(.*)\n$/i) { $to = $1; }
if (/^cc:\s+(.*)\n$/i) { $cc = $1; }
if (/^subject:\s+(.*)\n$/i) { $subject = $1; }
if (/^message-id:\s+(.*)\n$/i) { $messageid = $1; }
if (/^precedence:\s+(bulk|list|junk)/i) { exit (0); }
if (/^x-loop:\s+postfix\ admin\ virtual\ vacation/i) { exit (0); }
}
-----------snap-------------------
will not return the correct value for $to. This can be fixed doing something like this:
------------snip------------------
use Mail::Internet;
$header = new Mail::Header \*STDIN;
$from=$header->get('from');
$to=$header->get('to');
$Return_Path=$header->get('Return-Path');
$cc=$header->get('Cc');
$subject=$header->get('subject');
$messageid=$header->get('message-id');
$precedence=$header->get('precedence');
$loop=$header->get('x-loop');
if ( $loop=~ m/Postfix Admin Virtual Vacation/ ) { do_debug("[LOOP]: ",$messageid, $from, "-", $to, $subject); exit (0); }
if ( $precedence=~ m/[Bb]ulk|[Ll]ist|[Jj]unk/ ) { do_debug("[BULK]: ",$messageid, $from, "-", $to, $subject); exit (0); }
------------snap----------------------
I am aware that the loop-detection part does not work like this, I don't know much about perl, so perhaps some perl-a-holic might want to fix that. :-)
The recipient address could as well be provided by postfix, but thats another story I guess...
Also, where can I post an alternate vacation script written in python? :-)
----------------------------------------------------------------------
>Comment By: Christian Boltz (christian_boltz)
Date: 2007-10-07 21:01
Message:
Logged In: YES
user_id=593261
Originator: NO
In the meantime, vacation.pl was replaced by the former
vacation-pgsql.pl.
If I get the code right, this bug should be fixed. Please check the latest
SVN version and reopen this bugreport if I'm wrong.
----------------------------------------------------------------------
Comment By: GingerDog (gingerdog)
Date: 2007-08-17 17:40
Message:
Logged In: YES
user_id=1761957
Originator: NO
create a patch/ticket for it, if you still have a python version. Note
someone's already posted a PHP version. I would love to see a single
vacation script which internally handled the differences between pgsql and
mysql.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1771320&group_id=191583
|