Article View: news.software.readers
Article #60025Re: [slrn/ s-lang] multiple post-hooks addind custom-headers
From: Rejo Zenger
Date: Sun, 02 Apr 2000 00:00
Date: Sun, 02 Apr 2000 00:00
111 lines
4630 bytes
4630 bytes
++ <slrn8ed5rk.2hf.davis@aluche.mit.edu>; John E. Davis:
>>So, what i have now are two separate files, but only one gets executed,
>>although both are sourced. Any idea's what's the best way to deal with
>>this?
>
>There are several possibilites. You could always create a ``master''
>followup hook that does:
[...]
Great! This is almost working perfectly. Almost, as in one way or
another it will add the Message-Id from the previous post again when
adding a new one. :-(
This is what i have now in news/slang/post.sl:
variable signature;
signature = get_variable_value ("signature");
define post_hook ()
{
variable h;
if (0 == (strcmp(current_newsgroup, "nl.newsgroups")))
{
signature = ".signature-nn";
set_string_variable ("signature", signature);
}
[other post_hook's]
}
And this in news/slang/spamtraps.sl:
[comments]
static define spamtraps_post_hook ()
{
variable default_username;
variable default_headers;
variable default_followup_headers;
default_username = get_variable_value ("username");
default_headers = get_variable_value ("custom_headers");
default_followup_headers = get_variable_value ("followup_custom_headers");
set_string_variable ("username", sprintf ("rejo.%df", _time ()));
set_string_variable ("replyto", sprintf ("rejo.%dr%s", _time (), "@sisterray.xs4all.nl"));
variable h;
{
h = default_headers;
h = sprintf ("%s\nMessage-ID: <rejo.%dm%s>", h, _time (), "@sisterray.xs4all.nl");
set_string_variable ("custom_headers", h);
}
if (0 == (strcmp(current_newsgroup, "nl.support.sysadmin")))
{
h = sprintf ("%s\nApproved: <rejo.%da%s>", h, _time (), "@sisterray.xs4all.nl");
set_string_variable ("custom_headers", h);
}
}
add_post_hook (&spamtraps_post_hook);
static define spamtraps_followup_hook ()
[see post_hook]
add_followup_hook (&spamtraps_followup_hook);
And this is what i have in .slrnrc:
$ grep interpret .slrnrc
interpret "news/slang/post.sl"
interpret "news/slang/followup.sl"
interpret "news/slang/spamtraps.sl"
So, what happens is this:
The first message that gets posted gets the correct headers:
Reply-To: rejo.954678191r@sisterray.xs4all.nl
X-PGP-Id: ELG-E/DSS 0x75FC50F3, DSS/DH 0x2C8059B5, RSA 0xFAE40065
X-PGP-Keys: Available at keyserver and website or finger <sister@xs4all.nl>.
X-Spamtrap: For quicker replies please use the email address in my signature.
Message-ID: <rejo.954678191m@sisterray.xs4all.nl>
However, in the next one, the Message-Id (and the Approved field when
needed) field will be doubled. For example:
Message-ID: <rejo.954678191m@sisterray.xs4all.nl>
Approved: <rejo.954678191a@sisterray.xs4all.nl>
Message-ID: <rejo.954678245m@sisterray.xs4all.nl>
Approved: <rejo.954678245a@sisterray.xs4all.nl>
In one way or another, it seems that the buffer no longer gets emptyied.
Any idea? Thanks in advance for your help,
-Rejo.
--
= Rejo Zenger rejo@sisterray.xs4all.nl
= http://mediaport.org/~sister (and my_urls.html) PGP: see headers
--------------------------------------------------------------------------------
Technical Details
Message-ID:
<rejo.954678191m@sisterray.xs4all.nl>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<rejo.954595435m@sisterray.xs4all.nl> <slrn8eciau.bg3.bluemoon@ux6.cso.uiuc.edu> <rejo.954628360m@sisterray.xs4all.nl> <slrn8ed5rk.2hf.davis@aluche.mit.edu>Show Full Headers
Complete Article Headers
Message-ID: <rejo.954678191m@sisterray.xs4all.nl> Subject: Re: [slrn/ s-lang] multiple post-hooks addind custom-headers Date: Sun, 02 Apr 2000 00:00:00 +0000 From: rejo.954678191f@sisterray.xs4all.nl (Rejo Zenger) References: <rejo.954595435m@sisterray.xs4all.nl> <slrn8eciau.bg3.bluemoon@ux6.cso.uiuc.edu> <rejo.954628360m@sisterray.xs4all.nl> <slrn8ed5rk.2hf.davis@aluche.mit.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 605622983 X-PGP-Id: ELG-E/DSS 0x75FC50F3, DSS/DH 0x2C8059B5, RSA 0xFAE40065 X-Spamtrap: For quicker replies please use the email address in my signature. X-Complaints-To: abuse@xs4all.nl X-Trace: news1.xs4all.nl 954679458 12536 194.109.57.59 (2 Apr 2000 12:44:18 GMT) Organization: Sister Ray Zenuwcentrum X-PGP-Keys: Available at keyserver and website or finger <sister@xs4all.nl>. User-Agent: slrn/0.9.6.2 (Linux) Reply-To: rejo.954678191r@sisterray.xs4all.nl NNTP-Posting-Date: 2 Apr 2000 12:44:18 GMT Newsgroups: news.software.readers