Re: [exim] Exim4 pipe email through two commands

Góra strony
Delete this message
Reply to this message
Autor: Lena
Data:  
Dla: exim-users
Temat: Re: [exim] Exim4 pipe email through two commands
> I currently have a few adresses that are set up as follows (in a aliases file):
>
> someemail: "|/usr/bin/somecommand -opt someoption"
>
> However, I would like the message to pass through another command
> first, much like normal shell pipeling:
>
> user@computer: echo "someemailcontents" | /usr/bin/somefilter -n 5 |
> /usr/bin/somecommand -opt someoption


someemail: |/bin/sh -c '/usr/bin/somefilter -n 5 | /usr/bin/somecommand -opt someoption'

or:

someemail: |/root/script

file /root/script (chmod 755):
#!/bin/sh
/usr/bin/somefilter -n 5 | /usr/bin/somecommand -opt someoption

Double quotes are necessary only if an alias contains a comma.