nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] Multi-homed postproc, v2


From: Ken Hornstein
Subject: Re: [Nmh-workers] Multi-homed postproc, v2
Date: Tue, 10 Mar 2015 10:31:19 -0400

>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.

--Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]