Download & Extend

Please change the regexp for parsing the From: headers

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)

Issue Summary

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

Comments

#1

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

http://drupal.org/diffandpatch

Thanks for your contribution.

Kieran

#2

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

Status:active» postponed (maintainer needs more info)
nobody click here