Ed Allen
2014-02-23 16:14:34 UTC
----- Forwarded message from Jude DaShiell <***@shellworld.net> -----
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 <***@shellworld.net>
----- End forwarded message -----
What initially filled up2 ?
Without it 'cat up2 up3 >up4' becomes a rename.
Ed Allen
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 <***@shellworld.net>
----- End forwarded message -----
What initially filled up2 ?
Without it 'cat up2 up3 >up4' becomes a rename.
Ed Allen