How to send a compressed archive that contains executables so that Google's attachment filter won't reject it

LinuxCompressionTar

Linux Problem Overview


I have a directory that I want to compress to send it by e-mail, I've tried this:

tar -cvf filename.tar.gz directory_to_compress/

But when I try to send it by e-mail, Google says:

filename.tar.gz contains an executable file. For security reasons, Gmail does not allow you to send this type of file.

How to compress a directory into a tar.gz file from command line?

Linux Solutions


Solution 1 - Linux

tar -cvzf filename.tar.gz directory_to_compress/

Most tar commands have a z option to create a gziped version.

Though seems to me the question is how to circumvent Google. I'm not sure if renaming your output file would fool Google, but you could try. I.e.,

tar -cvzf filename.bla directory_to_compress/

and then send the filename.bla - contents will would be a zipped tar, so at the other end it could be retrieved as usual.

Solution 2 - Linux

To bypass google's check, which is what you really want, simply remove the extensions from the file when you send it, and add them back after you download it. For example:

  • tar czvf file.tar.gz directory
  • mv file.tar.gz filetargz
  • [send filetargz via gmail]
  • [download filetargz]
  • [rename filetargz to file.tar.gz and open]

Solution 3 - Linux

Another easy way to circumvent google's check is to use another compression algorithm with tar, like bz2:

tar -cvjf my.tar.bz2 dir/

Note that 'j' (for bz2 compression) is used above instead of 'z' (gzip compression).

Solution 4 - Linux

Try this:

tar -czf my.tar.gz dir/

But are you sure you are not compressing some .exe file or something? Maybe the problem is not with te compression, but with the files you are compressing?

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionslackmartView Question on Stackoverflow
Solution 1 - LinuxLevonView Answer on Stackoverflow
Solution 2 - LinuxAdriano Varoli PiazzaView Answer on Stackoverflow
Solution 3 - Linuxuser3061607View Answer on Stackoverflow
Solution 4 - LinuxdivakaView Answer on Stackoverflow