On Sun, 26 Jan 2003, Ulrich Wiederhold wrote: > ich möchte gerne per Tastenkombination aus mutt heraus den Absender > einer SPAM-Email, die nicht gefiltert wurde, mit blacklist_from in > .spamassassine/user_prefs eintragen. > > Hat jemand da schon eine (einfache) Lösung? Wenn möglich würde ich das > gerne auf die .muttrc begrenzen. Zur Zeit nutze ich die Lösung aus der > FAQ, die die Emailadressen in eine Datei einträgt und dann mit formail > bzw. procmail filtert. Ich habe das so gelösst: % # Some nice macros to catch spammer adresses % macro index <F8> "|spamassassin -R -r\n \ % |grep "^^From:" |sed -e 's/ *(.*)//; s/>.*//; s/.*[:<] *//; \ % s/\\(.*\\)/blacklist_from \\1/' \ % >> ~/.spamassassin/blacklist.tmp && echo Added sender to \ % blacklist\n \ % !/home/markus/bin/update-blacklist.sh\nd" "Add sender to \ % blacklist and send a report to razor" % % macro pager <F8> "|spamassassin -R -r\n \ % |grep "^^From:" |sed -e 's/ *(.*)//; s/>.*//; s/.*[:<] *//; \ % s/\\(.*\\)/blacklist_from \\1/' \ % >> ~/.spamassassin/blacklist.tmp && echo Added sender to \ % blacklist\n \ % !/home/markus/bin/update-blacklist.sh\nd" "Add sender to \ % blacklist and send a report to razor" % % macro index <F7> "|spamassassin -W\n \ % |spamassassin -d | /usr/bin/formail -s /usr/bin/procmail \ % ~/.procmailrc-nospam\nd" \ % "Add sender to whitelist and remove SpamAssassin markup" % % macro pager <F7> "|spamassassin -W\n \ % |spamassassin -d | /usr/bin/formail -s /usr/bin/procmail \ % ~/.procmailrc-nospam\nd" \ % "Add sender to whitelist and remove SpamAssassin markup" Das "update-blacklist.sh" Script sortiert nach hinzufügen einer Adresse in die blacklist.tmp alle doppelten Einträge raus und hängt die formatieren Einträge an die user_prefs dran. Außerdem benutze ich noch eine zweite procmailrc (procmailrc-nospam) damit die FalsePositives nicht nochmal durch den Spamfilter gehen. Gruß, Markus -- . -- . .' ,-. `. ;_,' ( ; -* Bewahre die Wahrheit *- `. ``;' ` -- ' [http://www.namwahpai-kungfu.de]
#!/bin/sh TMP="/home/markus/.spamassassin/blacklist.tmp" NEW="/home/markus/.spamassassin/blacklist.new" LIST="/home/markus/.spamassassin/blacklist" USER_PREFS="/home/markus/.spamassassin/user_prefs" USER_PREFS_TMP="/home/markus/.spamassassin/user_prefs.tmp" if [ -f $TMP ]; then sort -u $LIST $TMP -o $NEW mv -b -f $NEW $LIST rm -r -f $TMP chmod 0600 ~/.spamassassin/* if [ -f $USER_PREFS_TMP ]; then rm -b -f $USER_PREFS_TMP fi egrep -v ^blacklist_from $USER_PREFS >> $USER_PREFS_TMP cat $LIST >> $USER_PREFS_TMP mv -b -f $USER_PREFS_TMP $USER_PREFS fi # <<EOF>>
Attachment:
pgpGQIYvoD0jF.pgp
Description: PGP signature