Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

40-tude Dialog script syntax question

11 views
Skip to first unread message

Henry Jones

unread,
Jul 5, 2016, 6:44:50 AM7/5/16
to
What's the syntax to get 40tude dialog to remove more than 1 header?

This setting removes the Date header generated by the newsreader:
RemoveHeader='Date';

This setting removes the Message-ID header generated by the newsreader:
RemoveHeader='Message-ID';

But I couldn't get both to work at the same time even though the script
implies that it handles multiple headers.

If anyone here understands how to string *multiple* headers in a script,
please let me know what syntax you used!

program OnBeforeSendingMessage;

const
// set the header you want to remove here, e.g. 'User-Agent'

// It always worked if I only put a single header here:
RemoveHeader='Date';

// I could never get multiple headers to work!
// RemoveHeader='User-Agent:,X-Scoring:,X-Hamster-Info:,Date:';
// RemoveHeader='Date:,Message-ID:,User-Agent:';


// remove header from emails and/or postings
// set 'true' or 'false'
// RemoveFromEmails=true;
RemoveFromEmails=false;
RemoveFromNews=true;

procedure RemoveAnyHeader(Message:TStringlist;IsEmail:boolean);
var i:integer;
s:string;
begin
if ((IsEmail=true) and (RemoveFromEmails=true)) or
((IsEmail=false) and (RemoveFromNews=true)) then
begin
s:=Message.text;
while (Message.Strings[i]<>'') and (pos(RemoveHeader,Message.Strings
[i])=0) do
begin
i:=i+1;
if pos(RemoveHeader,Message.Strings[i])<>0 then
begin
delete(s,pos(RemoveHeader,s),length(Message.Strings[i])+2);
end;
end;
message.text:=s;
end;
end;

function OnBeforeSendingMessage(var Message: TStringlist; Servername:
string; IsEmail: boolean):boolean;
begin
RemoveAnyHeader(Message,IsEmail);
result:=true;
end;

begin
end.

John F. Morse

unread,
Jul 5, 2016, 7:13:26 AM7/5/16
to
On 07/05/2016 05:44 AM, Henry Jones wrote:
> What's the syntax to get 40tude dialog to remove more than 1 header?
>
> This setting removes the Date header generated by the newsreader:
> RemoveHeader='Date';
>
> This setting removes the Message-ID header generated by the newsreader:
> RemoveHeader='Message-ID';
>
> But I couldn't get both to work at the same time even though the script
> implies that it handles multiple headers.
>
> If anyone here understands how to string *multiple* headers in a script,
> please let me know what syntax you used!

[Crosspost to alt.os.linux removed]

I don't use 40tude Dialog (nor Windows), so I can't test this, but you might
try using a delimiter, perhaps a comma, between multiple field values.

Example:

RemoveHeader='Date','Message-ID';

A space (or two) may be required next to the comma.


--
John

When a person has -- whether they knew it or not -- already
rejected the Truth, by what means do they discern a lie?

Henry Jones

unread,
Jul 5, 2016, 1:20:02 PM7/5/16
to
On Tue, 5 Jul 2016 06:13:25 -0500, John F. Morse wrote:

> I don't use 40tude Dialog (nor Windows), so I can't test this, but you might
> try using a delimiter, perhaps a comma, between multiple field values.
>
> Example:
>
> RemoveHeader='Date','Message-ID';
>
> A space (or two) may be required next to the comma.

Thank you for your advice of adding either a space or a comma as a
delimiter.

I had tried both to no avail with the initial *.ds script.

What I did, which is successful, is I used a better written script!

I picked up the script on the Internet.

program OnBeforeSendingMessage;
// Date: 2004/11/16
const
// ----------------------------------------------------
// Configuration settings
// ----------------------------------------------------
// Set the header(s) you want to remove here, e.g.,
// Remove_Headers = 'X-Scoring: ,X-Hamster-Info: ';
// Remove_Headers='User-Agent: ,Message-ID: ,Date: ';
Remove_Headers='User-Agent: ,Message-ID: ,Mime-Version: ,Content-Type: ';

// Remove header(s) from emails and/or postings
// Please set only to 'true' or 'false'
RemoveFromEmails = false;
RemoveFromNews = true;

// ----------------------------------------------------
// End of configuration settings
// ----------------------------------------------------
// --------------------------------------------------------------- //
// ---- No user maintainable parts below this line -------------- //
// --------------------------------------------------------------- //
procedure RemoveHeaders ( Message : TStringlist;
IsEmail : boolean
);
var i : integer;
k : integer;
s : string;
CommaPos : integer;
DelHeader : TStringlist;
RemoveH : String;
begin
RemoveH := Remove_Headers;
i := 0;
if ((IsEmail=true) and (RemoveFromEmails=true)) or
((IsEmail=false) and (RemoveFromNews=true)) then begin
If ( RemoveH <> '' ) then begin
try
DelHeader := TStringlist.Create;
if ansipos ( ',', RemoveH) = 0 then begin
DelHeader.Add ( LowerCase ( TrimLeft( RemoveH )));
end // if
else begin
CommaPos := 0;
for k := 1 to length ( RemoveH ) do begin
If RemoveH[k] = ',' then begin
DelHeader.Add ( LowerCase ( TrimLeft (copy ( RemoveH,
CommaPos + 1, k - ( CommaPos + 1 )))));
CommaPos := k;
end; // if
if k = length ( RemoveH ) then
DelHeader.Add ( LowerCase ( TrimLeft (copy ( RemoveH,
CommaPos + 1, k - CommaPos ))));
end; // for
end; // else
s:=Message.text;
while (Message.Strings[i]<>'') do begin
k := 0;
while k <= ( DelHeader.Count - 1 ) do begin
if pos( DelHeader[k], LowerCase ( Message.Strings[i] )) = 1
then begin
delete ( s, pos(DelHeader[k], LowerCase (s) ), length (
Message.Strings[i] ) + 2 );
i := i - 1;
k := DelHeader.Count - 1;
message.text := s;
end; // if
k := k + 1;
end; // while
i := i + 1;
end; //while
message.text:=s;
finally
DelHeader.Free;
end; // try - finally
end; // if
end; // if
end; // RemoveHeaders
function OnBeforeSendingMessage(var Message : TStringlist;
Servername : string;
IsEmail : boolean
):boolean;
begin
RemoveHeaders(Message,IsEmail);
result:=true;
end;
// ----------------------------------------------------------------------
begin
end.

TOSEM

unread,
Jul 5, 2016, 7:01:46 PM7/5/16
to
"John F. Morse" <jo...@example.invalid> wrote;
>On 07/05/2016 05:44 AM, Paul G Derbyshire [aka] Seamus McRae - using
>puppet>Henry Jones wrote:
>> What's the syntax to get 40tude dialog to remove more than 1 header?
>>
//
>
>[Crosspost to alt.os.linux removed]
>
Puuuurleeez -- DNFTT

--
note: attribution line sees a permanent change to better indicate to new
players just whom is the puppet master behind the k00k Show.
"Paula's Downfall - The sock from zoonoses.de gets Pwned"
https://www.youtube.com/watch?v=sdyBYSuqQBQ

TOSEM

unread,
Jul 5, 2016, 7:14:20 PM7/5/16
to
Sqwertz <swe...@cluemail.compost> wrote;
//
>I can't see the original post since it was crossposted and sent
>from a troll server.

indeed

>But if it's the script I'm thinking of, the
>script is entitled "Remove any SINGLE header". In which case simply
>call the script twice without using the const 'RemoveHeader'.
>

you will be asked "how".. bet on it :-/

>Hmm, doesn't look like the script was designed gracefully.

deliberately... :-/


welcome to the YBS[1] club, friend :-}



--
<a.o.l> added
fup set <n.s.r>
[1] Yew Bin Seamused

Henry Jones

unread,
Jul 5, 2016, 10:11:17 PM7/5/16
to
On Tue, 5 Jul 2016 13:06:44 -0500, Sqwertz wrote:

> I can't see the original post since it was crossposted and sent
> from a troll server.

The crosspost was to ask for Pascal programming help, which the linux folks
have, and which the newsserver people might not have. But I respect the
removal and understand it.

> But if it's the script I'm thinking of, the
> script is entitled "Remove any SINGLE header". In which case simply
> call the script twice without using the const 'RemoveHeader'.

That's VERY INTERESTING.
You are clever.
I will test that out since it's kind of logical that it would work to run
the script twice (however, it may just redefine stuff - since it's all
compiled first).

> Hmm, doesn't look like the script was designed gracefully.
The second script I posted is designed better.
The second script actually works with multiple headers!

> You would need to add a third argument - the header string - to the
> function call. Here is my UNTESTED implementation. Note that I am
> Not a object pascal/Delphi programmer. Changes are noted with '**'
> at the beginning of the line - remove those before compilation.
>
> Original script is at:
> http://dialog.datalist.org/scripts/RemoveAnyHeader.html

Thanks for pointing out the script location.
I had googled and didn't find the "official" web site anymore (it seems to
be dead).

Your information (and mine) will help the next person who takes up 40tude
dialog, so it's good to put it into the public record.

What I'm trying to figure out now though, is how to *add* a header!

Henry Jones

unread,
Jul 5, 2016, 10:19:54 PM7/5/16
to
On Wed, 6 Jul 2016 01:19:34 +0800, Henry Jones wrote:

> Remove_Headers='User-Agent: ,Message-ID: ,Mime-Version: ,Content-Type: ';

BTW, is there any hidden unforseen danger in removing the following headers
for ASCII text-only messages?

Remove_Headers='User-Agent: ,Message-ID: ,Mime-Version: ,Content-Type:
,Content-Transfer-Encoding: ';

--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---

Jasen Betts

unread,
Jul 6, 2016, 2:04:40 AM7/6/16
to
On 2016-07-06, Henry Jones <he...@example.com> wrote:
> On Wed, 6 Jul 2016 01:19:34 +0800, Henry Jones wrote:
>
>> Remove_Headers='User-Agent: ,Message-ID: ,Mime-Version: ,Content-Type: ';
>
> BTW, is there any hidden unforseen danger in removing the following headers
> for ASCII text-only messages?
>
> Remove_Headers='User-Agent: ,Message-ID: ,Mime-Version: ,Content-Type:
> ,Content-Transfer-Encoding: ';

User-Agent no problems.

Mime-Version and Content-Type remove only if content-type is text/plain;
else messages may be unreadable.

Content-Transfer-Encoding: so long as this is 7-bit,8-bit,or binary
should be safe to remove.

Message-Id: so long as you you only do this on messages you created

--
This email has not been checked by half-arsed antivirus software

TOSEM

unread,
Jul 6, 2016, 9:55:29 AM7/6/16
to
Paul G Derbyshire [aka] Seamus McRae - using
puppet>Henry Jones <he...@example.com> wrote;
>
>Your information (and mine) will help the next person who takes up 40tude
>dialog, so it's good to put it into the public record.

/rolls eyes

errr.. are you *still* at college level Paul,, seeking "pat on head" from
Teach(r)::----D
>
>What I'm trying to figure out now though, is how to *add* a header!

heh.. get yourself a newsreader dweeb so you can quit fskn with such simple
"on the fly" stuff in trying to make your POS nntp enabled browser
LOOK LIKE a news client.. heh[guffaw]


Henry Jones

unread,
Jul 6, 2016, 1:36:56 PM7/6/16
to
On 6 Jul 2016 05:10:10 GMT, Jasen Betts wrote:

> User-Agent no problems.

Thanks. I probably shouldn't have used the line that I actually use, since
I agree that the User-Agent is unnecessary.

> Mime-Version and Content-Type remove only if content-type is text/plain;
> else messages may be unreadable.

> Message-Id: so long as you you only do this on messages you created

Thanks. Yes, the problem is that if you remove the User-Agent, you have to
also remove the Message-ID because otherwise, the User-Agent creates a
Message-ID containing the name of the user agent.

The only type of messages I send and receive are text using a typical US
keyboard, so I was assuming that this is the case - but I wasn't sure.

I guess if I used umlauts or chinese pictorial characters, then it might
matter - is that so?

> Content-Transfer-Encoding: so long as this is 7-bit,8-bit,or binary
> should be safe to remove.

Why would there be *any* encoding on a text message anyway?


Jasen Betts

unread,
Jul 7, 2016, 3:01:23 AM7/7/16
to
On 2016-07-06, Henry Jones <he...@example.com> wrote:
> On 6 Jul 2016 05:10:10 GMT, Jasen Betts wrote:
>
>> User-Agent no problems.
>
> Thanks. I probably shouldn't have used the line that I actually use, since
> I agree that the User-Agent is unnecessary.
>
>> Mime-Version and Content-Type remove only if content-type is text/plain;
>> else messages may be unreadable.
>
>> Message-Id: so long as you you only do this on messages you created
>
> Thanks. Yes, the problem is that if you remove the User-Agent, you have to
> also remove the Message-ID because otherwise, the User-Agent creates a
> Message-ID containing the name of the user agent.

If these are messages you created not a problem. if these were
authored by someone else you are creating duplicates.

> The only type of messages I send and receive are text using a typical US
> keyboard, so I was assuming that this is the case - but I wasn't sure.

Do you use your keyboard to reply to messages?

> I guess if I used umlauts or chinese pictorial characters, then it might
> matter - is that so?

I think slrn just uses UTF-8 and 8-bit encoding, that's not the only
way to do that.

>> Content-Transfer-Encoding: so long as this is 7-bit,8-bit,or binary
>> should be safe to remove.
>
> Why would there be *any* encoding on a text message anyway?

Some software doesn't do what it SHOULD.


SNOULD is a technical term: (see RFC 2119). You'll find it all through
the RFCs that describe usenet, encoding and the like.

Henry Jones

unread,
Jul 7, 2016, 10:07:28 AM7/7/16
to
On 7 Jul 2016 06:43:46 GMT, Jasen Betts wrote:

>> Thanks. Yes, the problem is that if you remove the User-Agent, you have to
>> also remove the Message-ID because otherwise, the User-Agent creates a
>> Message-ID containing the name of the user agent.
>
> If these are messages you created not a problem. if these were
> authored by someone else you are creating duplicates.

Thanks for the warning; however the headers that are being removed are on
the proto messages, *before* they get to the news server.

It's simply an attempt to have a modicum of control of what gets sent *to*
the newsserver.

There *are* 40tude scripts to remove *incoming* injected messages *from*
the server; but that's not what this discussion is about. Personally, I
don't see any advantage to removing incoming injected-message headers from
the server - since just pressing "H" will hide them.

>> The only type of messages I send and receive are text using a typical US
>> keyboard, so I was assuming that this is the case - but I wasn't sure.
>
> Do you use your keyboard to reply to messages?

I'm not sure why you ask, but, um, yes. I use the keyboard to type
messages. But why would that require a "special" header?

>> I guess if I used umlauts or chinese pictorial characters, then it might
>> matter - is that so?
>
> I think slrn just uses UTF-8 and 8-bit encoding, that's not the only
> way to do that.

I don't see why, for text messages, whatever default the newsserver uses
for those fields (if any), wouldn't suffice.

I see no reason, for a text message in US English (i.e., no special
characters), to bother with putting any of the following in a proto-message
header:
Remove_Headers='Date: ,User-Agent: ,Message-ID: ,Mime-Version:
,Content-Type: ,Content-Transfer-Encoding: ';

But things aren't always as simple as I think they might be.
Hence, I ask.

>>> Content-Transfer-Encoding: so long as this is 7-bit,8-bit,or binary
>>> should be safe to remove.
>>
>> Why would there be *any* encoding on a text message anyway?
>
> Some software doesn't do what it SHOULD.
>
> SNOULD is a technical term: (see RFC 2119). You'll find it all through
> the RFCs that describe usenet, encoding and the like.

I can't imagine why software would "encode" (whatever that really means) a
proto-text-message.

As far as I can tell from experimentation, there are only 3 or 4 required
headers in the proto message:
a. From:
b. Newsgroups:
c. Subject
d. References: (if it's a reply)

My messages seem to do fine sans all those headers in the proto message:
1. Date:
2. User-Agent:
3. Message-ID:
4. Mime-Version:
5. Content-Type:
6. Content-Transfer-Encoding:

My philosophy is why add 6 needlessly unecessary headers if you know you're
sending out text?

Jasen Betts

unread,
Jul 7, 2016, 5:31:27 PM7/7/16
to
On 2016-07-07, Henry Jones <he...@example.com> wrote:
> On 7 Jul 2016 06:43:46 GMT, Jasen Betts wrote:
>
>>> Thanks. Yes, the problem is that if you remove the User-Agent, you have to
>>> also remove the Message-ID because otherwise, the User-Agent creates a
>>> Message-ID containing the name of the user agent.
>>
>> If these are messages you created not a problem. if these were
>> authored by someone else you are creating duplicates.
>
> Thanks for the warning; however the headers that are being removed are on
> the proto messages, *before* they get to the news server.
>
> It's simply an attempt to have a modicum of control of what gets sent *to*
> the newsserver.
>
> There *are* 40tude scripts to remove *incoming* injected messages *from*
> the server; but that's not what this discussion is about. Personally, I
> don't see any advantage to removing incoming injected-message headers from
> the server - since just pressing "H" will hide them.
>
>>> The only type of messages I send and receive are text using a typical US
>>> keyboard, so I was assuming that this is the case - but I wasn't sure.
>>
>> Do you use your keyboard to reply to messages?
>
> I'm not sure why you ask, but, um, yes. I use the keyboard to type
> messages. But why would that require a "special" header?

If the message you are replying to contains non-ascii charaters the
reply may too, not bening able to type those characters (easily) doesn't
mean that all your posts will be free of them ☺

> I can't imagine why software would "encode" (whatever that really means) a
> proto-text-message.

often becase it has further capabilities (eg: mime multipart) and not using
those capabilities is a special case that hasn't been handled well.

> As far as I can tell from experimentation, there are only 3 or 4 required
> headers in the proto message:
> a. From:
> b. Newsgroups:
> c. Subject
> d. References: (if it's a reply)
>
> My messages seem to do fine sans all those headers in the proto message:
> 1. Date:
> 2. User-Agent:
> 3. Message-ID:
> 4. Mime-Version:
> 5. Content-Type:
> 6. Content-Transfer-Encoding:
>
> My philosophy is why add 6 needlessly unecessary headers if you know you're
> sending out text?

probably because it's easier.

TOSEM

unread,
Jul 8, 2016, 6:33:33 AM7/8/16
to
Jasen Betts <ja...@xnet.co.nz> wrote;
>On 2016-07-07, Paul G Derbyshire [aka] Seamus McRae - using
>puppet>Henry Jones <he...@example.com> wrote:
>> On 7 Jul 2016 06:43:46 GMT, Jasen Betts wrote:
>>
>>>> Thanks. Yes, the problem is that if you remove the User-Agent, you have to
>>>> also remove the Message-ID because otherwise, the User-Agent creates a
>>>> Message-ID containing the name of the user agent.
>>>
>>> If these are messages you created not a problem. if these were
>>> authored by someone else you are creating duplicates.
>>
Paul knows this.. has done so before today as a 't00L' to attack
imagined adversaries :-/

as a by the by..?.. all that is being contributed here in <n.s.r> is
redundant when one knows Paul has a working copy of NewsMaestro.
The problem faced by him today is there is no free news server that will
accept the posts. Hence we have this "hunt and peck" info mission in
his search to get around server configs.

It is that simple.


>> Thanks for the warning; however the headers that are being removed are on
>> the proto messages, *before* they get to the news server.
>>
>> It's simply an attempt to have a modicum of control of what gets sent *to*
>> the newsserver.
>>
>> There *are* 40tude scripts to remove *incoming* injected messages *from*
>> the server; but that's not what this discussion is about. Personally, I
>> don't see any advantage to removing incoming injected-message headers from
>> the server - since just pressing "H" will hide them.
>>
>>>> The only type of messages I send and receive are text using a typical US
>>>> keyboard, so I was assuming that this is the case - but I wasn't sure.
>>>
>>> Do you use your keyboard to reply to messages?
>>
>> I'm not sure why you ask, but, um, yes. I use the keyboard to type
>> messages. But why would that require a "special" header?
>
>If the message you are replying to contains non-ascii charaters the
>reply may too, not bening able to type those characters (easily) doesn't
>mean that all your posts will be free of them ?
>
and in fact of actual past practice by Paul this is exactly what has
occurred.
I offer Paul is quite clearly attempting to build a method to 'hide' that
fingerprint of his fuckwittery.

FYI.. Paul is the author/editor of many a script AND well known for
using same to fsk over stable groups who refuse his silliness in posts.
Paul ran "th0lenb0t" in rec.arts.tv/alt.free.newsservers/ and of course
COOA where he stole the concept from. In fact it is notable COOA never
survived that "onslaught"

So, yes... essentially Paul lied in his response to your question. Nothing
at all strange about that, for Paul. Tis pretty much his MO around froups.

>> I can't imagine why software would "encode" (whatever that really means) a
>> proto-text-message.
>
>often becase it has further capabilities (eg: mime multipart) and not using
>those capabilities is a special case that hasn't been handled well.
>
Paul owns no knowledge of binary functions of software in compiling posted
articles of multipart.. and IF he is ever helped with that then yet another
binary spammer is born. That's "binary" in text froups I point to.

hTh(s)


--
<a.f.n> added
fup set <n.s.r>

kensi

unread,
Jul 8, 2016, 12:05:12 PM7/8/16
to
On 08/07/2016 6:33 AM, TOSEM wrote:
> Jasen Betts <ja...@xnet.co.nz> wrote;
>> On 2016-07-07, Henry Jones <he...@example.com> wrote:
>>> On 7 Jul 2016 06:43:46 GMT, Jasen Betts wrote:
>>>>> Thanks. Yes, the problem is that if you remove the User-Agent, you have to
>>>>> also remove the Message-ID because otherwise, the User-Agent creates a
>>>>> Message-ID containing the name of the user agent.
>>>>
>>>> If these are messages you created not a problem. if these were
>>>> authored by someone else you are creating duplicates.
>
> Paul knows this.. has done so before today as a 't00L' to attack
> imagined adversaries :-/

... murphy says, while attacking imagined adversaries.

Keep this up and you'll run out of space on your mantelpiece for
Lodestone Awards, k0oky.

--
"To explain the unknown by the known is a logical procedure; to explain
the known by the unknown is a form of theological lunacy." ~David Brooks
"I get fooled all the time by the constant hosiery parade
in here." ~Checkmate

Nadegda

unread,
Jul 8, 2016, 3:29:11 PM7/8/16
to
On Fri, 08 Jul 2016 12:05:09 -0400, kensi wrote:

> On 08/07/2016 6:33 AM, TOSEM wrote:
>> Jasen Betts <ja...@xnet.co.nz> wrote;
>>> On 2016-07-07, Henry Jones <he...@example.com> wrote:
>>>> On 7 Jul 2016 06:43:46 GMT, Jasen Betts wrote:
>>>>>> Thanks. Yes, the problem is that if you remove the User-Agent, you
>>>>>> have to also remove the Message-ID because otherwise, the
>>>>>> User-Agent creates a Message-ID containing the name of the user
>>>>>> agent.
>>>>>
>>>>> If these are messages you created not a problem. if these were
>>>>> authored by someone else you are creating duplicates.
>>
>> Paul knows this.. has done so before today as a 't00L' to attack
>> imagined adversaries :-/
>
> ... murphy says, while attacking imagined adversaries.
>
> Keep this up and you'll run out of space on your mantelpiece for
> Lodestone Awards, k0oky.

Seems murphy is racking up many self-SPNAKs during his current froth-a-
thon.

<snicker>
0 new messages