Tag Archives: Email

Exim mail queue cleanup

I wrote before about cleaning up the mail queue. I had a large queue today though and the exim tools “felt” slow. So I did it manually (which wasn’t much faster):
cd /var/spool/exim/input/
for d in *; do echo in $d; cd /var/spool/exim/input/$d; C=0; for x in *H; do grep -q example.com $x; if [ $? -eq 0 ]; then f=${x%H}; (( C++ )); rm ${f}{H,D}; fi; done; echo $C mails deleted; echo "remaining: "; ls -l | wc -l; echo ---; done

Similar Posts:

Tagged , , , , ,

Email Tracking

Most email clients can request a return receipt. One way to set this up in Thunderbird for example is to go to “Preferences > Advanced > General > Return Receipts …” and check the “When sending messages, always request a return receipt”

The problem with this approach is that when the person you’re emailing has set his email client to reject that request (or does that manually every time), you will not get a receipt back. And honestly speaking there is no way to force that. Now there are some services out there that promise to track your mail when that’s read, and those rely on embedding a transparent gif that will call home when the message is opened. I tried a few of these services: the free ones did not deliver (or seemed too shady for my taste) and the paid ones did not look too good either. So I cooked up a quick solution that I can use when needed (like when I’m tracking my brother on his honeymoon trip *evil grin*)

The code is below, pretty self explanatory. You will need a transparent gif/png. That’s easy too 😉

Edit: Looks like some services are not so bad. Checkout bananatag and YesWare Email Tracking

Similar Posts:

Tagged , , , , ,

Easy Mail Sender Authentication Using SPF

There are different wayt to authenticate emails as being legit. One of the easiest to implement is SPF.

Basically what you need to do is add an SPF record to your domain’s DNS zone. But since most DNS control panels do not have this record, you can simply add it as a TXT record.
The OpenSPF site provides the syntax used to identify the resources on your network or otherwise that are allowed to send email on behalf of your domain. But I always find it easier to use a simple form to generate that record. Below are a few helpful sites that offer such a form/wizard:

I know GMail checks the SPF records. Yahoo Mail prefer DKIM. For more info about DKIM and setting that up check this old post by Brandon Checketts.

Similar Posts:

Tagged , , , , ,

Dave’s Notepad

We were chatting in the morning and my colleague Dave said:

echo “blog post about distro choice” | mail -s “blog post” david@mydomain.org
that’s my ‘notepad’. 🙂

I thought that was pretty useful, but tried to make it easier by creating a bash alias. Turns out it’s better to use a bash function instead. (see this note). So my ‘jot’ function is:
function jot() { echo "$1" | mail -s "$2" abdallah@mydomain.com; }

I also noticed, that emails sent from my laptop were not reaching. It seems Ubuntu comes with Exim4 as a default MTA. I’m not too familiar with Exim, so I used the occasion to learn a new trick.

I might use this for micro-blogging next… let me go set it up 🙂

Similar Posts:

Tagged , , , , , , , , ,