Re: [Evolution] Filter problems when running shell command...



On Wed, 2020-05-06 at 13:51 +0200, DrOteonu via evolution-list wrote:
Hi, 

I try to define a filter that executes an external shell script.
However, the result is erratic. Sometimes the shell-script is executed
correctly, sometimes it isn't. Lets say, 25% of the time it runs, 75%
it does not. I have no clue why, it feels like throwing dice.

The script with filename "received_mail_from_john" contains the
following:

(begin script)
espeak "Why am I only read out loud sometimes, and not always?"
(end script)

I also checked the filter log. It always looks good. It states that the
script is called (except that sometimes this does not have any effect):

(begin log)
2020-05-06 13:39:21 - Applied filter "john_mail" to message from john <
john zoho com> - "Re: Andijvie?"
   Info value 'john <johng zoho com>' of header 'From' does match
'john'
   Finished test of message uid:62958 subject:'Re: Andijvie?' from 
'danny ziggo nl : INBOX' as MATCHED
   Filter 'john_mail' matched

Action: Executing shell command: [/bin/sh -c
/home/danny/shellscripts/communication/received_mail_from_john]
(end log)

I have tested this "in vivo" by waiting for emails, and also "in vitro"
by pressing Ctrl-Y. 

The script always works flawlessly when executing it from the command
line.

The log shows that the script is being called, so the problem isn't
with Evolution but with the script itself. I would check that the
script always has access to the right output channel when it's run.
This could fail randomly if Evo calls it asynchronously (via the
filter) but wouldn't fail if being called synchronously (from the
command line). That's just a guess as I don't know how Evo actually
does this.

IOW I think you need to put some logging into the script itself.

poc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]