FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » maillist.php issues with Usenet postings (manually inserted)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
maillist.php issues with Usenet postings (manually inserted) [message #9187] Sat, 15 March 2003 04:48 Go to next message
forrie is currently offline  forrie   United States
Messages: 47
Registered: August 2002
Location: Derry, NH
Karma: 0
Member
I have the mailing list gateway working finally. However, I'm running into a problem with maillist.php not apparently parsing the Usenet headers correctly.

For example, one of the old Usenet posts (from a directory archive I have) has this for headers:

Path: news.iii.net!iii2.iii.net!not-for-mail
From: bsmith(at)iii2(dot)iii(dot)net (Bob)
Newsgroups: local.iii
Subject: (ALERT) INTERNET DAY OF PROTEST TUESDAY DECEMBER 12, 1995
Date: 10 Dec 1995 21:07:28 -0500
Organization: iii-net
Lines: 232
Message-ID: <4ag3p0$7qf(at)iii2(dot)iii(dot)net>
NNTP-Posting-Host: iii2.iii.net
X-Newsreader: TIN [version 1.2 PL2]


If I pipe this to maillist.php, it does get posted, but the poster is "Anonymous Coward" which means maillist.php isn't picking up the From: header.

By "pipe" I mean something like this:

$ cat 3232 | /usr/local/apache/htdocs/forum/scripts/maillist.php 1

Not sure if "1" is needed for that method.

It's pretty important that I get this info into the forum for what it's being used for, though.


Thanks,

Forrest
Re: maillist.php issues with Usenet postings (manually inserted) [message #9194 is a reply to message #9187] Sat, 15 March 2003 19:36 Go to previous messageGo to next message
forrie is currently offline  forrie   United States
Messages: 47
Registered: August 2002
Location: Derry, NH
Karma: 0
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. Smile

Thanks...


Re: maillist.php issues with Usenet postings (manually inserted) [message #9204 is a reply to message #9194] Sun, 16 March 2003 20:46 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well, maillist.php will import the article, but as you can imagine it is not tuned for importing of NNTP articles...
The best solution I can recommend is to take the nntp.php script and modify it in such a way that it works like maillist.php, which can messages piped to it.



FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: problems with importing data after server move again
Next Topic: Private Forums?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 10:30:22 GMT 2024

Total time taken to generate the page: 0.02445 seconds