Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 976
slackmart Avatar asked May 25 '12 15:05

slackmart


People also ask

Can you email a tar file?

A tar 'ed file is a binary file. And as such, it loses bits and pieces if you send it through e-mail as a body text. Send it using `attachment'. When you compose a message, you will see `Attachment' in the header.


2 Answers

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.

like image 88
Levon Avatar answered Sep 28 '22 19:09

Levon


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]
like image 30
Adriano Varoli Piazza Avatar answered Sep 28 '22 19:09

Adriano Varoli Piazza