Proper handling of multiple accounts

Asked by Igor on 2012-12-08

I've configured Unity Mail so it monitors 2 email accounts (say, Gmail and Mail.ru). It correctly notifies me about new messages, but when I click on an unread message it either redirects me to Gmail or does nothing in the case of Mail.ru.

Is there a possibility of configuring Unity Mail so it can handle different redirect pages with the respect to email accounts?

(this was an 'askubuntu' question originally: http://askubuntu.com/questions/226780/unity-mail-handling-multiple-accounts)

Question information

Language:
English Edit question
Status:
Solved
For:
Unity Mail Edit question
Assignee:
Dmitry Shachnev Edit question
Solved by:
Dmitry Shachnev
Solved:
2012-12-12
Last query:
2012-12-12
Last reply:
2012-12-12
Dmitry Shachnev (mitya57) said : #1

Hi Igor,

When you click on an unread message in the Messaging Menu, it shouldn't open anything unless you set up an "Inbox[]" URL. To set it up, do the following:

- open the configuration file (~/.config/unity-mail.conf) in any editor;
- if there is no "[URLs]" section, add it (simply append this line to the file);
- in [URLs] section, add lines like these:

        Inbox[<email address hidden>] = http://mail.google.com/mail/
        Inbox[<email address hidden>] = http://mail.ru/...

    (of course you can use any emails/URLs there). Now it should open the specified URL when you click on the unread message.

Hope this helps.

Igor (ishl) said : #2

Thanks for the explanation!
I've followed these steps, and now my unity-mail.conf contains as follows:

[General]
NotificationsHaveIcons = True
HideMessagesCount = True

[URLs]
Inbox[<email address hidden>] = http://mail.google.com/mail/
Inbox[<email address hidden>] = http://e.mail.ru/

Still, Unity Mail does not redirect anywhere on new mail.ru messages.

Dmitry Shachnev (mitya57) said : #3

Did you replace <email address hidden> with your actual e-mail? :)

Igor (ishl) said : #4

I did:)

Also after deleting unity-mail.conf it continues working as before. Where does Unity Mail store other settings (e.g., passwords, checking timeout)?

Dmitry Shachnev (mitya57) said : #5

> Still, Unity Mail does not redirect anywhere on new mail.ru messages.

- Which Ubuntu/Unity Mail versions do you use (run "apt-cache policy unity-mail")?
- Did you restart unity-mail after you changed the config file (the easiest way to restart it is opening the configuration dialog and closing it)?
- What is your IMAP server? The e-mail checking algorithm will only work if it's "mail.ru" or "imap.mail.ru".
- Do you click on the message itself in the messaging menu, or on the launcher quicklist, or on the "Unity Mail" label?
- Finally, if you run "unity-mail" in the Terminal, then try to click on the message, do you get any terminal output?

> Also after deleting unity-mail.conf it continues working as before. Where does Unity Mail store other settings (e.g., passwords, checking timeout)?

Timeout is stored in the same file if you set it to a value different from default. Passwords are stored in GNOME Keyring.

Igor (ishl) said : #6

My Ubuntu version is 12.10. I've tried using versions from ppa (1.2.3~ppa1) and from Ubuntu repo (1.2.2).
Yes, I restart it the described way (and tried rebooting the computer a couple of times).
Server for Mail.ru is imap.mail.ru (port 993).
I click on the message in the system's indicator-messages.
When I started it in the foreground, after clicking on both Gmail (redirected ok) and Mail.ru (nothing happened) messages, nothing was output to the terminal (this was tested only on the ppa version).

Dmitry Shachnev (mitya57) said : #7

Looks like a bug in unity-mail… Can you please do the following:

1. replace your /usr/share/unity-mail/UnityMail/application.py with this special debug version: http://paste.ubuntu.com/1421623/plain/;
2. open the Terminal, kill the existing process ("pkill -f unity-mail"), then run "unity-mail";
3. click on your mail.ru message;
4. paste the terminal output here?

This would be very helpful. Note that it may print your email, feel free to replace it with ***.

Igor (ishl) said : #8

Here's the output after clicking on the new mail.ru message in the indicator-messages:

DEBUG: on_mm_item_clicked() called
DEBUG: Found corresponding message
DEBUG: get_urlid() called, cn is 1
DEBUG: checking: ('Inbox[<email address hidden>]', 'http://mail.google.com/mail/')
DEBUG: check_email 1 <email address hidden>
DEBUG: <email address hidden> != gmail_username
DEBUG: checking: ('Inbox[<email address hidden>]', 'http://mail.ru/')
DEBUG: check_email 1 <email address hidden>
DEBUG: <email address hidden> != mailru_username
DEBUG: get_urlid returned None

My logins for the gmail and mail.ru accounts are respectively '<email address hidden>' and '<email address hidden>'. When I use just 'mailru_username' as login, it doesn't work at all, and debug version prints:
unity-mail: Connection #0 established
Authentication failed
unity-mail: Invalid account data provided for connection #1; exiting

Dmitry Shachnev (mitya57) said : #9

Thanks for testing, this is now fixed in bzr, I'll also upload the new package to PPA a bit later.

Can you please convert this question to a bug report (https://answers.launchpad.net/unity-mail/+question/216269/+makebug) so that it would be easier to make a stable release update with this fix?

Igor (ishl) said : #10

Can you provide me with the fixed version of the script so I manually replace it for now and wait for the new stable version to release either in ppa or in Ubuntu repository?

Best Dmitry Shachnev (mitya57) said : #11

Uploaded to PPA for 12.10, sorry for the delay.

Igor (ishl) said : #12

Thanks Dmitry Shachnev, that solved my question.