Re: [exim] Exim4 pipe email through two commands

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Lena
日付:  
To: exim-users
題目: 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.