🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
10 messages
10 total messages Started by David Percival Sat, 03 Sep 2005 09:25
[Dialog] Please help with script
#172682
Author: David Percival
Date: Sat, 03 Sep 2005 09:25
12 lines
1452 bytes
I'm not a programmer and I'm really struggling trying to write a script.

I get mail from a private server and the subjects all start with "[name
of mailing list] rest of subject".

Is there any way to write a script to remove just the "[name of mailing
list]" part from the beginning of all the subjects in incoming mail?

Any help much appreciated.

-- 
David.
Re: [Dialog] Please help with script
#172694
Author: Ghost
Date: Sat, 03 Sep 2005 12:31
43 lines
2969 bytes
David Percival ha scritto:

> I get mail from a private server and the subjects all start with "[name
> of mailing list] rest of subject".
> 
> Is there any way to write a script to remove just the "[name of mailing
> list]" part from the beginning of all the subjects in incoming mail?

Hi!
Something like this should fit (remember to edit the NameofList constant!):

program OnBeforeSavingMessage;
const
NameofList = '['+'Type the Name of the List Here'+']';
procedure OnBeforeSavingMessage(var Message: TStringlist;
                                    Servername: string;
                                    IsEmail: boolean);
var
i: integer;
p: Longint;
l: Longint;
Soggetto: string;
begin
 if IsEmail then begin
   i := 0;
   while copy (message[i], 1, 9) <> 'Subject: ' do i := i + 1;
   p := pos (NameofList, message[i]); 
   if p > 0 then begin
            l := Length (message[i]);
            Soggetto := copy (message[i],1,l);
            delete (Soggetto, 10, Length(NameofList));
            message.delete (i);
            message.insert (i, Soggetto);
   end; //end if p
 end; //end if IsEmail
end;
begin
end.
-- 
Bye, Ghost of Lem Novantotto
Informazioni su it.*: http://www.news.nic.it
Archivio news: http://groups.google.it/advanced_search?hl=it
Linee guida della netiquette: http://www.faqs.org/rfcs/rfc1855.html
Re: [Dialog] Please help with script
#172713
Author: David Percival
Date: Sat, 03 Sep 2005 18:16
20 lines
1720 bytes
On Sat, 3 Sep 2005 14:31:44 +0200, Ghost wrote:

> David Percival ha scritto:
> 
>> I get mail from a private server and the subjects all start with "[name
>> of mailing list] rest of subject".
>> 
>> Is there any way to write a script to remove just the "[name of mailing
>> list]" part from the beginning of all the subjects in incoming mail?
> 
> Hi!
> Something like this should fit (remember to edit the NameofList constant!):
[.....]

Thank you very much!  That worked perfectly "straight out of the box".

Regards.

-- 
David.
Re: [Dialog] Please help with script
#172748
Author: Jarrod Cifer
Date: Sun, 04 Sep 2005 08:01
11 lines
1817 bytes
Ghost, upon reaching nirvana, postulated:

[Script for removing mailing list names in subject]

Nice! Do you mind if I put this in the script library?

-- 
J. Cifer
40tude Dialog FAQ: http://snurl.com/4um8
40tude Dialog script library: http://snurl.com/4umc
40tude Dialog links: http://snurl.com/4umg
Re: [Dialog] Please help with script
#172752
Author: Walter Docherty
Date: Sun, 04 Sep 2005 08:34
24 lines
2010 bytes
On Sat, 3 Sep 2005 14:31:44 +0200, Ghost wrote:

> David Percival ha scritto:
> 
>> I get mail from a private server and the subjects all start with "[name
>> of mailing list] rest of subject".
>> 
>> Is there any way to write a script to remove just the "[name of mailing
>> list]" part from the beginning of all the subjects in incoming mail?
> 
> Hi!
> Something like this should fit (remember to edit the NameofList constant!):

I also found this very useful - I tried it on a mailing list which has
"[opensuse]" as the first word of the subject.

It works nicely but there are quite a few posts with "Re: [opensuse]" as
the first words and this just cuts off a part of the string at the
beginning of the subject, leaving "use]"

Is there a way around this problem so that both examples work correctly?

-- 
Walter Docherty.
Re: [Dialog] Please help with script
#172754
Author: Exiddor
Date: Sun, 04 Sep 2005 08:47
33 lines
2563 bytes
On Sun, 04 Sep 2005 08:34:37 GMT, Walter Docherty wrote:

> On Sat, 3 Sep 2005 14:31:44 +0200, Ghost wrote:
> 
>> David Percival ha scritto:
>> 
>>> I get mail from a private server and the subjects all start with "[name
>>> of mailing list] rest of subject".
>>> 
>>> Is there any way to write a script to remove just the "[name of mailing
>>> list]" part from the beginning of all the subjects in incoming mail?
>> 
>> Hi!
>> Something like this should fit (remember to edit the NameofList constant!):
> 
> I also found this very useful - I tried it on a mailing list which has
> "[opensuse]" as the first word of the subject.
> 
> It works nicely but there are quite a few posts with "Re: [opensuse]" as
> the first words and this just cuts off a part of the string at the
> beginning of the subject, leaving "use]"
> 
> Is there a way around this problem so that both examples work correctly?

Better still, a way to insert multiple strings into the script so that,
for example, "List1", "List2", "Re: List1", "Re: List2", etc, etc  could
all be searched for in the Subject so that the script could be used with
multiple mailing lists

I know, we're never satisfied!  :-)

-- 
Exiddor.
Re: [Dialog] Please help with script
#172756
Author: Marcus Mönnig
Date: Sun, 04 Sep 2005 09:06
45 lines
2768 bytes
*Jarrod Cifer*, 4 Sep. 05, 10:01:

> Nice! Do you mind if I put this in the script library?

If you do, please use this slightly modified version which fixes a problem
with emails without a subject header, works with "Re: ..." is a bit more
optimized. 


program OnBeforeSavingMessage;

const NameofList = '['+'Type the Name of the List Here'+']';

procedure OnBeforeSavingMessage(var Message: TStringlist;
                                    Servername: string;
                                    IsEmail: boolean);
var
i,p: integer;
Soggetto: string;
begin
 if IsEmail then begin
   for i:=0 to message.count-1 do begin
   	if copy (message[i], 1, 9)='Subject: ' then begin
		p := pos (NameofList, message[i]); 
   		if p > 0 then begin
            		Soggetto := message[i];
            		delete (Soggetto, p, Length(NameofList));
            		message[i]:=Soggetto;
                end;
		break;   		
   	end
   	else if message[i]='' then break;   
   end;
  end;
end;

begin
end.


Marcus
-- 
No replies in private e-mail, please, unless explicitly requested!
Please log bug reports into Mantis: http://www.40tude.com/dialog/mantis/
Please share your scripts and tips: http://www.40tude.com/dialog/wiki/
Re: [Dialog] Please help with script
#172762
Author: Ghost
Date: Sun, 04 Sep 2005 11:26
13 lines
2153 bytes
Marcus Mönnig ha scritto:

> If you do, please use this slightly modified version which fixes a problem
> with emails without a subject header, works with "Re: ..." is a bit more
> optimized.

Of course, of course.
Thank you very much, and sorry for my bugged version. :)
-- 
Bye, Ghost of Lem Novantotto
Informazioni su it.*: http://www.news.nic.it
Archivio news: http://groups.google.it/advanced_search?hl=it
Linee guida della netiquette: http://www.faqs.org/rfcs/rfc1855.html
Re: [Dialog] Please help with script
#172781
Author: Tarkus
Date: Sun, 04 Sep 2005 18:23
16 lines
2029 bytes
On 9/4/2005 2:06:04 AM, Marcus Mönnig wrote:

> *Jarrod Cifer*, 4 Sep. 05, 10:01:
> 
>> Nice! Do you mind if I put this in the script library?
> 
> If you do, please use this slightly modified version which fixes a
> problem with emails without a subject header, works with "Re: ..." is
> a bit more optimized.

This is cool.  That's one of the things I miss about using Becky as an
email client, as it had that ability built-in.
-- 
"On Your Marks, Get Set, D'Oh!"

Now playing: the radio.
Re: [Dialog] Please help with script
#172795
Author: Jarrod Cifer
Date: Mon, 05 Sep 2005 07:27
14 lines
1838 bytes
Marcus Mönnig, upon reaching nirvana, postulated :

> *Jarrod Cifer*, 4 Sep. 05, 10:01:

>> Nice! Do you mind if I put this in the script library?

> If you do, please use this slightly modified version which fixes a problem
> with emails without a subject header, works with "Re: ..." is a bit more
> optimized. 

Of course. Thanks for the modification.

-- 
J. Cifer
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads