procmail
[Top] [All Lists]

Re: remotely add text to a file

2001-08-14 06:17:55
Matt suggested to Luka,

| # add the first line from the body to spam word list
| :0b:$PMDIR/lock
| * ^From: Me <me(_at_)some\(_dot_)address>
| * ^Subject: add to spam list
| | sed -n 1p >>$PMDIR/crap-b.lst
|
| Just an idea, untested..

Looks good; I'd modify it, though, to allow more than one new address per
message and to let sed exit when the lines to be added end.

  # add lines from top of body to spam word list
  :0bi: # let procmail name the local lockfile; `i' to let sed exit early
  * ^From: Me <me(_at_)some\(_dot_)address>
  * ^Subject: add to spam list
  | sed -ne/^$/q -ep >> $PMDIR/crap-b.lst

There is a risk that someone else will fake a message from you to mess with
your word list, but you are just marking such messages and not discarding
them, so no damage could result from that.  Even so, you might want to
consider adding a password to the conditions.



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>