Re: maillist.php issues with Usenet postings (manually inserted) [message #9194 is a reply to message #9187] |
Sat, 15 March 2003 19:36 |
|
forrie
Messages: 47 Registered: August 2002 Location: Derry, NH
Karma:
|
Member |
|
|
Following-up to my own post...
The headers in the Usenet articles are older and probably not RFC-compliant. Where we see:
From: email(at)dom(dot)com (Real Name)
I tried looking at maillist.php to see where it was parsing this:
// Fetch From email and Possible name
if( preg_match('!(.*?)<(.*?)>!', $this->headers['from'], $matches) ) {
$this->from_email = trim($matches[2]);
if( !empty($matches[2]) ) {
$matches[2] = trim($matches[2]);
if( $matches[2][0] == '"' && substr($matches[2], -1) == '"' )
$this->from_name = substr($matches[2], 1, -1);
else
$this->from_name = $matches[2];
}
else
$this->from_name = $this->from_email;
if( preg_match('![^A-Za-z0-9\-_\s]!', $this->from_name) ) $this->from_name = substr($this->
from_email, 0, strpos($this->from_email, '@'));
}
else {
$this->from_email = trim($this->headers['from']);
$this->from_name = substr($this->from_email, 0, strpos($this->from_email, '@'));
}
if( empty($this->from_email) || empty($this->from_name) )
mlist_error_log("no name or email for ".$this->headers['from'], $this->raw_msg, 'ERROR');
[ ... snip ... ]
I tried changing the regex to this:
'/^From:.(.*?).\\\((.*?)\\\)/'
As well as inserting some tests in between, to no avail. So it much be choking somewhere else.
A sample header from the Usenet articles is in the first posting of this thread.
I literally have 1000's of these that I need to import into FudForum, so any pointers/patches would be appreciated.
Thanks...
|
|
|