procmail
[Top] [All Lists]

more tweaking

1999-11-21 06:25:56
Still hoping someone will help me out with my post from yesterday.
But I'm making progress.  That was:  I own 6 domains and have
shell and procmail access on one.  All mail gets sent to that
one.  Example: home base is maindomain.com.  Others are
satellite1.com, satellite2.com, etc.

Since I own maindomain.com, I get mail addressed any way I
want that goes there.  So I set up forwards for the satellites.
E.g., satellite1.com mail is redirected to sat1(_at_)maindomain(_dot_)com;
satellite2.com mail is redirected to sat2(_at_)maindomain(_dot_)com;
etc.

Usually mail at maindomain has a valid To: line in it, and
I can use that to see which satellite domain the original
mail was sent.  That's why I was fooling around with To:
and TO_ yesterday.  But of course sometimes I won't see
the envelope.  But it's not a problem, because I'll still
see "sat[1-5](_at_)maindomain(_dot_)com" in the headers.  Again,
remember that I have an auto-reply that should personalize
itself, and set X-Loop, based on the domain that the
person wrote to.

I want to use $MATCH.  That way I can set various things
like the X-Loop header from that later.

I want to test for any of these header lines:

        "       for <sat1(_at_)maindomain(_dot_)com>"
        "       for <sat2(_at_)maindomain(_dot_)com>"
        "       for <sat3(_at_)maindomain(_dot_)com>"
        "       for <sat4(_at_)maindomain(_dot_)com>"
        "       for <sat5(_at_)maindomain(_dot_)com>"

If it's not one of those then the mail was sent directly
to maindomain, and I can set my variable to that.

Okay, so I have so far:

        :0 Dch  # no lock, we're not saving anything
        * for <sat(1|2|3|4|5)@maindomain\.com>
        * for <\/sat(1|2|3|4|5)
        $MATCH

Let me explain what I'm doing.

I ultimately don't want to save headers to $MATCH.  But I'm just
doing that while I test things to see if I'm on the right track;
which I appear to be.

First of all, I had trouble with the leading tab.  I couldn't
get, for example, any of the following to match, for some reason,
even though when I examine the mail's headers there is a tab in
there.  (Could my mail program be putting the tabs in on continuation
lines?)

        * ^     for <sat
        * ^[    ]for <sat
        * ^[    ]+for <sat

Okay, so I gave up on that and went to just looking for

        * for <sat{whatever}

as seen above.  I put the whole address in the first parse line
to be sure it was really sent to sat[1-5](_at_)maindomain(_dot_)com and not
some bogus similar thing.  Then I used a second, similar line for
the \/ stuff that $MATCH uses, but just ended after "sat[1-5]", so
that I can set $MATCH to just that, which is what I want. 
Purpose is: mail to, e.g., sat1(_at_)NOTmaindomain(_dot_)com will not
match.  But mail to sat1(_at_)maindomain(_dot_)com will match, and the
match string will be just "sat1".  This does work.  Is there a
better way?

Once I get this working right and efficiently, I will assign a
variable such as $DOM to $MATCH and use it later in other recipes. 
I'm assuming, and hoping, that a variable so set will be global,
i.e., exist past the end of the current recipe.  I also need to
know how to just set these values, though, since I don't really
want to save mail to any file at this point in the chain but only
am interested in setting my variables up.


Okay, now to two other issues I'm running into on this 
server.  When I have a prepared message piped to sendmail
as in

        ( whatever ) | sendmail -oi -t

I get bounces.  The server says that "-oi" and "-t"
are not valid addresses.  I don't get it.  This
exact same recipe works fine on two other servers.
We're using v3.11pre7 here.  The machine is a DEC alpha.

If I use syntax like

        ! valid(_at_)address(_dot_)com

it does work, and the logs tell me that sendmail -oi -t was
invoked!  So how do I pipe stuff to sendmail in such a
situation?


Final problem (of this mail): fileperms are stuck
public (rwxr-xr-x) and I can't change them.  

        UMASK = 077

has absolutely no effect.  Why would that be?

I hope I'll get more responses than I did yesterday.  :-)
Thanks, guys.

-- 
    \     .-.     .-.     .-.     .-.     .-.     .-.     .-.     /
     \-d-/-m-\-a-/-n-\-(_at_)-/-n-\-e-/-t-\-c-/-o-\-m-/-.-\-c-/-o-\-m-/
      '-'     '-'     '-'     '-'     '-'     '-'     '-'     '-'

<Prev in Thread] Current Thread [Next in Thread>