1

Problem

I would like mailto: links to use my second Gmail account (.../mail/u/1) instead of my primary account to send emails by default. Ideally I would not like to change the order my accounts are logged in as, because I use my primary account for search history, maps, etc. Typically, though, I use my second account (work account) for email.

I'm using Firefox 38.0/Firefox for Ubuntu canonical 1.0 on Ubuntu Trusty (14.04).

I've tried...

I've searched both SU and the web generally and found plenty of mentions of using Gmail as the default app for mailto. I've got this working, so this is not my issue.

I've tried opening about:config and editing gecko.handlerService.schemes.mailto.1.uriTemplate from:

https://mail.google.com/mail?extsrc=mailto&url=%s

to

https://mail.google.com/mail/u/1?extsrc=mailto&url=%s

I've done this, closed Firefox and restarted, and tried a URL but even with this value saved Gmail uses my default account.

I have searched for an answer to my issue and I've read the help files!

Does anyone know if there's a way to achieve this without changing the order of logins?

Dave
  • 25,297
  • 10
  • 57
  • 69
Phil
  • 216
  • 1
  • 5
  • I could not get @phil solution (editing mimetTypes.rdf) to work on 68.0.2. However, edititing the handlers.json with the same code did the trick! – reboot Sep 08 '19 at 17:24

2 Answers2

2

Thanks to @DanCornilescu for his suggestion which got me started along these lines.

I noticed that changes I made in about:config to `gecko.handlerService.schemes.mailto.1.uriTemplate' were not affecting the 'Application details' in Preferences > Applications > Mailto.

After a bit of digging I found that application preferences are set in mimeTypes.rdf in the Firefox profile. To change it:

  1. Open your profile folder by opening about:support in a new tab.
  2. Under 'Profile directory' click 'Open directory'
  3. Close Firefox
  4. Create a backup of mimeTypes.rdf. I just copied a version to my desktop in case. If you follow this steps without a backup and screw up, don't blame me.
  5. Edit mimeTypes.rdf in a plain text editor like Notepad++ or gedit.
  6. Search for the offending mailto item. I simply did a find for 'mail.google.com' and found the appropriate uriTemplate listing
  7. Edit the URL here. You can add https://mail.google.com/mail/u/?authuser=me@gmail.com&extsrc=mailto&url=%s or https://mail.google.com/mail/u/1?extsrc=mailto&url=%s Both also worked for a Google Apps email address (i.e. a gmail account without the .gmail.com domain)
  8. Save the mimeTypes.rdf file and reload Firefox.

mailto: links should now use your second gmail account by default.

Phil
  • 216
  • 1
  • 5
  • Thanks, I was looking around how to open an email with a particular gmail account, this is the only (or first) place I found the authuser param. Very useful – standup75 Feb 02 '16 at 16:52
1

Try to add authuser=account2@gmail.com to the url's parameters. Seems to be working for reading email according to the selected A to this Q:

https://webapps.stackexchange.com/questions/18959/can-i-form-a-direct-url-to-a-particular-gmail-account

Dan Cornilescu
  • 822
  • 4
  • 9
  • Thanks for your suggestion. This didn't work when changing the value in `about:config` but I was able to use it in `mimeTypes.rdf` (see my answer) – Phil Jun 05 '15 at 15:29