Pegasus Mail and Gmail — easy!

I want to set up Pegasus Mail (‘PMAIL’) to use Gmail on one of my computers because the computer is a bit old and using a heavy application like Thunderbird or Firefox is a bit slow. The Pegasus Mail setup wizard holds your hand through this, and makes it pretty easy. And I don’t think I needed admin, either.

Downloaded the  Pegasus Mail v4.81 with Gmail OAUTH2 support public beta. Ran the exe file.

Clicked ‘Setuo Info’ and browsed a bit.

From previous experience, if I let it install to C:\PMAIL, it will put my mail in there as well, and anyone else who logs into this box will be able to see my mail, or at least see the folder it is in. So I installed it into:

C:\Users\USERNAME\installs

I do note that this folder path has no spaces in it. I don’t know how PMAIL plays with paths with spaces, but I chose to avoid them.

I don’t want it to deal with ‘mailto:’ links (yet), and I don’t want a desktop shortcut, so I unchecked these options. The Roaming option was not be relevent here.

It ran and the installer exited.

Now, I could run it from the Start menu. I just ran ‘Pegasus mail’ (no admin). The account setup wizard started.

The dialog said:Do you use Gmail…? and gave me a single ‘Gmail’ button to push. I pushed it!

OK!

I put in my Gmail address, did not mess with any defaults, and clicked OK. It then gave me a dialog that told me we were about to ask Google for permission to use Pegasus Mail with Gmail. I clicked Transfer and logged in.

And… a window opened in my browser, taking me to the Gmail sign-in windows and then back to PMAIL.

OK, now I’d rather use IMAP than POP3, so in PMAIL I go Tools > Internet options and Receiving (POP3) and disable that profile. The installer has also created IMAP, and I want to use that in preference. If you are not careful with your settings, POP will download all your email off the server and delete it from the server! There are options to set in PMAIL to prevent that, but IMAP is generally to be preferred anyway. POP was rather designed on the assumption that you’ll only access your email from this computer, using this software, and although the settings let you avoid that assumption, and POP is fine really, IMAP is more modern and is generally to be preferred if available (as I understand it).

Also in Tools > Internet options, I add my email address to the General tab.

Now, I click on the icon of the Earth with an arrow coming out of it.

Nothing.

Restart PMAIL. OK, can I send a mail? Seems I can. OK, maybe I have to enable IMAP explicitly. Duh! When I go Tools > IMAP profiles, I see a ‘Connect’ button. Press that. It is working. I can see in the status bar that PMAIL is grabbing lots of folders, and now they appear in the PMAIL window!

That was easy enough.

Click Done.

Great. Looks excellent. Last step was to pin the PMAIL icon to the taskbar before exiting.

Now, PMAIL has a lot of configuration options, many of which are not available in other software. It works out of the box, but you may want to spend some time hunting around and looking at your other options. Its mail filter is especially powerful.

 

 

 

 

Web browser memory use — some simple tests

Note: System is Debian 11, MATE desktop. Pretty standard install.

The Midori browser shows up on lists of suggestions every time I try to find out about browsers with smaller memory use than, say, Firefox. A couple of quick experiments show that it does use less memory, but that it eats up a fair bit as you open more tabs, but of course it depends what is in the tabs. Here, I am going to look at a real-world example, where I am using the browser as an interface to collaboration tools I use for work. For example, I have got open right now:

  • Confluence
  • Outlook web app light
  • Gmail
  • This WordPress editor

I should point out that all work well and reliably in Midori, though some features seem to work differently (when writing my WordPress post in Midori, the Preview button does not seem to do anything unless I right-click and choose ‘Open in new tab’, but then the preview renders fine). I have not used Midori much since some very early versions (like 0.X type versions), when it used to fall over quite a lot. I do not think it does that any more.

Total memory used (all processes, as shown by mate-system-monitor) is around 1.8 GiB; before I started Midori it was around 0.76 GiB, so we’re looking at about 1 GiB being used by the browser to have the 4 tabs open. That does not seem slim to me. What does Firefox give?

I’ll close Midori down and open the same tabs in Firefox. 1.9 to 2.0 GiB used, spiking to 2.1 GiB at times — but Firefox has loaded the full Outlook web app, not the light one. So the conclusion is that Midori is not, for this real-world case of opening working websites that I use for my job, a lot lighter than Firefox. (Memory leaks might affect this if both were used for hours; I don’t know which is better in that respect.) This is probably because these websites are ‘heavy’, and are basically programs running in the browser — all have editors and other tools built into them, and the browser can do very little to change that. It’s like a box with heavy things in it. Midori is a lighter box, but most of the weight is in the things inside.

How about Gnome Web/Epiphany?

Same sorts of numbers. Up to 2 GiB before I even log into WordPress.

OK, back in Midori. With these 4 tabs open, I am fluctuating between 1.7 and 1.8 GiB. What if we close down Gmail?

  • 1.3 GiB — Gmail is using around 400 to 500 MiB! Quite a lot.

What if we close down Confluence?

  • Another 300 MiB, down to about 1 GiB memory used.

Close down Outlook web app light…

  • No apparent difference (maybe 50 MiB) — I guess it really is light.

What if I do the same thing in Firefox? No Gmail, but other tabs open: 1.6 GiB used. So heavier than Midori but still around 400 MiB better than running Gmail in the browser.

Another very light browser — surf — gave the same results as Midori. You can’t squeeze a quart into a pint bottle.

Conclusion

On a memory-constrained computer, use an email client for Gmail rather than the browser, and consider using Midori or surf (of the ones tested here) as your browser. For example, if I use Alpine to read my Gmail, while I have WordPress, Confluence and Outlook wep app light open in Midori (because the Outlook app is very light and Confluence cannot be accessed without a browser and WordPress must be open for me to write this), total memory use is 1.4 GiB, 400 MiB lighter than when running Gmail in the browser and 600 to 700 MiB lighter than when running Gmail and the same tabs in Firefox.

400 to 700 MiB is a useful amount of RAM, even in 2021.

I don’t use a graphical Gmail client (eg Thunderbird), so I cannot comment on their memory use.

 

YMMVWE

Your mileage may vary wildly and erratically

Export emails from Gmail

You know this, and I am behind the times, but you can in fact export almost anything stored in your Google account using the Takeout interface. It’s just lots of creating and selection categories, then asking it to create a big download for you.

To export selected emails from Gmail, you would hope to just select them by checking the boxes, then find some ‘export’ option. But you can’t. I guess webmail clients do have their limits, and in fact a quick check shows that some other webmail clients I use also do not offer this, or at least not in a transparent way.

To use Google Takeout:

  1. Select messages of interest.
  2. Click Labels and create a label, say Topic-export.
  3. Add that label to any other emails you want to export.
  4. Assuming you are logged into your Google account, go to Google Takeout to take things out of Google: https://takeout.google.com/settings/takeout.
  5. Click Deselect All.
  6. Find Mail in the list of Google content types. Scroll down or search or whatever.
  7. Check the box then click on an oval button that may well say something like All Mail Data Included.
  8. Select the labels you want to export and make sure everything else is not selected.
  9. At bottom of page, click Next Step.
  10. Choose your options — you can set up regular exports if you like.
  11. Click Create New Export.
  12. Download the export.
  13. Unzip it (if it is a zip file) and behold.

Speaking of beholding …

I unzipped the archive and got a folder called Takeout. In the folder is a Mail folder, and a HTML file. In the Mail folder is a single file called Topic-export.mbox.

I double-click the archive_browser.html file. Not much help. How do I actually get at the emails as files in my hard drive? The mbox file is a plain text file in which graphics etc are encoded into text. It can be opened with other mail programs, but what I want is a bunch of files on my computer, not having to go through them using  Thunderbird or whatever, none of which I have installed.

I’d also like to get at the attachments … on Linux… what about https://gist.github.com/georgy7/3a80bce2cd8bf2f9985c?

OK.

  1. Went to that page and copied the Python code into file (extract.py) in the same folder as the Topic-export.mbox.
  2. Edited extract.py to change all.mbox to Topic-export.mbox.
  3. In a command line window, typed: $ python3 ./extract.py.
  4. It created an attachments folder, and within that an inline_images folder, and everything was as it should be!

Brilliant!

But I still don’t have the actual messages.

Some future post. Or of course open the mbox file in Thunderbird, which any sensible person would do.

The wonder.

Gmail: emptying your inbox

The below is all stupid — all I have to do is use the ‘Move to’ button, which is a folder with an arrow to the right.

What I’ve done is go to Gmail settings and change ‘Button labels’ to ‘Text’ so they are not so opaque. I just don’t find their icons useful a lot of the time.

I kind of understand why gmail uses labels — it lets you classify a message as relevant to more than one topic. But because gmail leaves the ‘inbox’ label on everything, the inbox just fills up, even with stuff you’ve labelled and which in a more conventional (and for me intuitive) program would now be in a different folder.

Let’s say I want to find messages in in my inbox, give them all a label and remove the inbox label from them all.

First of all, I have to use standard view because (presumably in an attempt to drive people away fro the basic HTML view), there is no ‘select all’ button in the basic view. Broken by design or what!?

So

  1. Do the search
  2. Select all
  3. Remove any not required
  4. Choose the label icon (sort of luggage tag shape) and either allocate them to an existing label or create a new one; they will now be labelled with the new label and inbox
  5. The hit the archive button (a book with a down arrow on it  — who would guess?) — this  strips off the inbox label (who would guess?)

It’s far from intuitive, at least for old-fashioned me, but it seems to work.

fl

Gmail for older computers and the command line — Alpine

We used to be able to access Gmail from browsers without JavaScript, but that’s no longer the case. So now, if going by browser, I need to install a relatively heavy-duty piece of kit like Firefox or Chrome (heavy compared with say Links or Dillo). But can still get at the email without…

I started by installing Alpine mail reader. On Debian, it’s

$ sudo apt install alpine

I then logged into my Gmail account as usual (ie in Firefox) and went to Settings → Forwarding and POP/IMAP and chose Enable IMAP (IMAP is preferable to POP if I want to use this method on more than one computer — it does a better job of syncing between sessions).

Then clicked on Configuration instructions, opened up Alpine and did what the Google instructions said.

Updated my details as per the gmail website instructions. These websites are also handy:

Compile: http://www.chiark.greenend.org.uk/doc/alpine-doc/tech-notes/installation.html

Save password: https://scienceblogs.com/gregladen/2009/10/08/do-you-want-the-alpine-email-c

But the best guide is at:

https://bcacciaaudio.com/2018/10/09/alpine-mail-setup-with-gmail/

Especially:

Navigate to Setup > Config and check off the following items:

  • Compensate for deficient IMAP servers

  • Combined Folder Display

  • Enable incoming folders collection

  • Enable incoming folders checking

but note that an app-specific password is necessary (or was for me) — this is a 16-letter combination you can generate after logging into your Google account and going to Security (you must have turned on 2-factor authentication, too). Also, unless you want to have to note it down and reenter it multiple times, go to the ‘Save password’ link noted above and turn on Alpine password saving (on Linux, $ touch ~/.pine-passfile). Note that this may be a security issue; the encryption in this file is (apparently) not that strong. I don’t know.

So ran Alpine, went (S)etup and Co(L)lections and (A)dd, then entered:

Nickname : Gmail
Server : imap.gmail.com/ssl/user=first.second@gmail.com
Path :
View :

On hitting ‘Enter’ after the imap line, I was asked for my password. Used the 16-letter app-specific password.

Then, back to the main menu of Alpine and:

(S)etup (C)onfig

Personal Name = <No Value Set: using "Username">
User Domain = gmail.com
SMTP Server (for sending) = smtp.gmail.com:587/tls/user=first.second@gmail.com

See also the Gmail help page — https://support.google.com/mail/answer/7126229.

Also, went to Gmail on the web, and set:

Limit IMAP folders to contain no more than this many messages = 1000

And that allows use of Gmail without JavaScript or even a GUI — no need for X windows, for example. I’m sure other mail clients would work just as well.
screen shot showing the main menu -- Help, Compose, Message Index, Folder List, Address book, Set up and Quit
The Alpine front page
viewing system mail -- three messages
A typical Alpine screen