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

2020-05-11 Thread Milan Crha via evolution-list
On Fri, 2020-05-08 at 17:51 +0100, Patrick O'Callaghan wrote:
> > do you know who would know this in detail? Executing external
> > scripts is a crucial feature for me.
> 
> Milan would know, or any of the developers.

Hi,
there is nothing for further diagnoses.

I gave it a try and I can reproduce it too. The first script execution
succeeded, the following failed. I added some error checking and the
error message was:

   Failed to execute child process “/bin/sh” (Bad address)

That led me to check the arguments being used and it turned out that
the list of arguments was not properly terminated. I fixed that with
commit [1] for 3.37.3+ and 3.36.3+. I also left there the debugging I
added [2], thus it'll be easier to check for errors in the future.
That's committed for the same versions.
Bye,
Milan

[1] https://gitlab.gnome.org/GNOME/evolution-data-server/commit/84c2cd855
[2] https://gitlab.gnome.org/GNOME/evolution/commit/e149f285ac

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


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

2020-05-08 Thread Patrick O'Callaghan
On Fri, 2020-05-08 at 14:13 +0200, DrOteonu wrote:
> On Wed, 2020-05-06 at 17:11 +0100, Patrick O'Callaghan wrote:
> 
> Thank you so much for your suggestions, Patrick - my replies inline:
> 
> > The log shows that the script is being called, so the problem isn't
> > with Evolution but with the script itself.
> 
> However, isn't this in the end still some problem/bug in Evolution?
> Shouldn't it work? For example, if I define shortcut keys in Gnome (on
> Ubuntu 19.10) to execute shell commands in the same way, they always
> work, without exception.
> 
> >  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.
> 
> do you know who would know this in detail? Executing external scripts
> is a crucial feature for me.

Milan would know, or any of the developers.

> > IOW I think you need to put some logging into the script itself.
> 
> I tried this:
> (begin script)
> echo "\\n\\nI was called at $(date)" >>
> ~/temp/received_mail_from_john.log
> espeak "Why am I only read out loud sometimes, and not always?" >>
> ~/temp/received_mail_from_john.log 2>&1
> (end script)

When quoting scripts it's really important to respect line breaks. If
that is literally the script you have, then there's a syntax error
after both of the '>>' redirects, but you say it works when called with
Ctrl-Y so it's hard to diagnose by guessing what it really looks like.
Please send it again using the Preformatted drop-down menu item in the
composer. I would also try it with only the 'echo', i.e. without the
espeak call, and see what happens.

poc

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


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

2020-05-08 Thread Patrick O'Callaghan
On Fri, 2020-05-08 at 14:45 +0200, DrOteonu wrote:
> On Fri, 2020-05-08 at 13:42 +0100, Patrick O'Callaghan wrote:
> > On Fri, 2020-05-08 at 14:13 +0200, DrOteonu wrote:
> > > I tried this:
> > > (begin script)
> > > echo "\\n\\nI was called at $(date)" >>
> > > ~/temp/received_mail_from_john.log
> > > espeak "Why am I only read out loud sometimes, and not always?" >>
> > > ~/temp/received_mail_from_john.log 2>&1
> > > (end script)
> > > 
> > > However, this does not have any effect, because if the script is not
> > > called, it also seems not to write anything to the log.
> > 
> > Do you mean '/tmp/', rather than '/temp'?
> 
> tmp is perhaps more canonical, but what is the difference? I created
> ~/temp manually in the past, so the directory exists.

No problem, I was just making sure it wasn't a typo. I hadn't noticed
the '~'.

poc

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


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

2020-05-08 Thread DrOteonu via evolution-list
On Fri, 2020-05-08 at 13:42 +0100, Patrick O'Callaghan wrote:
> On Fri, 2020-05-08 at 14:13 +0200, DrOteonu wrote:
> > I tried this:
> > (begin script)
> > echo "\\n\\nI was called at $(date)" >>
> > ~/temp/received_mail_from_john.log
> > espeak "Why am I only read out loud sometimes, and not always?" >>
> > ~/temp/received_mail_from_john.log 2>&1
> > (end script)
> > 
> > However, this does not have any effect, because if the script is not
> > called, it also seems not to write anything to the log.
> 
> Do you mean '/tmp/', rather than '/temp'?

tmp is perhaps more canonical, but what is the difference? I created
~/temp manually in the past, so the directory exists.

> 
> poc
> 
___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


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

2020-05-08 Thread Patrick O'Callaghan
On Fri, 2020-05-08 at 14:13 +0200, DrOteonu wrote:
> I tried this:
> (begin script)
> echo "\\n\\nI was called at $(date)" >>
> ~/temp/received_mail_from_john.log
> espeak "Why am I only read out loud sometimes, and not always?" >>
> ~/temp/received_mail_from_john.log 2>&1
> (end script)
> 
> However, this does not have any effect, because if the script is not
> called, it also seems not to write anything to the log.

Do you mean '/tmp/', rather than '/temp'?

poc

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


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

2020-05-08 Thread DrOteonu via evolution-list
> On Fri, 2020-05-08 at 14:13 +0200, DrOteonu wrote
> However, this does not have any effect, because if the script is not
> called,

Here I should have said "if the script is not effectively called" -
perhaps it has been called, but failed at some point.
>  it also seems not to write anything to the log. So I still can't
> find out what happens when it does not work. Or did you mean some
> other kind of logging?
> TIA,
> DrO
> 
___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


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

2020-05-08 Thread DrOteonu via evolution-list
On Wed, 2020-05-06 at 17:11 +0100, Patrick O'Callaghan wrote:

Thank you so much for your suggestions, Patrick - my replies inline:

> The log shows that the script is being called, so the problem isn't
> with Evolution but with the script itself.

However, isn't this in the end still some problem/bug in Evolution?
Shouldn't it work? For example, if I define shortcut keys in Gnome (on
Ubuntu 19.10) to execute shell commands in the same way, they always
work, without exception.

>  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.

do you know who would know this in detail? Executing external scripts
is a crucial feature for me.

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

I tried this:
(begin script)
echo "\\n\\nI was called at $(date)" >>
~/temp/received_mail_from_john.log
espeak "Why am I only read out loud sometimes, and not always?" >>
~/temp/received_mail_from_john.log 2>&1
(end script)

However, this does not have any effect, because if the script is not
called, it also seems not to write anything to the log. So I still
can't find out what happens when it does not work. Or did you mean some
other kind of logging?

TIA,

DrO

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


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

2020-05-06 Thread Patrick O'Callaghan
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 <
> j...@zoho.com> - "Re: Andijvie?"
>Info value 'john ' of header 'From' does match
> 'john'
>Finished test of message uid:62958 subject:'Re: Andijvie?' from 
> 'da...@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

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


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

2020-05-06 Thread DrOteonu via evolution-list
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 <
j...@zoho.com> - "Re: Andijvie?"
   Info value 'john ' of header 'From' does match
'john'
   Finished test of message uid:62958 subject:'Re: Andijvie?' from 
'da...@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.

Thanks,

DrO
___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list