I use webmail for all of my email accounts as I find it much more convenient than setting up a local mail client like Thunderbird. For what seems like forever, I had been using a Firefox Add-On called X-notifier to alert me when I receive new mail. It was a cool little utility that allowed Firefox to regularly notify me of new mail from my various email accounts. User submitted scripts provide compatibility with just about every mail provider out there.
A couple of years ago, Mozilla announced they would be completely redesigning Firefox as well as its Add-On development platform to provide a more secure browser. This meant that Add-Ons which allowed for customization via user scripts would no longer work. In preparation for this change, X-notifier released a new version that stripped this ability and limited its functionality to only a couple major mail providers. I was still able to reinstall an older version of X-notifier and go on my merry way, but I knew it was only a matter of time before I would need to find a new solution altogether.
Well as some of you may have noticed, Mozilla has already released versions of Firefox which no longer support older Add-Ons. This left me scrambling for a new email solution. My prayers were answered in the form of a utility called Mailnag.
There are already a few updated Firefox plugins like the aformentioned X-notifier, which allow you to check major mail providers like Gmail & Yahoo with the latest versions of Firefox. The reason why I prefer Mailnag is that it can be configured to check any IMAP or POP provider and takes the reliance on Firefox completely out of the equation. Mailnag is a standalone service that runs in the background upon login and integrates into the default mail icon in your Linux system tray.
Installing the Mailnag
As most Linux users know, installing packages vary greatly from distro to distro so this section will be limited to installing Mailnag on Ubuntu 17.04. The rest of the guide will be applicable to most distros.
While Mailnag itself is already in the default Ubuntu repositories, the additional Mailnag plugin we want is only in the 3rd party Mailnag repo. We’ll add that in first and then install Mailnag and the plugin together.
Open a terminal and run the following to add the Mailnag repository and complete the installation.
sudo add-apt-repository ppa:pulb/mailnag sudo apt update sudo apt install mailnag mailnag-messagingmenu-plugin
Appease the Mailnag
Now that everything is installed, launch Mailnag via the Unity Launcher, click on the Accounts tab and hit the + button.
Setting up your Gmail account is as easy as selecting Gmail as your Account Type and entering your email address and password. As a bonus, you can even have Mailnag check folders other than your Inbox by clicking on the optional Folders dropdown. This is useful for users who automatically sort their incoming mail into separate folders. There’s nothing wrong with being that meticulous. We should all strive to be that organized…and anal retentive…*cough*.
If you want to setup a different mail provider, go to your provider’s website or contact them for their IMAP or POP server settings. Select Other (IMAP) or Other (POP3) as your Account Type and enter the settings you just looked up. If you’re IMAP provider supports it, make sure Enable Push-IMAP is checked unless you’re checking multiple folders.
The last Mailnag setting we want to change is in the Plugins Tab. Enable the MessagingMenu by clicking the checkbox next to its name. This will allow Mailnag to integrate into the default Unity Mail icon in the system tray.
By default, Mailnag will immediately notify you of new messages as soon as they are received on all IMAP accounts. This isn’t the case if you setup your IMAP account to check multiple folders or if you use a POP3 account. In these scenarios, Mailnag will check for mail every 10 minutes.
Webmail Shortcuts Cuz Convenience
If techs are known for anything, its making their lives as easy as possible. This last section is optional as we already have our webmail notification setup, but it would be a huge PITA (the acronym and not the bread which I love) if everytime we got a mail notification, we were forced to manually launch our browser and then surf to our webmail site. I’m much too lazy for that.
You may have discovered that if you click on the Open Mail Reader link under Mailnag, it launches the default mail client, most likely Thunderbird. Well that kinda defeats the whole purpose of using webmail. To combat this behavior, we’ll need to install another utility called Desktop-Webmail to ease our suffering #FirstWorldProblems.
Launch a terminal and install Desktop-Webmail by doing the following.
sudo apt install desktop-webmail
Launch Desktop-Webmail and you’ll be prompted to choose a Webmail provider. If you use Gmail, Hotmail, Yahoo or Zoho then this will be real easy. If not, just select Gmail and bear with me. Also, make sure to uncheck Ask again so you won’t be prompted to configure Desktop-Webmail again.
Now we’ll make Desktop-Webmail the default mail application for Ubuntu. Open the Unity Launcher search for Details and click the icon.
Select Default Applications from the menu and click the Mail dropdown which should currently be populated with Thunderbird. Select Desktop-Webmail instead and close the window.
Now when you click on Mailnag’s Open Mail Reader link under the system tray mail icon, your default browser will automatically launch, if it’s not already open, and take you directly to your webmail site. Convenience is my BFF.
Shortcuts for the “Alternative” Mail Provider
To the readers who don’t use one of the 5 webmail providers listed above, I haven’t forgotten about you. You’ll need to do one additional step which is manually edit the desktop-webmail.ini file and enter your Mail provider’s webmail URL.
## Original desktop-webmail.ini [Config] remember=true default-provider=Gmail default-url=https://mail.google.com/mail/?extsrc=mailto&url=%s default-inbox=https://mail.google.com/mail ## Updated desktop-webmail.ini [Config] remember=true default-provider=FakeMail ##<-- Change to your Mail Provider Name default-url=https://mail.fakemail.com/webmail ##<-- Change to your Webmail URL default-inbox=https://mail.fakemail.com/webmail ##<-- Change to your Webmail's Inbox URL if different from "default-url"
Mailnag is now setup to launch your mail provider’s webmail site instead of Gmail.
How Do I Open Multiple Sites Genius?
If you have Mailnag setup with multiple mail accounts, you may be wondering how Desktop-Webmail can be setup to launch each one. Well the short answer is it can’t, but as usual I have a workaround for that. This is a solution I’m not proud of and am currently looking for a better method if anyone has one.
If you’re lucky enough to have a provider like Gmail or Zoho that allows the checking of 3rd party POP accounts, you’re going to have to choose one of them to be your “main” account. This account will be used to check all other email accounts which introduces an inherent security risk as now one account has access to all others. I would definitely think twice about attempting this if you intend to check both work and personal emails. There’s also potential space issues as all new mail from your POP accounts will get downloaded to your main account.
With all that being said, if you’d still like to set this up, you’ll need to make sure all email accounts other than the main account has POP3 enabled. You’ll then need to setup your main account to check for mail on your other accounts. Make sure you have each mail providers’ POP3 settings beforehand. If you’re attempting this with Gmail, here’s a Gmail Support Page that walks you through it.
Since all of your emails will now show up in different folders within your main account, you can even pare down your Mailnag config to just your main account and enable it to check each mail folder along with your main Inbox. If you find it too hard to keep track of which email belongs to which account, you can keep Mailnag setup as is with separate accounts. Keep in mind that depending on how often you have your main account checking the other accounts for new mail, you may get notified by Mailnag of new messages before the main account has had time to download them.
So that about wraps it up. This method is by no means perfect, but it does work. If anyone out there has a better alternative or has additional tips to add, feel free to comment below.