🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81729

Re: starting external programm when an article is posted

#81729
From: Alexander Bartolich
Date: Fri, 31 Jul 2009 20:33
44 lines
2700 bytes
Michael Vogel schrieb:
> [...]
> But: How can the script fetch the message? All that the script gets is
> some kind of data like @050000000000900000000680000000@

That's the storage token.

> What can I do to fetch the message? The script is written in php.

You can use command line program "sm" to retrieve the message.
For example:

$ grephistory '<4a734fa9$0$30230$9b4e6d93@newsspool1.arcor-online.net>'
@03034249473300000000004F217000000002@

$ sm @03034249473300000000004F217000000002@ | grep ^From
From: Michael Vogel <ike@spamfence.net>

> The newsfeeds looks like this:
>
> newsforum:!*,news.test:Tp:/path/to/file.php %s
>
> Is there any example I could use to see what I have done wrong?

If all else fails, read the manual.

  man newsfeeds

The third field (which you have set to "Tp") is described in section
"FLAG VALUES" of the manual page. Section "FEED TYPES" then gives
additional notes about program feeds.

With a program feed (type "Tp") a new process is spawned for every
incoming message. This is well suited for shell scripts, which then
can use "sm" to retrieve the message.

To get more performance you should choose "Tc" (channel) and use
the "W" flag to select what data you want to read from stdin.

-- 
Brüder, in die Tonne die Freiheit,
Brüder, ein Stoppschild davor.
Egal was die Schwarzen Verlangen
Rufen wir: Ja! Brav im Chor.
Technical Details
Message-ID: <h4vkei$a7g$1@news.albasani.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!newsfeed.straub-nv.de!news.albasani.net!not-for-mail
References: <4a734fa9$0$30230$9b4e6d93@newsspool1.arcor-online.net>

Show Full Headers
Complete Article Headers
Message-ID: <h4vkei$a7g$1@news.albasani.net>
Subject: Re: starting external programm when an article is posted
Date: Fri, 31 Jul 2009 20:33:22 +0000
From: Alexander Bartolich <alexander.bartolich@gmx.at>
References: <4a734fa9$0$30230$9b4e6d93@newsspool1.arcor-online.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!newsfeed.straub-nv.de!news.albasani.net!not-for-mail
Newsgroups: news.software.nntp
Organization: albasani.net
Lines: 44
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.albasani.net
 NtHOmp4p8s+zyrR0k5W2vwyRzTS/WTmMdAgx7a7CJq1gSWZcswg/mz22TWTW1KSgDdTIYp7eSqkRScVI03WYNzS1NId+DboeK67VbROiBh2RI9z+nGh5bHdYLKvTCtQY
X-Complaints-To: abuse@albasani.net
NNTP-Posting-Date: Fri, 31 Jul 2009 20:33:22 +0000 (UTC)
X-User-ID: n48gaUoUGVBHWjrc8JDMo3Z50IWSfT50WEPHkGQPUGrJlczijIaRJUVLYEf6/+YCEGBfBAG6Y8x3Z6OovLGsNg==
Cancel-Lock: sha1:GNC1A9fXuBJt48GQdlOxDl5bIOo=
User-Agent: slrn/0.9.9p1 (Linux)
X-NNTP-Posting-Host: rVLh4a3g+va1VAZ70nFNDBYQtO9t6FujeQVstcALIWc=