🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #145734

[Dialog] Custom header script

#145734
From: OB1
Date: Sun, 04 Apr 2004 10:56
52 lines
2688 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
Technical Details
Message-ID: <rjrrwiud2oz1$.1edz1fhe3rbho.dlg@40tude.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.ash.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!nntp.giganews.com!newsfeed.cwix.com!ossa.telenet-ops.be!hestia.telenet-ops.be.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <rjrrwiud2oz1$.1edz1fhe3rbho.dlg@40tude.net>
Subject: [Dialog] Custom header script
Date: Sun, 04 Apr 2004 10:56:30 GMT
From: OB1 <OB1@pandora.beLGIUM>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.ash.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!nntp.giganews.com!newsfeed.cwix.com!ossa.telenet-ops.be!hestia.telenet-ops.be.POSTED!not-for-mail
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.10.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Reply-To: OB1@pandora.beLGIUM
Followup-To: news.software.readers
X-Face: 1wWh\l*{><LeE9{2BT6!6<#[7ub\1qHciF(x%Lv\{eJ`!JX]@UB{''Q%7Kc#RH3~M?USMs& sN;
 u#neTF<U7uUo5\<c%mdO*~Wtg"PYkenla7I`V}jDW}J.IIS([8#[19B_08wtC.+<w@O?VYCI
Lines: 52
NNTP-Posting-Host: 213.224.89.237
X-Complaints-To: abuse@telenet.be
X-Trace: hestia.telenet-ops.be 1081076190 213.224.89.237 (Sun,
NNTP-Posting-Date: Sun, 04 Apr 2004 12:56:30 CEST
Organization: Telenet Internet