Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation from source code
Components
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
How To Change the Tab Order of GUI Controls
How To Contribute
How to Create and Open a ".gmail.txt" Archive
How to deal with Git and Gitlab concerning your Project
How to deal with Git and Gitlab for Gambas
How To Deal With Subversion for Gambas
How To Display a Chinese Character
How To Draw with gb.Cairo
How To Enter Data With gb.db.form
How To Get Gambas Web Started (1)
How To Get Started
How To Interface Gambas With External Libraries
How To make a chart with the gb.chart component
How to make a report with Gambas
How To Make KDE Run Gambas Executables Automatically
How To Open, Debug & Compile The IDE
How To Open a MySQL connection and use it
How To Open a SQLite connection and use it
How To Open a Unix ODBC connection and use it
How To Package Gambas
How To Package your Project
How To Print
How to Run Gambas and Gambas Apps on Windows using WSL
How To Run Gambas On Windows using Cygwin
How To Translate A Gambas Project
How To Translate Gambas
How To Translate The Gambas IDE (deprecated)
How To Use Parallel Port
Language Index
Language Overviews
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

How to Create and Open a ".gmail.txt" Archive

As you may know, GMail prevents sending and receiving e-mails with compressed attachments containing certain source code that triggers its "malicious code" filter. For this reason there is a method in the Gambas IDE to compress and uncompress source packages into text (.txt) format.

When we want to create a package like this so as to get past GMail's filters, we create the package as usual Project > Create > Source Package... Except before we click on the OK button, we will have the foresight to check Transform into a ".gmail.txt" archive that fools GMail. After creating the archive in this manner, we can attach the file with confidence knowing that our email should get delivered.

But then how do we open such a transformed file in the IDE?

Do not try to uncompress or unzip the ".gmail.txt" file with a command-line utility such as gzip or tar. It won't work.

We simply use the Select a Project > Open tab window that we get from the menu or the Open Project button (File > Open Project...). Both normally archived files and these special text files appear on the left side of the window. To open the ".gmail.txt" file, just right-click on it and choose Uncompress the file. This operation must be repeated twice: the first turns the text archive into a normal compressed file, the second unzips it so it can be opened in the IDE.

With a few extra steps, this same method can be used when we encounter one of these files attached in the Mailing List archives.

Let's take a practical example with this archived email with an attached special text archive:
https://lists.gambas-basic.org/pipermail/user/2022-January/075136.html

The archive is enclosed within <salt > and </salt> tags. It is necessary to select it all including the tags, copy & paste it into a text editor, and save it with any basename you wish, without spaces, but with an extension of ".tar.gz.gmail.txt". If you do not give it that exact extension, Gambas will not recognize it as a special ".gmail.txt" archive.

Then you can navigate to this file within the IDE and unpack it (twice) as usual.

Working with ".gmail.txt" files with an older version of Gambas

If you do not have a recent version of Gambas, the IDE will not be able to do what is said above. In that case, to unpack the file, use the following shell command on the command line:
S=[filename_to_convert]; D=$(basename $S .gmail.txt); head -n -1 $S | tail -n +2 | base64 -d > $D
Note: Quotations marks around the filename are required if it contains spaces.

There is a utility on the Gambas Software Farm that allows you to both pack and unpack these types of compressed files. Just do a search on the Farm for "gmail-attachment-pipe".