Article View: news.software.readers
Article #262868Re: 40tude find & replace 4 characters before sending message!!!!!!
From: Doyun Jahng
Date: Mon, 10 Sep 2018 03:21
Date: Mon, 10 Sep 2018 03:21
78 lines
3046 bytes
3046 bytes
Response to VanguardLH <V@nguard.LH>
> Damn, happened again. Oh well, uploaded it. Here's a link to it:
>
> https://1drv.ms/t/s!AgmxLZ7PJal8y3rYsl_eR3BPLQ9E
Maybe this work to show full file?
Last line should be "end." if it work.
//Remove PGP signature from newsgroup messages
program OnBeforeSavingMessage;
const pgp_headline='-----BEGIN PGP SIGNED';
const pgp_sig_start='-----BEGIN PGP SIGNATURE-----';
const pgp_sig_end='-----END PGP SIGNATURE-----';
const pgp_sig_fix='- -- ';
const maxint=2147483647;
procedure OnBeforeSavingMessage(var Message: TStringlist; Servername:
string; IsEmail: boolean);
var i,j:integer;
s:string;
begin
if isemail=true then exit;
for i:= 0 to message.count-1 do
begin
if pos(pgp_headline, message.strings[i]) > 0 then
begin
// delete the '...PGP SIGNED...' line
message.delete(i);
// delete the 'Hash: foo' line now at index "i".
message.delete(i-1);
// insert notice
// message.insert(i,'---PGP sig removed---');
end;
if pos(pgp_sig_fix, message.strings[i]) > 0 then
begin
// delete the broken signature delimiter '- -- ' and replace it
with '-- '
message.delete(i);
message.insert(i,'-- ');
// exit the "i" loop
break;
end;
end;
//setup to delete pgp signature
s:=message.text;
//locate start of pgp signature
i:=pos(pgp_sig_start,s);
begin
//find length of pgp signature string
j := i + pos(pgp_sig_end,copy(s, i, maxint));
if j > i then
begin
//delete pgp signature string
delete(s, i, j-i + length(pgp_sig_end) +1);
message.text:=s;
end;
end;
end;
begin
end.
Technical Details
Message-ID:
<pn4o01$f99$1@adenine.netfront.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mailReferences:
<pn1qed$28a6$1@adenine.netfront.net> <1537aq73i3hah.dlg@v.nguard.lh> <pn241i$bot$1@adenine.netfront.net> <1cnxz2t8qh6sh.dlg@v.nguard.lh> <vlqix6ao91mv$.dlg@v.nguard.lh> <1hywcoq7s3f05$.dlg@v.nguard.lh>Show Full Headers
Complete Article Headers
Message-ID: <pn4o01$f99$1@adenine.netfront.net> Subject: Re: 40tude find & replace 4 characters before sending message!!!!!! Date: Mon, 10 Sep 2018 12:21:37 +0900 From: Doyun Jahng <ahngdoyun@tbroad.com> References: <pn1qed$28a6$1@adenine.netfront.net> <1537aq73i3hah.dlg@v.nguard.lh> <pn241i$bot$1@adenine.netfront.net> <1cnxz2t8qh6sh.dlg@v.nguard.lh> <vlqix6ao91mv$.dlg@v.nguard.lh> <1hywcoq7s3f05$.dlg@v.nguard.lh> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail Newsgroups: news.software.readers Organization: Netfront http://www.netfront.net/ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Date: Mon, 10 Sep 2018 03:21:38 -0000 (UTC) Injection-Info: adenine.netfront.net; posting-host="121.165.242.74"; logging-data="15657"; mail-complaints-to="news@netfront.net" User-Agent: 40tude_Dialog/2.0.15.41 X-Received-Bytes: 2984 X-Received-Body-CRC: 2585341192