Showing posts with label email. Show all posts
Showing posts with label email. Show all posts

Saturday, 17 January 2009

Sending batch mail on Solaris 10 (with attachments)

The typical problem. You have to do a repetitive task and you bless UNIX and its shells. But sometimes you wonder how to do it. This time, I had to write a bunch of emails to a set of email addresses. So far, so good. Solaris and many other UNIX flavors have utilities such as mail and mailx which you can easily do you job with. I usually use mailx to do send emails from scripts and I'm very happy with it.

But today I had to send emails with attachments and mailx has no built in support for them. If you know something about emails standards, you could easily figure out how to do it. Google searches about the topic are full of examples of sending properly formatted mails with mailx, where properly means uuencoding the attachments, concatenating them with the mail message and then send them all piped to mailx. Some examples you can find are even easily scriptable. Reinventing the wheel, more often than not, is not a mean for progress so I decided to go with mutt, a powerful program I always neglected favoring mailx.

mutt has a similar syntax and has built in support for attachments. Its configuration file is a powerful tool to create different sending profiles in which you can, for example:
  • setting user mail identity
  • modify mail headers
  • write and attach hooks to mail events
I haven't spent much too time reading mutt documentation, yet, but it really seems worth the time. Just a one liner (inside an over-simplified loop):

for i in addresses ; do
cat user-message-file | mutt -s subject -a attachment-1 ... attachment-n -- $i
done

Please note that the the option -- is necessary only for separating the addresses from a list of multiple attachments. In the case of just one attachment the line above reduces to:

for i in addresses ; do
cat user-message-file | mutt -s subject -a attachment $i
done

I also had to modify some header and both mutt and muttrc man pages are well written and easy to search. The content of my (first) ~/.muttrc configuration file is:

set realname="myname"
set from=myuser@mydomain.com
set use_from=yes
set use_envelope_from=yes
my_hdr Reply-To: anotheraddress@mydomain.com

This way I told mutt:
  • to set my name
  • to set the From: header
  • to use the From: header
  • to force sendmail to use the same address from the From: header as the envelope address
  • to use a Reply-To: header
Some of these directives have their drawbacks so always follow the golden rule and don't copy and paste these lines without fully documenting yourself: read the manual and enjoy mutt.

Wednesday, 24 October 2007

Google rolls out IMAP support for Gmail

IMAP which stands for Internet Message Access Protocol is an alternate but better method of accessing and managing your email. While this protocol has been around since ever, it was seldom implemented by any of the free web email services mainly because allowing people to access their mail using IMAP put an additional strain on the server.

But IMAP has a lot of advantages over its poorer cousins POP and POP3. For one, like with POP, people using IMAP protocol can also access and manage their mail using any of the numerous email clients such as Thunderbird and outlook express but the difference being that any changes you make to your mail in your email client is propagated to and mirrored in your email account at the server end in real time. Secondly, you can view your mail from multiple devices and still you will have access to the same structure. Mails will not be downloaded multiple times as it sometimes happen in using POP. Overall, IMAP provides a more stable experience than POP.

So the big news is Google has finally rolled out IMAP support for Gmail users. But having been using the web interface with the spify Ajax and Javascript effects, I am in two minds on whether to use IMAP or stick for the time being with the web interface of my Gmail account.

Fig: My Gmail settings show the IMAP in the Forwarding email tab section.

If you are opting for IMAP, there are a few things to keep in mind. Them being the actions you take in your email client and their effects in your Gmail account . Here is a table of what you can expect when you take certain actions in your email client.

Action on mobile device/client (e.g. iPhone/Outlook) Result in Gmail on the web
Open a message Mark a message as read
Flag a message Apply a star to the message
Move a message to a folder Apply a label to the message
Move a message to a folder within a folder Apply a label showing folder hierarchy ('MainFolder/SubFolder')
Create a folder Create a label
Move a message to [Gmail]/Spam Report a message as spam
Move a message to [Gmail]/Trash Move a message to Trash
Send a message Store message in Sent Mail
Delete a message Remove label from the message, or delete the message permanently if the message is already in the Spam or Trash label

[Source: Gmail FAQ]

Lastly I wonder where this puts the other major free email providers like Yahoo and Microsoft's New Hotmail which let alone do not provide IMAP but also fall short on numerous other features which are standard in Gmail. As of now Yahoo is the most used email service in the world but if Google would have its way, this is going to change in the near future.

Wednesday, 30 May 2007

Getting access to gmail accounts of the deceased

Do you have a gmail address ? And do you store sensitive information in your gmail account which you have received from your contacts ? Then you (or rather people close to you such as your family) might be interested in knowing the ways in which someone can gain access to your account in the event of your demise.

You have to follow a number of procedures to eventually gain access to someones gmail account. This article explains what it takes to make google reveal the password of a gmail account not your own.

While this is not strictly related to Linux, I am sure you will find this information useful as I have because, I have an email address at gmail.com.

Tuesday, 27 March 2007

Yahoo mail now provides unlimited storage

My first email id - the very first one I created when I was introduced to the Internet - was a Yahoo mail id. I still remember my mail box had a measly 5 MB storage limit. At that time, Yahoo was the most popular web portal around and also the dominant search engine. Then Google came along and the rest as they say is history.

With Google starting Gmail and providing a humongous 2GB and counting mail storage for each of its users, it as much as literally pulled the rug from under the feet of most heavy weights including Yahoo. While currently Yahoo has reportedly 250 million email users, and is still the leader in size in relation to Google's 50 million, it has to be noted that Gmail was able to get so many users in a significantly short time, that too when it was in the beta stage. And the number of people switching to Gmail is increasing at a rapid rate.

Yahoo eventually did hike the storage limit to 1 GB for all its free users with the paid users getting 2 GB of storage but its email interface couldn't hold a candle to the Gmail interface which most users fell in love with.

I myself switched to Gmail because I found it much more convenient to go through my mail as they were presented in the form of a conversation. And the tagging of mails was a real boon to sort ones mail. Over and above that, Gmail provides free POP3 access which is a paid feature in Yahoo mail.

Yahoo has made a number of mistakes which has helped Google usurp its position and become the leader in search and advertising and a strong competitor in mail and a few other domains.

Now it seems Yahoo is slowly waking up to the ground realities. The latest news is that it has decided to provide unlimited storage space for its mail users which I whole heartedly welcome.

Unlimited as in infinite. You can store any number of elephants if you can some how convert the elephants to its equivalent bytes ;-) .

One thing worth noting is that Yahoo doesn't allow you to convert its mail box into a virtual drive such as is possible with Gmail. Not yet anyway. While Google doesn't say that it allows one to use ones Gmail box as a virtual drive, there are projects such as the xmail hard drive and Gmail drive which makes it easy to use the email id to store your files in Gmail.

And then, Yahoo Mail servers are reportedly being powered by FreeBSD where as Gmail servers use Linux as their OS. I need not tell you which email service will be favored by a person maintaining a Linux blog ;-).

Sunday, 4 March 2007

Email encryption tools for Gmail galore

One of the most useful email encryption programs you can use is PGP (Pretty Good Privacy) or if you are like myself, a Free software supporter then you can use its GPLed counterpart called GnuPG (GPG). But with web mail gaining popularity, most people will find the use of these programs to encrypt or even sign their outgoing emails a chore.

Here is where browser plugins come into the picture. Dimitri Popov at linux.com has written a very useful article where he explains how to use the email encryption Firefox plugin called FireGPG to encrypt all your mails in your Gmail account. While KDE users will be aware of and have used KGPG - the front end tool for GnuPG, FireGPG is different in that, as a plugin, it is well integrated with your Firefox web browser and so you need not go outside your Gmail web interface to encrypt, decrypt or sign your mail. It can be done on the fly.

While on this topic of email encryption, I also came across a couple of projects which allow encryption of messages - not preferably emails. They are as follows :

Pidgin-Encryption - It transparently encrypts your instant messages with RSA encryption. It is Easy-to-use, but very secure. Pidgin (aka Gaim) is an instant messenger client for Linux which is used to connect to Yahoo messenger, Microsoft Messenger, AOL talk and many other instant messaging protocols.

OTR - Short for Off The Record messaging allows you to have private messaging using instant messaging and provides the following features - encryption of messages, authentication and deniability. It is also a pidgin plugin.

Gmail S/MIME is another project which provides Firefox users with S/MIME support for Gmail. S/MIME stands for Secure Multi purpose Internet Mail Extensions. S/MIME support is integrated directly into Google's Gmail web interface. It supports reading and sending of encrypted mail.

Lastly, check out this online javascript solution which encrypts and de-crypts your messages using a uniquely generated RSA private key. This project has been developed by the students of Stanford University.