🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
2 messages
2 total messages Started by OB1 Sun, 04 Apr 2004 10:52
Custom header script
#145735
Author: OB1
Date: Sun, 04 Apr 2004 10:52
52 lines
2644 bytes
For all those interested, i have made (well sort of) a script to insert any
custom header in your message.
I use it to insert a 'Distribution:' header into messages to some groups on
my isp's server that require it.

To be honest: i just adapted the 'remove any header' script by Andreas Loch
i found in Wiki, to remove the first two characters from any header,
thereby making it possible to add your header by simply creating a custom
X-header in Dialog, and removing the 'X-' with the script on sending.

<code>
program OnBeforeSendingMessage;
// This script removes the 'X-' from an X-header, converting it into a
custom normal header
// Create the X-header in Dialogs Settings -
Server/Identities/Signatures... menu
const
// set the X-header you want to convert 
    ConvertHeader='X-Distribution';

procedure ConvertXHeader(Message:TStringlist);
var i:integer;
    s:string;
begin
  s:=Message.text;
    while (Message.Strings[i]<>'') and
(pos(ConvertHeader,Message.Strings[i])=0) do
    begin
      i:=i+1;
      if pos(ConvertHeader,Message.Strings[i])<>0 then
      begin
        delete(s,pos(ConvertHeader,s),2);
      end;
    end;
  message.text:=s;
end;

function OnBeforeSendingMessage(var Message: TStringlist; Servername:
string; IsEmail: boolean):boolean;
begin
  if IsEmail then exit;
  ConvertXHeader(Message);
  result:=true;
end;

begin
end.

</code>

-- 
OB1
Re: Custom header script
#145755
Author: Hans Euler
Date: Sun, 04 Apr 2004 18:53
56 lines
2568 bytes
OB1 <OB1@pandora.beLGIUM> wrote in
news:csrs7wmzuk31.2xpx4igdao38$.dlg@40tude.net: 

> For all those interested, i have made (well sort of) a script to
> insert any custom header in your message.
> I use it to insert a 'Distribution:' header into messages to some
> groups on my isp's server that require it.
> 
> To be honest: i just adapted the 'remove any header' script by Andreas
> Loch i found in Wiki, to remove the first two characters from any
> header, thereby making it possible to add your header by simply
> creating a custom X-header in Dialog, and removing the 'X-' with the
> script on sending. 
> 
> <code>
> program OnBeforeSendingMessage;
> // This script removes the 'X-' from an X-header, converting it into a
> custom normal header
> // Create the X-header in Dialogs Settings -
> Server/Identities/Signatures... menu
> const
> // set the X-header you want to convert 
>     ConvertHeader='X-Distribution';
> 
> procedure ConvertXHeader(Message:TStringlist);
> var i:integer;
>     s:string;
> begin
>   s:=Message.text;
>     while (Message.Strings[i]<>'') and
> (pos(ConvertHeader,Message.Strings[i])=0) do
>     begin
>       i:=i+1;
>       if pos(ConvertHeader,Message.Strings[i])<>0 then
>       begin
>         delete(s,pos(ConvertHeader,s),2);
>       end;
>     end;
>   message.text:=s;
> end;
> 
> function OnBeforeSendingMessage(var Message: TStringlist; Servername:
> string; IsEmail: boolean):boolean;
> begin
>   if IsEmail then exit;
>   ConvertXHeader(Message);
>   result:=true;
> end;
> 
> begin
> end.
> 
> </code>
> 

I'll try it.
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