Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-06-05 19:10:39

akovia
Member
Registered: 2011-03-27
Posts: 56

Mailwatch & Mailnag

I'm having trouble with the Mailwatch plugin where it crashes and leaves the panel whenever it checks mail. Since it's a plugin, I'm not really sure how to troubleshoot it through the commandline.  I have to re-enter my credentials every time I add it back to the panel instead of it remembering them which is very frustrating. I've never been a big fan of this plugin anyway as it doesn't have all the features I want, but ever since popper stopped being developed I didn't have much of a choice.

I tried to use Mailnag and the notification part works perfectly, but there isn't a tray icon. It says it supposed to be compatible with XFCE, but I have never found a way to get it to work. I filed a bug report back in 2014 and was offered some help in developing the tray indicator, but on my best day I am not a develolper. I can do some basic bash scripting and can hack some code for minor tweaks and that's about it.

So..
1. Can you point me in the right direction to troubleshoot the mailwatch plugin?

and

2. Do you see an easy path to getting mailnag to work xfce?

The dev mentioned..

Someone also created a Cinnamon applet, so creating something similar for XFCE shouldn't be too hard. Maybe you can ask for help/post a request in an appropriate social media community?

Last edited by akovia (2020-06-05 23:39:44)


Arch Linux

Offline

#2 2020-06-06 00:18:50

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,217

Re: Mailwatch & Mailnag

akovia wrote:

1. Can you point me in the right direction to troubleshoot the mailwatch plugin?

Simple approach: kill the panel and start it in debug mode from a terminal. Do the work that causes the crash and look at what is displayed in the terminal. (Also look at log files - ~/.xsession-errors or the journal).

xfce4-panel -q
PANEL_DEBUG=1 xfce4-panel

More complicated approach: rebuild the plugin with debug enabled.

Note that the mailwatch plugin hasn't been updated in a while and has a lot of outstanding bugs.

2. Do you see an easy path to getting mailnag to work xfce?

I had a look at mailnag and if you enable the notification plugins, it will send a notification to indicate when a mail is available. You can look at the xfce4-notificaiton-plugin's log to see what the notification was if you miss it. However, if you're looking for a panel applet, the one you mentioned doesn't work. It needs to be updated to use python3 I believe.

Mailnag does support user scripts, so you could create a script to parse the output and maybe use the genmon plugin to conditionally display a mail icon on the panel.

Is this a GMail mailbox that you are polling? I've written a genmon script to provide such a notification.

Offline

#3 2020-06-06 01:02:24

akovia
Member
Registered: 2011-03-27
Posts: 56

Re: Mailwatch & Mailnag

I will try it in debug mode tomorrow but I doubt I'll rebuild it. Right now I am using a combination of Checkmails as my tray notification, and Mailnag for my notifications. It's just so frustrating when you've had the perfect app for many years and then development stops. I've never been satisfied with mail notifications since Popper died.

ToZ wrote:

Is this a GMail mailbox that you are polling? I've written a genmon script to provide such a notification.

Unfortunately no. Just standard IMAP boxes.

As much as I hate not having a good email notification, I still can't make myself move to gnome. Maybe someone smarter than me will get fed up one day and get a working solution. big_smile

Thanks for looking into this.


Arch Linux

Offline

#4 2020-06-06 12:05:17

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,217

Re: Mailwatch & Mailnag

This looks interesting. Let me see if I can through together a quick genmon script to work with mailnag and display a panel icon.

[Edit]
Okay, so mailnag is an interesting beast. It allows to run userscripts on new mail, and passes a bunch of info about the new emails which is good, but it doesn't execute the script when the mails are cleared. The app does more however, including tracking the number of new emails, but this isn't possible with the userscript functionality.

What you could do, is create an icon on your panel that changes when there is new email. Since there is no check back, this icon would quickly lose its relevance (e.g. it flags a new email is available, you read the email, mailnag sees that the count of new emails drops, but it doesn't signal anything through the userscripts functionality).

To get around this, you could timeout the panel icon after a set amount of time. So basically:
- New email comes in. Mailnag recognizes it. Panel icon changes
- After a set amount of time, the panel icon changes back
* Note, it is not possible to keep the mailbox and panel icon synced using the functionality currently available with Mailnag's user scripts. Perhaps the tray icon functionality would work better.

In case you want to try this, first create two scripts:
1. /path/to/gmailnag

#!/bin/bash
GENMON=10
echo $1 > ~/.cache/gmailnag
xfce4-panel --plugin-event=genmon-$GENMON:refresh:bool:true 
exit 0

2. /path/to/gmailnag2

#!/bin/bash

NEW_EMAIL_ICON="/home/toz/.icons/mail-new.png"
NO_EMAIL_ICON="/home/toz/.icons/mail.png"

[[ -f ~/.cache/gmailnag ]] && NUM=$(cat ~/.cache/gmailnag) || NUM=0
[[ $NUM -gt 0 ]] && ICON=$NEW_EMAIL_ICON || ICON=$NO_EMAIL_ICON

echo "<img>$ICON</img>"
echo "<tool>$NUM New Email(s)</tool>"

echo 0 > ~/.cache/gmailnag

Add a gemon plugin to the panel and get it's ID (hover your mouse over the plugin in Panel Properties > Items tab. It will look something like "genmon-12". In this case, 12 is the ID we are interested in. Edit the "GENMON=" line in the first script to point to this plugin.

In the second script change the "NEW_MAIL_ICON" and "NO_MAIL_ICONS" to point to the icons you want to use.

In mailnag-config, enable the userscripts plugin and point it to the first script.

Finally, right-click the genmon plugin and select Properties and set the command to the second script, uncheck the label and set the Period to the timeout time mentioned above (when you want it to reset).

Kind of complicated for such basic functionality.

Last edited by ToZ (2020-06-06 16:58:05)

Offline

#5 2020-06-06 17:37:01

akovia
Member
Registered: 2011-03-27
Posts: 56

Re: Mailwatch & Mailnag

Wow ToZ,
Thanks for all the trouble. I guess I'll look into all my options now.

I was reporting back that I was able to get the Mailwatch plugin working. The debugging trick didn't help, but I will tuck that away for future reference as I didn't know how to do that. It turns out it was a loose nut behind the Keyboard. (As usual it was user error) I noticed when I was setting it back up after crashing that I had used the "non-standard IMAP port", but forgot to change the "Connection" value to something other than "Use unsecured connection" Now everything is working again.


Here is the output just for reference.

xfce4-panel(module): new item (type=external-wrapper, name=mailwatch, id=10)
xfce4-panel(external): mailwatch-10: child spawned; pid=3308, argc=8
xfce4-panel(application): saving /panels/panel-1: ids=true, providers=false
xfce4-panel(external): mailwatch-10: child is embedded; 6 properties in queue
xfce4-panel(display-layout): 0x55702ac8c880: display=:0.0{comp=true}, screen-0[0x55702a980020]=[3440,1440] (DP-4=[0,0;3440,1440])
xfce4-panel(positioning): 0x55702ac8c880: screen=0x55702a980020, monitors=1, output-name=(null), span-monitors=false, base=18,1060
xfce4-panel(positioning): 0x55702ac8c880: working-area: screen=0x55702a980020, x=0, y=0, w=3440, h=1440
xfce4-panel(struts): 0x55702abfc280: bottom=27, start_x=0, end_x=3439
xfce4-panel(external): mailwatch-10: child exited with status 139
xfce4-panel-Message: 12:54:17.376: Plugin mailwatch-10 has been automatically restarted after crash.
xfce4-panel(external): mailwatch-10: scheduled a respawn of the child
xfce4-panel(external): mailwatch-10: child is unembedded
xfce4-panel(external): mailwatch-10: child spawned; pid=3851, argc=8
xfce4-panel(external): mailwatch-10: child is embedded; 6 properties in queue
xfce4-panel(external): mailwatch-10: child exited with status 139
xfce4-panel(external): mailwatch-10: child is unembedded
ToZ wrote:

it flags a new email is available, you read the email, mailnag sees that the count of new emails drops, but it doesn't signal anything through the userscripts functionality

So after reading this a few times, let me ask this. Does the Mailwatch do this properly, or does it use the same mechanism to just reset the icon after a set amount of time? The more I think about it, using Mailwatch and Mailnag together might be the best solution after all.

Mailwatch covers the tray icon, and it gives something that Checkmails does not. It tells you on hover how many emails and where from which Checkmails did not. Then of course Mailnags does the nice notifications with a blurb of the email and a nice audible ding when mail arrives.

Maybe I was a little to hard on the Mailwatch plugin. One of the things that annoyed me was how many clicks it took to clear the logs icon when I would lose internet. I thought it was a nice way to have a visual cue when internet was down but was more trouble than it's worth. I just decided to turn logging notification off now.

I would love to see a little tray app that would monitor internet activity like M$ has so you can see at a glance when internet is down, and more importantly when it has been restored. Most people don't really need this, but I live on a sandbar in the ocean and our internet is out frequently. Maybe I can come up with something using that GenMon plugin.

Thanks as always. I have a lot to work with now and it's nice to have options.

Cheers!


Arch Linux

Offline

#6 2020-06-06 20:01:25

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,217

Re: Mailwatch & Mailnag

IIRC, mailwatch polls the mail server at regular intervals. If there are "new" emails (not read), then it shows the new-mail icon. However, I don't believe it knew when that status changed (you read the email) so it would only flip the icon on the next poll time.

Mailnag seems to keep some sort of connection so it does know when the status changes, it just doesn't properly indicate this through its userscript functionality.

Note: mailwatch has not yet been ported to GTK3 - so on newer development versions of xfce4-panel, it is no longer recognized and allowed to run (xfce4-panel now only supports GTK3 plugins).

Offline

Board footer

Powered by FluxBB