[ LUGOS ] Sortiranje poste
Metod Kozelj
metod.kozelj na rzs-hm.si
Čet Avg 20 08:59:40 CEST 1998
Howdy!
On Wed, 19 Aug 1998, Ales Horvat wrote:
> To all: Je kdo naredil forward preko procmaila na SMS, tako da poslje le
> maile, ki nimajo dolocenih besed v subj like "[ LUGOS ]" in poslje samo
> from in subj polje?
Uporabi formail. Skripta bi bila nekaj takega:
---->8----
#!/bin/sh
TMP=/tmp/received.message.$$
FORMAIL=/usr/local/bin/formail
cat > ${TMP}
RCVDSUBJECT=`cat ${TMP} | ${FORMAIL} -r -i Subject | grep Subject | head -n 1`
RCVDFROM=`cat ${TMP} | ${FORMAIL} -r -i From | Grep From | head -n 1`
rm -f ${TMP}
SUBJECT="Subject: message from your favourite cartoon director"
/bin/echo "${SUBJECT}\n${RCVDFROM}\n${RCVFSUBJECT}" | ${SENDMAIL} ${SENDMAILFLAGS} GdjeSiMujo na linux.mobitel.si
---->8----
Vrednosti spremenljivk SENDMAIL in SENDMAILFLAGS nastavi ze procmail.
V .procmailrc pa bi imel nekje pri zacetku nekaj takega:
:0 c
* !^Subject:.*[ LUGOS ].*
* !^Subject:.*Another subject to ban.*
* !^From:.*Sender we don't want to bother us.*
* !^From:.*YAL.*
| ${HOME}/send_to_SMS.sh
ce zgornjo skripto poimenujes send_to_SMS.sh. Zgornjo skripto sem sicer
sedajle 'izumil', recept pa deluje v moji 'on-vacation' auto-reply skripti
(ta iz headerjev poisce e-mail, kamor mora poslati odgovor).
Peace!
Mkx
Dodatne informacije o seznamu Starilist