Article View: news.software.nntp
Article #68427Re: NNTP Programming question - Multi part messages
From: Curt Welch
Date: Thu, 04 Mar 2004 20:44
Date: Thu, 04 Mar 2004 20:44
50 lines
3335 bytes
3335 bytes
Gord <gord_muir@nospam_hotmail.com> wrote: > Ok if we're stuck with subject line guessing thats too bad... but, has > anyone come up with a decent regular expresssion or algorithm to aid > with this? Everyone that has attempted to automaticaly identify multipart posts has done it. The problem is that there's no simply way to do it and get it right all the time. So you have to add various special cases acceptions to try and prevent as many errors as possible. And over time, you have to keep adjusting your code if you want it to work well to deal with changing posting habits and tools. The simple way of doing it fairly trivial. You just sort the subjects and assume that a multiplart post will correctly sort together in the list and that the last NNN/NNN string in the subject is the one to use when matching up parts. Just donig that gets a very large percentage of posts correctly identified. How much more than that you want to do determines how many times your code matches things up correctly and how many times it failes. If the same file is posted twice, with the same subject, but with a different size per article which makes the total number of parts different in the two posts, the above technique will fail because the parts won't sort together correctly. If someone adds an extra NN/NN to the end of the subject, like: part3 (01/10) file 3/5 part3 (02/10) file 3/5 The above will fail because to match up the parts you have to use the first NN/NN instead of the last. If they fail to zero pad the first number in the NN/NN pair, the subjects won't sort into the correct order. If there is a partial post, which failed, and then a full repost, you will get extra parts, which could confuse simple-minded code. If someone intentionally tries to corrupt a post by posting forged parts, simple part matching code is likely to be tricked into grabbing some of the wrong parts. These are all things that you can make work correctly (most the time) with "smarter" code. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Technical Details
Message-ID:
<20040304154419.726$DF@newsreader.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!feed4.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mailReferences:
<n3b740p7nioh4h8c89crsbu05risnmf9hb@4ax.com> <87ishoz18r.fsf@windlord.stanford.edu> <ohqe40pf99idk7h03k14ldrkju8mhc6f2s@4ax.com>Show Full Headers
Complete Article Headers
Message-ID: <20040304154419.726$DF@newsreader.com>
Subject: Re: NNTP Programming question - Multi part messages
Date: Thu, 04 Mar 2004 20:44:19 +0000
From: curt@kcwc.com (Curt Welch)
References: <n3b740p7nioh4h8c89crsbu05risnmf9hb@4ax.com> <87ishoz18r.fsf@windlord.stanford.edu> <ohqe40pf99idk7h03k14ldrkju8mhc6f2s@4ax.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!feed4.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com VZezvRcFTC4=y@4U_tiLxThAVfC7nlcm8Fy-mZY4BCxNOQwzG3
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,
?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
%IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 50