spt.sh script
Jude DaShiell <[email protected]>
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
For any using spamassassin below is a script you can use to automate blacklisting of the undesireables sending spam. I'm sending this to the list since it represents a use of sed and may be useful to others on this list too. cut here. #!/usr/bin/env bash # file: spt.sh - handle today's blacklist entries. cd $HOME grep "^From:" $HOME/mail/probably-spam | cut -d \ -f 1-8 - >up3 sed -i -e 's/^/blacklist-/' up3 echo "adding `wc -l up3` new senders to blacklist" cat up2 up3 >up4 sort up4 | uniq >up5 cp up5 up4 cat up1 up4 >up0 cp up0 .spamassassin/user_prefs rm up3 cp up4 up2 rm up4 jude <[email protected]>