🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #225027

Re: [Dialog] Scripting help

#225027
From: Sqwertz
Date: Sat, 23 Aug 2008 17:15
39 lines
2796 bytes
"Ted S." <fedya@hughes.spam> wrote:

> Dialog's help for scripting includes the following:
> 
> <snip>
> OnBeforeSendingMessage 
> Called from a worker thread right before a message is sent to a SMTP or
> NNTP server. You could change the contents or formatting of the message
> from within this script. 
> </snip>
> 
> This is something I've been wanting to take advantage of for a while.
> But I can't get even a simple script to work.  I tried:
> 
> <snip>
> if (Subject: packfans)
> function StringReplace( S, User-Agent: 40tude_Dialog/2.0.15.1,
> User-Agent: FavreMail Express, Version 4: string; Flags: TReplaceFlags):
> string; 
> </snip>
> 
> However, I get an error message on trying to run the script about the if
> block.  All I did was to add the if and function blocks between what
> Dialog already had in there.
> 
> I have no idea what to do, and reading Dialog's help page on scripts is
> like reading gibberish.

You're missing the 'begin' and 'end;' block, at the least.  Take a
look at the Dialog script library to get some examples of how other
people have implemented the OnBeforeSendingMessage event.  Scripts
such and changing headers will all rely on OnBeforeSendingMessage.

http://dialog.datalist.org/scripts/script_library.html

Of particular interest would be:
http://dialog.datalist.org/scripts/CustomizeUserAgent.html

-sw
Technical Details
Message-ID: <230808.121520nsr80.75@sqwertz.com>
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!border1.nntp.dca.giganews.com!nntp.giganews.com!news.astraweb.com!border2.newsrouter.astraweb.com!flpi089.ffdc.sbc.com!prodigy.net!flpi088.ffdc.sbc.com!prodigy.com!flpi107.ffdc.sbc.com!flpi146.ffdc.sbc.com.POSTED!666d6152!not-for-mail
References: <yb8v1163a8fo$.dlg@justacineast.motzarella.org>

Show Full Headers
Complete Article Headers
Message-ID: <230808.121520nsr80.75@sqwertz.com>
Subject: Re: [Dialog] Scripting help
Date: Sat, 23 Aug 2008 12:15:20 -0500
From: Sqwertz <swertz@cluemail.compost>
References: <yb8v1163a8fo$.dlg@justacineast.motzarella.org>
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!border1.nntp.dca.giganews.com!nntp.giganews.com!news.astraweb.com!border2.newsrouter.astraweb.com!flpi089.ffdc.sbc.com!prodigy.net!flpi088.ffdc.sbc.com!prodigy.com!flpi107.ffdc.sbc.com!flpi146.ffdc.sbc.com.POSTED!666d6152!not-for-mail
Newsgroups: news.software.readers
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Organization: Me, Myself, and Inc.
X-No-Archive: banter
X-WebTV-Stationery: Standard; BGColor=red;
 Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red
Lines: 39
NNTP-Posting-Host: 75.34.101.135
X-Complaints-To: abuse@prodigy.net
X-Trace: flpi146.ffdc.sbc.com 1219511581 ST000 75.34.101.135 (Sat,
NNTP-Posting-Date: Sat, 23 Aug 2008 13:13:01 EDT
X-UserInfo1: T[OUSV[GPRR[C[H]]RKB_UDAZZ\DPCPDLXUNNHPHBATBTSUBYFWEAE[YJLYPIWKHTFCMZKVMB^[Z^DOBRVVMOSPFHNSYXVDIE@X\BUC@GTSX@DL^GKFFHQCCE\G[JJBMYDYIJCZM@AY]GNGPJD]YNNW\GSX^GSCKHA[]@CCB\[@LATPD\L@J\\PF]VR[QPJN