Notification improvements

Asked by Sümegi Csaba on 2011-09-16

Hello Dmitry,

may I suggest you two notification improvements?

1) If I have a lot of unread emails, the OSD notifications appearing one by one after login take pretty much time (maybe this could be annoying for others too, not just for me). Would it be possible to tweak it? For example after login just one notification would appear
- containing the sender and the subject of the last three emails and indicating that there are further messages, or just
- containing the text that you have %d unread messages.

2) Would it be possible to play a notification sound (simultaneously with the OSD notification) when a new message arrives? The sound file could be specified within the Preferences.

Thanks and keep it up!

Sümegi Csaba

Question information

English Edit question
Unity Mail Edit question
Dmitry Shachnev Edit question
Solved by:
Dmitry Shachnev
Last query:
Last reply:
Dmitry Shachnev (mitya57) said : #1


Yes, I can tweak it. Since I have many feature requests and little time, I don't promise that I'll do this quickly (:
Also, I prefer bugreports instead of questions for things like this.

Sümegi Csaba (sumegics) said : #2

OK, thanks for the quick answer.

Dmitry Shachnev (mitya57) said : #3

1) - Fix Commited; Now displays "You have %d unread message(s)"

Sümegi Csaba (sumegics) said : #4

Wow, that was really quick.

Just a remark to consider (revising my previous suggestion for the text):
What would you say to "... mail(s)" instead of "... message(s)"?
(See also the formula "New mail from %s" used already.)

Dmitry Shachnev (mitya57) said : #5

I really don't know which is better. For example, english GMail says "Compose Mail" but "Delete message".

Sümegi Csaba (sumegics) said : #6

Yeah, it's not easy.
But I think, I will use mail in the Hungarian translation. :-)

Dmitry Shachnev (mitya57) said : #7

OK, I Google-d :)

"new message" - 5 520 000 000 results
"new mail" - 3 910 000 000 results

So, I'll use "new message", Postler and Evolution use it also.

Dmitry Shachnev (mitya57) said : #8

2) - Now (with today's 0.9.2 release) you can set any command to execute on mail receive.

You can specify that command in "ExecOnReceive" option of the configuration file (just add a "ExecOnArrive=/full/path/to/script" line to "General" section of that file, it is located at ~/.config/unity-mail.conf). Sender and Subject are passed as command-line arguments.

You can create a script that will use "canberra-gtk-play --id=STRING" or "canberra-gtk-play --file=PATH" to play sounds.

Note: This won't be executed on startup/first-time check.

A GUI option will be available later.

Best Dmitry Shachnev (mitya57) said : #9
Sümegi Csaba (sumegics) said : #10

Great news, thanks Mitya!

Sümegi Csaba (sumegics) said : #11

Thanks Dmitry Shachnev, that solved my question.

delca85 (delca85) said : #12

I have followed your advices and I have created a script playing the sound I want. I made it executable and if I double click on it, my system plays the sound. I choose it in Unity-mail to be executed on receive but it doesn't work.

Can you help me?

Dmitry Shachnev (mitya57) said : #13

Can you please launch Unity Mail from the terminal (just enter "unity-mail"), receive a message (for example, send a mail to yourself) and paste here the terminal output (if any)? Then you can use Ctrl+C to exit.

delca85 (delca85) said : #14

Thank for your reply, this is the message I receive: "unity-mail: Command cannot be executed!"

Which could be the reason according to you?

delca85 (delca85) said : #15

If I launch into the terminal the script I made, with ./, it worked!

Dmitry Shachnev (mitya57) said : #16

In my tests, everything works file. Did you set the script manually (in the configuration file) or via the settings dialog?

If this bug exists when you set the script from the settings dialog ("Options" tab), please report a bug about that ( and we'll continue discussion there. Thanks!

delca85 (delca85) said : #17

Sorry for the delay. I have setted the script both in the settings dialog and in the configuration file.

I am going to keep on with the discussion in the link you gave me.
Thank you!

Hi !

I had the same problem, I've selected a script that contains:
canberra-gtk-play --file=newmail.ogg
with newmail.ogg in the same directory as the script. When I launch it with ./, it works fine, but when I received a new mail, nothing happend.
I've remplaced file=newmail.ogg by file=/home/$USER/Musique/newmail.ogg and now it works great !
I wish it could help someone, and I wish that my English isn't too bad...

Thanks for this awesome software (y)

zlatko (zlatko23) said : #19

I can't get the sound to play. I always get this error:

unity-mail: Command cannot be executed:
[Errno 8] Exec format error

I have created various versions of the script, using full paths to player program and file, scripts are executable, I have been trying to use mplayer and canberra-gtk..but can't get it to work. :) All scripts play when executed in terminal. Below is an example of the one-liner:

/usr/bin/mplayer /home/zlatko/misc/beep-8.mp3

Any help with what am I doing wrong?

zlatko (zlatko23) said : #20

Solved it: I haven't added "#!/bin/bash" at the beginning! :)
Sorry for any spam mail I have created!

Dmitry Shachnev (mitya57) said : #21

By the way I have just released Unity Mail 1.3, which has a GUI option to set the sound file. It's uploaded to raring (13.04), but I'll also upload it to PPA for quantal (12.10) in a couple of days.

zlatko (zlatko23) said : #22

As a matter of fact I have another question - how can I get Unity mail to work with multiple accounts? I meaning opening the relevant URLs for new message in either Account1 or Account2? May be having separate processes for each account? With different icons, URLs,a etc.?

Dmitry Shachnev (mitya57) said : #23

This will be in some future version (maybe 2.0) as part of the "message preview" plugin.

zlatko (zlatko23) said : #24

Cool! Thank you for you time ti develop this! :)