[Evolution] Using Pipe to Program Filter



Hello everyone,

I have come with yet more question on filters :-)

I am doing some experiments with the "Pipe to Program" filters, and I have to say, there is not much documentation on the internet besides this wiki page, and states the following:
Sends the message to an application of your choice. No return value is 
expected. This feature can be used to create automatic Web postings from
 email messages or to perform additional message post processing not 
supported by Evolution.

So what I undertand from this is that the program will be called like.

echo "mail-contents" | /path/to/my/bash/script.sh

And I am trying to figure out what its actually piped though the script, so I wrote a script to actually try and find it out:

#!/usr/bin/env bash

while IFS= read -r line; do
  printf '%s\n' "$line" | tee -a /tmp/email.out
done

echo $var | tee -a /tmp/email-test.out

/usr/bin/env > /tmp/env.out

And the scipt reads multiline when invoked like so:
# echo "lol" | evolution-pipe-check.sh
lol
and also appears on the files.

But on evolution the files gets created with an empty line, why I have no idea.
Here is the description of the filter:
Pipe To Program test (enabled, for any account)
   If all the following conditions are met
      Sender contains alfredo palhares me
   Then
      Pipe to Program /home/masterkorp/bin/evolution-pipe-check.sh

Also the filter is called on the filter logs:
Reported 1 recent messages in 'alfredo palhares me : INBOX'
2020-07-24 16:49:18 - Applied filter "Pipe To Program test" to message from alfredo palhares me - "Testing Scripting"
   Header 'From' value ' alfredo palhares me' does match 'alfredo palhares me'
   Finished test of message uid:44388 subject:'Testing Scripting' from 'alfredo palhares me : INBOX' as MATCHED
   Filter 'Pipe To Program test' matched

Action: Piping message to /bin/sh

Can anyone please give me any insights on this ?


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