procmail
[Top] [All Lists]

simple email based newsserver

1995-12-22 19:58:41
-----BEGIN PGP SIGNED MESSAGE-----

Hello,

for some folks that can access email but cannot read news I was trying
to set up a procmail based server that will ping them with overview of
a particular newsgroup or a specific article.  To do it I utilised 

procmail v3.11pre3 1995/05/17 written and created by Stephen R. van den Berg
                                
berg(_at_)pool(_dot_)informatik(_dot_)rwth-aachen(_dot_)de

Locking strategies:     dotlocking, fcntl(), lockf(), flock()
Default rcfile:         $HOME/.procmailrc
System mailbox:         /usr/spool/mail/$LOGNAME

and I tried (say, for overview) the following recipe:

:0
* ^Subject: \[request\] overview
* !^X-Loop: shalunov(_at_)math(_dot_)wisc(_dot_)edu
* !^Subject:.Re:
* !^FROM_DAEMON
{
  :0 fhw
    * ^Subject: \[request\] overview \/[^ ]*
      | formail -rA "X-Loop: shalunov(_at_)math(_dot_)wisc(_dot_)edu"
        
        NEWSGROUP="$MATCH"            # the requested newsgroup
          
          :0 ah
            | (echo group $NEWSGROUP; (echo group $NEWSGROUP; echo quit;\
                                       sleep 2) | \
               telnet news.doit.wisc.edu 119 \
               | awk '{if ($1 == "211") print "xover "$3"-"$4}'; \
               echo quit; sleep 2) | telnet news.doit.wisc.edu 119 \
               | $SENDMAIL -oi -t
}

in hope that when someone sends me message with subject line like

Subject: [request] overview alt.test

procmail will ping him back with overview of the specified nesgroup
(the shell command by itself works ``fine''---modulo sleeps that are
needed because of a bug in nntp: it close()s socket that still has
non-zero sendQ), but when I try to test it, it connects to nntp server
twice, (I suppose) gets something and sends it, but mail is never
delivered.  And each time this recipe is processed, an item is added
to sendmail mail queue of the sort like 

AA12359*  (no control file)

in /usr/lib/sendmail -bp output.  (Here is complete output of this
command---all these ``no control file'' entries are generated by my
pityful attempts to figure out what is the bug here.)

                Mail Queue (17 requests)
- - --QID-- -Size- ----Q-Time----- ------------Sender/Recipient------------
AA13628     82 Wed Dec 20 13:00 eisen
                 Deferred: Host www.soundcity.net is down
                                  netnet(_at_)access1(_dot_)soundcity(_dot_)net
AA12359*  (no control file)
AA12769*  (no control file)
AA12821*  (no control file)
AA14303*  (no control file)
AA12951*  (no control file)
AA13925*  (no control file)
AA08812*  (no control file)
AA13287*  (no control file)
AA13717*  (no control file)
AB08812*  (no control file)
AA13982*  (no control file)
AA08853*  (no control file)
AB08853*  (no control file)
AA14127*  (no control file)
AA14553*  (no control file)
AA14285*  (no control file)

Here I enclose fragment of log file (in verbose mode) produced by
serving this recipe.

procmail: Assigning "INCLUDERC=/ta1/shalunov/.procmail/rc.rules"
procmail: [19426] Fri Dec 22 20:55:46 1995
procmail: Match on "^Subject: \[request\] overview"
procmail: Match on ! "^X-Loop: shalunov(_at_)math(_dot_)wisc(_dot_)edu"
procmail: Match on ! "^Subject:.Re:"
procmail: Match on ! "(^(Precedence:.*(junk|bulk|list)|To: Multiple recipients 
of |(((Resent-)?(From|Sender)|X-Envelope-From):|>?From 
)([^>]*[^((_dot_)%(_at_)a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|mmdf|n?uucp|LIST(SERV|proc)|NETSERV|owner|r(e(quest|sponse)|oot)|bounce|echo|mirror|s(erv(ices?|er)|mtp)|A(dmin(istrator)?|MMGR|utoanswer))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>
         ][^<)]*(\(.*\).*)?)?$([^>]|$)))"
procmail: Assigning "MATCH="
procmail: Matched "alt.test"
procmail: Match on "^Subject: \[request\] overview \/[^ ]*"
procmail: Executing "formail,-rA,X-Loop: 
shalunov(_at_)math(_dot_)wisc(_dot_)edu"
procmail: Assigning "NEWSGROUP=alt.test"
procmail: Executing " (echo group $NEWSGROUP; (echo group $NEWSGROUP; echo 
quit;\
                                       sleep 2) | \
               telnet news.doit.wisc.edu 119 \
               | awk '{if ($1 == "211") print "xover "$3"-"$4}'; \
               echo quit; sleep 2) | telnet news.doit.wisc.edu 119 \
               | $SENDMAIL -oi -t"
procmail: Assigning "LASTFOLDER= (echo group $NEWSGROUP; (echo group 
$NEWSGROUP; echo quit;\
                                       sleep 2) | \
               telnet news.doit.wisc.edu 119 \
               | awk '{if ($1 == "211") print "xover "$3"-"$4}'; \
               echo quit; sleep 2) | telnet news.doit.wisc.edu 119 \
               | $SENDMAIL -oi -t"
 Subject: Re: [request] overview alt.test
  Folder:  (echo group $NEWSGROUP; (echo group $NEWSGROUP; echo quit;\      209
procmail: Notified comsat: "shalunov@: (echo group $NEWSGROUP; (echo group 
$NEWSGROUP; echo quit;\
                                       sleep 2) | \
               telnet news.doit.wisc.edu 119 \
               | awk '{if ($1 == "211") print "xover "$3"-"$4}'; \
               echo quit; sleep 2) | telnet news.doit.wisc.edu 119 \
               | $SENDMAIL -oi -t"
Connection closed by foreign host.
Connection closed by foreign host.

I seem to be completely stuck and would appreciate any clues.  Thank
you very much for your time.

        -- Stanislav Shalunov

URL: http://math.wisc.edu/~shalunov/
PGP key fingerprint =  62 36 7E A3 D4 D0 1D 88  E0 21 F4 0A 0D 93 8E 12 


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.3, an Emacs/PGP interface

iQCVAwUBMNtwNpRUn1EgN49xAQFbBAP+O0ohDX1naJ/vfGuWiBZNSfFe4sQZyexT
LPsNnpXvY5R6/Qktzt1VkQEC4jsrMPza2zoaKUQwOmyTXled+6SNAr4U0NY4PbUP
rQqwBqfM41GTMaeeZEdsUqCHpYina1E45DvcoOn8Qr5etx7l43Vr43gHbfwcFVwM
nrqYzbG5IhA=
=yAg7
-----END PGP SIGNATURE-----

<Prev in Thread] Current Thread [Next in Thread>
  • simple email based newsserver, stanislav shalunov <=