Gmail is against sending .exe files in attachments. It also discards script files even if they are compressed. The only well known option is to rename it using a different extension. This is a not an elegant solution but it works.
This is my recent experience with gmail attachments. This incident bugged me up. The mistake I made was I renamed it using .txt extension. So what’s the problem? I had several script files(tcsh) and source files in a tarball. I had to send the tarball to the linux box at college. It was created in linux but I was mailing from windows. Don’t ask me why I didn’t mail from linux. It was for some reason. You could assume I was in windows when the need came and I had the tarball in a fat partition. I renamed it with “.txt” and sent the file. After the download-rename procedure and untarring it, my scripts weren’t working. When I copied the contents of the script to another file, character by character, it worked!! It sounded as though the editor was buggy :P. The interpreter showed that the first line contained the error. I knew it didn’t have any logical or syntax errors since it was working in my system. Usually ascii files add problems when they are moved from one os to another due to line separators (windows uses \r\n and linux uses \n). But this can’t be the problem because both of the systems were using linux. Since there couldn’t be any other reason I tried replacing all line separators using a program and the scripts worked.
Phew! I found out. This could be the possible reason. It was gmail. When I attached the tarball (fake txt file), gmail allowed it because it wasn’t an executable file. But since a text file with line separators of linux and I was mailing from a windows box, it replaced all “\n” by “\r\n”. That’s why my scripts weren’t working. I am still sceptical about this. Although it’s not likely there might have been another reason: Windows automatically converting text files to its convention.
After this incident I used software specific extensions such as(.doc) which cannot be manipulated by gmail. It works!