Please change the regexp for parsing the From: headers

Deno - October 20, 2006 - 13:04
Project:Organic groups list manager
Version:4.7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

Hi folks,

Nice work on og2list. I'm using it on http://sany-ip.eu for internal communication, and we had to fix a couple of bugs. The last one I just encountered concernes the "From:" header parsing in mail-in.pl script, somewhere around line 320. Here is the new code:

($from_name, $from_address) =
($head->get("From",0) =~ /^\s*(.*?)\s*<?(\S+?\@\S+?)>?\s*$/);

if (!$from_name) {
($from_name) = ($from_address =~ /^(.*)\@.*$/);
$from_name =~ s/[\.\_\-]/ /;
}

($to_name, $to_address) =
($head->get("To",0) =~ /^\s*(.*?)\s*<?(\S+?\@\S+?)>?\s*$/);

I needed to change the regexp because one of the partners uses Lotus notes, and sends headers of the form "From: name@domain".

Hope this helps.

kindest regards
Denis

#1

Amazon - October 21, 2006 - 15:46

Denis, it is preferred is you follow these guidelines when posting improvements.

http://drupal.org/diffandpatch

Thanks for your contribution.

Kieran

#2

killes@www.drop.org - December 5, 2006 - 14:02

Denno, can you please post the From: header of that mail exactly as it was in the mail? (of coure replace name and address)

#3

Gerhard Killesreiter - January 11, 2007 - 01:02
Status:active» postponed (maintainer needs more info)
 
 

Drupal is a registered trademark of Dries Buytaert.