2

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,513
Phil
  • 226

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
  • 226
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