-
newsutil.js - content-type and binary usenet groups.
From
Ash-Fox@VERT to
DOVE-Net.Synchronet_JavaScript on Mon Nov 19 13:00:39 2007
Greetings,ããI've noticed that Synchronet's NNTP server has 'weird' issues when mirroringãbinary groups. Upon further investigation I found that the 'default'ãcontent-type which was being inserted by newsutil.js was causing binaryãattachments in the messages to appear as text.ããwriteln("Content-Type: text/plain; charset=IBM437");ããIf I comment this line out, news readers suddenly don't have a issueãfiguring out there is a attachment in the message. I know this line isãimportant as it assumes the messages are in the old IBM437 charset which isãmore compatible with BBS messages.ããI have read through RFC 2049 (
http://www.ietf.org/rfc/rfc2049.txt) and tryãas might. No matter what content-type I specified, the messages did notãdisplay correctly.ããFor this reason I'm trying to figure out a workaround that would work. Suchãas, somehow marking the messages that newslink importsãas 'non-charsettable' or such. Unfortunately this isn't going too well andãwondered if anyone had any ideas on this issue.ãã~Ash-Foxã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Digital Man@VERT to
Ash-Fox on Mon Nov 19 17:40:37 2007
Re: newsutil.js - content-type and binary usenet groups.ã By: Ash-Fox to DOVE-Net.Synchronet_JavaScript on Mon Nov 19 2007 01:00 pmãã > Greetings,ã > ã > I've noticed that Synchronet's NNTP server has 'weird' issues when mirroringã > binary groups. Upon further investigation I found that the 'default'ã > content-type which was being inserted by newsutil.js was causing binaryã > attachments in the messages to appear as text.ã > ã > writeln("Content-Type: text/plain; charset=IBM437");ããThe line is only inserted (from newsutil.js) if the original message does notãcontain a specified Content-Type header field. If you're mirroring between NNTPãservers, then I would expect the original messages to have this Content-Typeãheader field.ãã > If I comment this line out, news readers suddenly don't have a issueã > figuring out there is a attachment in the message. I know this line isã > important as it assumes the messages are in the old IBM437 charset which isã > more compatible with BBS messages.ã > ã > I have read through RFC 2049 (
http://www.ietf.org/rfc/rfc2049.txt) and tryã > as might. No matter what content-type I specified, the messages did notã > display correctly.ã > ã > For this reason I'm trying to figure out a workaround that would work. Suchã > as, somehow marking the messages that newslink importsã > as 'non-charsettable' or such. Unfortunately this isn't going too well andã > wondered if anyone had any ideas on this issue.ããCan you check if the original messages (on USENET?) have the Content-Typeãheader field or not?ãã digital man (xbox-live: digitlman)ããSnapple "Real Fact" #39:ãAn ant's smell is stronger then a dog's.ãNorco, CA WX: ---.-øF, --% humidity, NaN mph --- wind, --.-- inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Ash-Fox@VERT to
Digital Man on Tue Nov 20 04:13:26 2007
Digital Man wrote:ãã> > writeln("Content-Type: text/plain; charset=IBM437");ã> ã> The line is only inserted (from newsutil.js) if the original message doesã> not contain a specified Content-Type header field.ããI understood that from the comments in the code :)ãã> If you're mirroring ã> between NNTP servers, then I would expect the original messages to haveã> this Content-Type header field.ããUnfortunately, that isn't case with all messages.ãã> ã> Can you check if the original messages (on USENET?) have the Content-Typeã> header field or not?ã> ãThe messages that I've had problems with, do not have content-type headers.ãã~Ash-Foxã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Digital Man@VERT to
Ash-Fox on Mon Nov 19 23:50:05 2007
Re: Re: newsutil.js - content-typã By: Ash-Fox to Digital Man on Tue Nov 20 2007 04:13 amãã > Digital Man wrote:ã > ã > > > writeln("Content-Type: text/plain; charset=IBM437");ã > >ã > > The line is only inserted (from newsutil.js) if the original message doesã > > not contain a specified Content-Type header field.ã > ã > I understood that from the comments in the code :)ã > ã > > If you're mirroringã > > between NNTP servers, then I would expect the original messages to haveã > > this Content-Type header field.ã > ã > Unfortunately, that isn't case with all messages.ã > ã > >ã > > Can you check if the original messages (on USENET?) have the Content-Typeã > > header field or not?ã > >ã > The messages that I've had problems with, do not have content-type headers.ããI'm not really sure what to suggest in that case. <shrug>ãã digital man (xbox-live: digitlman)ããSnapple "Real Fact" #36:ãA duck's quack doesn't echo.ãNorco, CA WX: ---.-øF, --% humidity, NaN mph --- wind, --.-- inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Ash-Fox@VERT to
Digital Man on Tue Nov 20 19:14:19 2007
Digital Man wrote:ãã> ã> I'm not really sure what to suggest in that case. <shrug>ã> ããWell after a bit of thinking, I came up with this code, which appears toãwork well. It's a bit of hack though, and I'm not sure if this logic doesãenough to determine a message came from usenet.ãã if(content_type==undefined) {ã //Check that we're not from Fidonetã if(hdr.ftn_area==undefined) {ã //If we don't have a ftn, we're likely not from usenet, needs header.ã if(hdr.ftn_pid==undefined) { content_type_header(); }ã }ã //We're from fidonet, need a header.ã else { content_type_header(); }ã }ã}ããfunction content_type_header()ã{ã /* No content-type specified, so assume IBM code-page 437 (full ex-ASCII)ã*/ã writeln("Content-Type: text/plain; charset=IBM437");ã writeln("Content-Transfer-Encoding: 8bit");ã}ããDo you think I need to add any other checks?ãã~Ash-Foxã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Digital Man@VERT to
Ash-Fox on Tue Nov 20 17:34:47 2007
Re: Re: newsutil.js - contentã By: Ash-Fox to Digital Man on Tue Nov 20 2007 07:14 pmãã > Digital Man wrote:ã > ã > >ã > > I'm not really sure what to suggest in that case. <shrug>ã > >ã > ã > Well after a bit of thinking, I came up with this code, which appears toã > work well. It's a bit of hack though, and I'm not sure if this logic doesã > enough to determine a message came from usenet.ã > ã > if(content_type==undefined) {ã > //Check that we're not from Fidonetã > if(hdr.ftn_area==undefined) {ã > //If we don't have a ftn, we're likely not from usenã > if(hdr.ftn_pid==undefined) { content_type_header(); ã > }ã > //We're from fidonet, need a header.ã > else { content_type_header(); }ã > }ã > }ã > ã > function content_type_header()ã > {ã > /* No content-type specified, so assume IBM code-page 437 (full ex-Aã > */ã > writeln("Content-Type: text/plain; charset=IBM437");ã > writeln("Content-Transfer-Encoding: 8bit");ã > }ã > ã > Do you think I need to add any other checks?ããThe correct way to check if a message came from a network (any network) is toãsee if hdr.from_net_type!=NET_NONE. If you specifically want to see if theãmessage came from the Internet (e.g. USENET), then check ifãhdr.from_net_type==NET_INTERNET.ãã digital man (xbox-live: digitlman)ããSnapple "Real Fact" #72:ãThe average person uses 150 gallons of water per day for personal use.ãNorco, CA WX: ---.-øF, --% humidity, NaN mph --- wind, --.-- inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Ash-Fox@VERT to
Digital Man on Wed Nov 21 04:41:43 2007
Digital Man wrote:ãã> ã> The correct way to check if a message came from a network (any network) isã> to see if hdr.from_net_type!=NET_NONE. If you specifically want to see ifã> the message came from the Internet (e.g. USENET), then check ifã> hdr.from_net_type==NET_INTERNET.ããAh! Much easier and less prone to error.ããThanks for the help, DM.ãã~Ash-Foxã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã