On Tue, 10 Mar 2015 10:31:19 -0400 Ken Hornstein <[email protected]> sez:

> >Thanks for the proposed localpostproc, Ken!
> >looping mechanism -- or, at least, a "there-exists" mechanism.
> >I need something that checks the recipients' host(s), which
> >means potentially checking more than 1 string.  The pseudo-code
> >would be roughly
> >
> >     if @.*stanford.edu in {%(host{to}), %(host{cc}), %(host{bcc})}
> >         postflags=""
> >     else
> >         postflags="-server smtp.gmail.com -port submission -tls -sasl -user 
> > dnc2dnc"
> 
> I think you're overthinking it.  I used %(host), because I
> wanted to extract out something that would be in a case
> statement, but you have the entire power of the shell; you
> could easily do something like this:
> 
>   if scan -format '%{to} %{cc} %{bcc} %{dcc}' "$draftname" | grep -iqs 
> @stanford.edu; then
>       ... set for stanford ...
>   else
>       ... set for everything else ...
>   fi
> 
> Well, you might want to change that grep, but you get the idea.
> I know, the issue with things like %(host) only working on one
> address is a pain; I am unsure how to solve that.

Ah, right!  Trying too hard to make NMH do all the lifting.

Thanks for splashing some cold shell water on me!  B-)

                                Bob

_______________________________________________
Nmh-workers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/nmh-workers

Reply via email to