Which email client are you using?

by admin

What can you do for killing time? Maybe you could figure out what email clients your contacts are using. It’s funny.

Most people prefer webmail, especially Gmail. Webmail is very easy to use and does not require much configuration. Gmail is the most wonderful webmail. It groups messages by threads and it has a powerful searching tool. You can easily find out what you want from the mass.

However, one drawback of webmail is that you cannot access your mail off-line. Although Gmail started to support off-line email recently, I still think that keeping the emails in my local storage is safe and reliable. Moreover, an email client is generally much more customizable than webmail. So, I am using Evolution, which is the most powerful and standard email client in Linux, to receive and send email everyday.

As said in the beginning, I want to figure out what email clients my contacts are using. This work is not hard. There might be some fields in the header of email indicating which client this email is generated. The field could be named “X-Mailer”, “X-mailer”, or “User-Agent”. In Evolution, you can open the menu “Edit>Preferences>Mail Preferences>Headers”, and check the “Mailer”. Then you could see the Mailer information in your mails. Some mails are composed without the Mailer information. I don’t know why. We just ignore the mails without Mailer information.

Evolution stores mails in the folder “~/.evolution/mail/local/Inbox.sbd”. Under this folder, the files without extension are the mail files, which included all the contents of your mail. So, we can grab Mailer informations from these files.

First, we can use “grep” to filter the lines containing “X-Mailer”, “X-mailer”, and “User-Agent”. We can store them into a file.

cat mail-box-name | grep X-Mailer > outfile

cat mail-box-name | grep X-mailer >> outfile

cat mail-box-name | grep User-Agent >> outfile

“mail-box-name” is the name of the mail files. Carefully name the outfile. Don’t let it overwrite the existing file. My suggestion is that you can copy all the mail files to another place and do these operations there. It’s safe.

Now we get the outfile containing Mailer information. The next step is removing useless information from this file, such as the header “X-Mailer” or the version information. This is the most boring part. Maybe there are some sophisticated methods which could do this work automatically, but I am lazy to think them up. For me, I use Vim and block-edit the text (ctrl+v, then move cursor), and this work is done without much effort. Now we get the file like this:


Then we should count them. Use this command:

uniq -c inputfile > outputfile

Finally we get the file like this:

84 Evolution
182 Foxmail
1956 G2/1.0

Maybe we need some refinement for these data. For example, remove the very rare entries (e.g < 10), and remove the entries that are obviously web server, such as “ASPMail”, “PHPMail”, etc.

After refinement, there we come to the OpenOffice Spreadsheet for analyzing these data. Again, we use Vim and block-editing to separate the count and client name, and paste them into Spreadsheet individually. Then open “Insert>Chart” and generate your favourite chart.

Following is my data, in which the size of sample is 3003 (after refinement):


From the chart we can see the most popular email client of my contacts is Gmail (G2/1.0). Following are Thunderbird and Foxmail. Then it comes Evolution, Apple Mail, SquirrelMail, Outlook and SFUwebmail.

Which client are you using?