I found that I often missed seeing the "LAST ONE" e-mail for accounts which were expiring, so I cooked up the following scripts to e-mail me each day with the details of any accounts which had expired that day.
To do this, first create a file ~/.spamgourmetrc, with the following template:
- Code: Select all
USER=yourspamgourmetusername
PASS=yourspamgourmetpassword
Then create the following file. I named it ~/bin/getSpamGourmetXML.
- Code: Select all
#!/bin/bash
. ~/.spamgourmetrc
curl -s -o /dev/null -b ~/.spamgourmetcookies -c ~/.spamgourmetcookies -d user=$USER -d pass=$PASS http://www.spamgourmet.com/disposableemail.pl
curl -s -o ~/spamgourmet.xml -b ~/.spamgourmetcookies -c ~/.spamgourmetcookies "http://www.spamgourmet.com/disposableemail.pl?xml=1"
curl -s -o /dev/null -b ~/.spamgourmetcookies -c ~/.spamgourmetcookies -g -d "logout=log out" http://www.spamgourmet.com/disposableemail.pl
And here's the script which finds your expired addresses:
- Code: Select all
#!/bin/bash
~/bin/getSpamGourmetXML
xml sel -t -m "/DisposableAddresses/DisposableAddress[CountRemaining='0']" \
-v "Word" \
-i 'not(position()=last())' -n -b \
~/spamgourmet.xml > ~/data/SpamGourmetZeroList.tmp
grep -v -f ~/data/SpamGourmetZeroList ~/data/SpamGourmetZeroList.tmp > /dev/null
if [ $? -eq 0 ]; then
unset IF; for i in `grep -v -f ~/data/SpamGourmetZeroList ~/data/SpamGourmetZeroList.tmp`; do if [ "$IF" = "" ]; then IF="Word='$i'"; else IF="$IF or Word='$i'"; fi; done ;
PARAM='/DisposableAddresses/DisposableAddress['$IF']'
(
cat ~/templates/expiredspamgourmet
echo
echo "The following renewable addresses have expired: "
echo
xml sel -t -m "$PARAM" \
-v Word -o " " -v FullAddress -n \
-o " " -v NumForwarded -o " mails forwarded since " -v Created -o " " \
-i "ExclusiveSender!=''" -n -o " Exlusive sender: " -v ExclusiveSender -b \
-i "Note!=''" -n -o " Note: " -v Note -b \
-n -i 'not(position()=last())' -n -b \
~/spamgourmet.xml) | /usr/sbin/sendmail -oi -t
mv ~/data/SpamGourmetZeroList.tmp ~/data/SpamGourmetZeroList
fi
You need to create a ~/data directory, and you also need to have xmlstarlet installed. Download and install xmlstarlet from
http://xmlstar.sourceforge.net/Finally, create a file named ~/templates/expiredspamgourmet
- Code: Select all
From: Spamgourmet Reporter <devnull@mydomain.com>
To: youraddress@mydomain.com
Subject: Expired Spamgourmet addresses
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: SpamGourmet checker by Roshan
Change the 'To', 'From' and 'Subject' fields in the template file to be whatever is suitable.
Set up a cron job which will run once a day. Pick a random time, so not everyone hits the Spamgourmet server at the same time.

My cronjob looks like this:
- Code: Select all
21 6 * * * /home/roshan/bin/SpamGourmetReport
And that's it.
The e-mails you get will look something like this:
- Code: Select all
The following renewable addresses have expired:
milesmore xxx.milesmore.n.yyy@xoxy.net
14 mails forwarded since 2005-08-22 17:43
opodo xxx.opodo.n.yyy@xoxy.net
67 mails forwarded since 2004-12-09 15:27
Exlusive sender: opodo@email.digitalmarketingdirect.com
Hope this helps.
Roshan
http://roshan.info