[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] Filtering outgoing news



Simon Waldman wrote:
> 
> Apologies if this is asked often, but I haven't been able to find
> anything through Google and the list archive.
> 
> Is there any way to apply an external filtering script or program to
> outgoing messages?
> 
> The reason for wanting to do this is an attempt to implement the TMDA
> spam filtering system at server level, which needs to change the From:
> line on messages before they are posted...
> 
> One possible method I have seen is to run something each time before
> fetchnews is run, which munges everything in news/out.going... but I
> can't help thinking that there must be a better way!


I use a front end script to do that.
e.g.

$ cat /usr/bin/lfetchnews
#!/bin/sh

res=`ls /var/spool/news/out.going/* 2>/dev/null |wc -l`

if [ $res != 0 ]
then
 echo "$res messages à poster ******"
 nom='<jom1NOSPAM\@voonoo.net>\r'
 echo "L'auteur est: $nom" 
 perl -00 -e "s/^From: .*\r/From: $nom/m" -p -i
/var/spool/news/out.going/*;
 echo $?
fi

 echo "Lancer fetchnews [o/n] [o] ?"
 read answer
 if test "$answer" != "" && test "$answer" != "O"; then exit; fi

echo "** fetchnews **"
exec /opt/sbin/fetchnews "$@"

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list