Best procmail logic for this
am 10.06.2005 22:53:03 von Bogart
I want this logic
WHOTO=`formail -xEnvelope-to:`
if $WHOTO = ""
then WHOTO = `formail -xTo:`
My ISP puts mails for any recipient at this
domain in a single mailbox. I need to fetch
the mails with pop (I'm using fetchmail)
and deliver to various, mainly mailman
lists on running on the box but there will
be a few mails that are not deliverable.
The envelope seems fairly reliable with this
ISP. I can't rely on the To: because when
its a cc that comes in the To: remains set
to the orginal recipient not the cc.
I guess I shouldn't need to do the logic
above, just rely on the envelope but
a little bit of defensiveness never hurt.
I find sendmail to be a bit of a b**gg**er - if
I don't use it for a time I have to learn all the
logic again. So what's the best way to do the
logic above please.
bogey
Re: Best procmail logic for this
am 11.06.2005 09:52:03 von Garen Erdoisa
Bogart wrote:
> I want this logic
>
> WHOTO=`formail -xEnvelope-to:`
>
> if $WHOTO = ""
> then WHOTO = `formail -xTo:`
>
>
> My ISP puts mails for any recipient at this
> domain in a single mailbox. I need to fetch
> the mails with pop (I'm using fetchmail)
> and deliver to various, mainly mailman
> lists on running on the box but there will
> be a few mails that are not deliverable.
> The envelope seems fairly reliable with this
> ISP. I can't rely on the To: because when
> its a cc that comes in the To: remains set
> to the orginal recipient not the cc.
> I guess I shouldn't need to do the logic
> above, just rely on the envelope but
> a little bit of defensiveness never hurt.
>
> I find sendmail to be a bit of a b**gg**er - if
> I don't use it for a time I have to learn all the
> logic again. So what's the best way to do the
> logic above please.
>
> bogey
>
WHOTO=`formail -x"Envelope-to:"`
:0
* WHOTO ?? ^^^^
{ WHOTO=`formail -x"To:"` }