procmail filter AND copy?
am 28.06.2006 07:14:53 von Michael B Allen
Hi,
I would like to use email2sms [1] to prep messages for transmission to
my cellphone. My question is, what kind of procmail recipe can be used
to filter and then copy? Meaning, I want the filter to run an then I want
that message to be forwarded to my cell. So it might look something like:
:0 c
* To:.*me@foo.net
| email2sms
! 1234567890@vtext.com
But I doubt the above will work. I don't know.
Any ideas?
Thanks,
Mike
Re: procmail filter AND copy?
am 28.06.2006 07:51:06 von Garen Erdoisa
Michael B Allen wrote:
> Hi,
>
> I would like to use email2sms [1] to prep messages for transmission to
> my cellphone. My question is, what kind of procmail recipe can be used
> to filter and then copy? Meaning, I want the filter to run an then I want
> that message to be forwarded to my cell. So it might look something like:
>
> :0 c
> * To:.*me@foo.net
> | email2sms
> ! 1234567890@vtext.com
>
>
> But I doubt the above will work. I don't know.
>
> Any ideas?
>
> Thanks,
> Mike
>
Something like the following should do what you want.
FORMAIL=formail
# run the following nested recipe if the condition is met
# because the nesting block is using a copy, it will not
# stop procmail from processing when this nesting block
# is done.
:0 c
* To:.*me@foo.net
{
# filter the copy of the message through the email2sms program
# This will not alter the original message in the main procmail
# pipe
:0 HBf
| ${FORMAIL} |email2sms
# mail the filtered SMS version of the message
:0
! 1234567890@vtext.com
}
--
Garen
Re: procmail filter AND copy?
am 28.06.2006 10:07:00 von Michael B Allen
On Tue, 27 Jun 2006 23:51:06 -0600, Garen Erdoisa wrote:
> Michael B Allen wrote:
>> Hi,
>>
>> I would like to use email2sms [1] to prep messages for transmission to
>> my cellphone. My question is, what kind of procmail recipe can be used
>> to filter and then copy? Meaning, I want the filter to run an then I want
>> that message to be forwarded to my cell. So it might look something like:
>>
>> :0 c
>> * To:.*me@foo.net
>> | email2sms
>> ! 1234567890@vtext.com
>>
>>
>> But I doubt the above will work. I don't know.
>>
>> Any ideas?
>>
>> Thanks,
>> Mike
>>
>
> Something like the following should do what you want.
>
> FORMAIL=formail
>
> # run the following nested recipe if the condition is met
> # because the nesting block is using a copy, it will not
> # stop procmail from processing when this nesting block
> # is done.
> :0 c
> * To:.*me@foo.net
> {
> # filter the copy of the message through the email2sms program
> # This will not alter the original message in the main procmail
> # pipe
> :0 HBf
> | ${FORMAIL} |email2sms
>
> # mail the filtered SMS version of the message
> :0
> ! 1234567890@vtext.com
> }
Works. I would have never figured that out.
Thanks,
Mike