postfix sms notifikacia
Marian Cerny
jojo at matfyz.cz
Fri Sep 5 15:53:18 CEST 2008
On 2008-09-05 12:37 +0200, Ciernik Tomas wrote:
> Ak som dobre pochopil manual, tak odovzdanie mailu tomu skriptu by mohlo
> fungovat prostrednictvom pipe.
>
> Lenze tu vidim problem, ze tento skript by musel odovzdany mail bud
> ulozit kam treba, alebo ho nejakym sposobom vratit inej instancii
> postfixu, ktora ho doruci. Ako urobit toto, nemam ani sajnu.
Kedze to teda nejde cez procmail, tak by to mohlo ist podobne, ako sa
filtruje spam. Konkretne ja to mam nastavene tak, ze vsetok mail z vonku
prechadza cez skript spamcheck (pomocou pipe). Ten skript ten mail vlozi
opet do fronty cez sendmail. V pripade, ak to je spam, tak to vlozi cez
sendmail, ale na adresu spambasket at .
Moj skript vyzera nasledovne:
-----------------------------------------------------------
#!/bin/sh
# Simple shell-based filter. It is meant to be invoked as follows:
# /path/to/script -f sender recipients...
SPOOL_DIR=/var/spool/filter
SENDMAIL="/usr/sbin/sendmail -G -i"
SPAMC=/usr/local/bin/spamc
# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
# Clean up when done or when aborting.
trap "rm -f $SPOOL_DIR/in.$$" 0 1 2 3 15
cat | $SPAMC -E > $SPOOL_DIR/in.$$
if [ $? = 1 ]
then
# This message is spam
$SENDMAIL spambasket < $SPOOL_DIR/in.$$
else
$SENDMAIL "$@" < $SPOOL_DIR/in.$$
fi
rm -f $SPOOL_DIR/in.$$
exit $?
-----------------------------------------------------------
v main.cf potom mam:
smtpd_recipient_restrictions =
check_recipient_access hash:/usr/local/etc/postfix/filtered_domains
filtered_domains vyzera takto:
########################################################
# Don't forget to run 'postmap filtered_domains' upon change.
########################################################
example.com FILTER filter:dummy
A este mam v master.cf
# spam filter
filter unix - n n - 2 pipe
flags=Rq user=filter argv=/usr/local/bin/spamcheck -f ${sender} -- ${recipient}
retry unix - - n - - error
Myslim, ze by sa to malo dat na to nasrubovat. Ale ci neexistuje nieco
lepsie, to neviem.
Marian
More information about the Users-l
mailing list