Monday, November 1, 2010

Sending binary files and large attachments over gmail

Here are some handy tools which can be used to send attachments that Gmail will disallow.

The trick for sending binary files is to encode them into ASCII using a program called . Suppose you have a binary file foo that you want to send over Gmail. Then do this

$ uuencode foo foo >foo.uue


The foo.uue contains plain ASCII and can be send over Gmail. The recipient can decode the file using uudecode.

$ uudecode foo.uue


But what is the file is too large (>25MB is too large for gmail). Use the split command to split the file into multiple chunks.

$ split -b 24m foo.uue foo.uue # splits into foo.uueaa, foo.uueab..


The recipient can reassemble using plain-old cat

$ cat foo.uue[a-z][a-z] > foo.uue


and decode using uudecode.