anomy-list

the magic variables

From: alex morris (12285@xyz.molar.is)
Date: Sat 21 Apr 2001 - 23:51:52 UTC

  • Next message: Bjarni R. Einarsson: "Re: the magic variables"

    Greetings,

    I feel dumb asking this question..

    I've been using anomy for in-transit sanitizing with sendmail, along
    with Sophos virus scan for a few months, and have had mostly success.
    But my lack of perl and / or sendmail smarts has me up against a wall.

    here is the shell script - sendmail mail deilvery agent named sanitize.

    sanitizer.pl $MCFG | sendmail -v -oi -f ${@+"$@"}

    My question;

    what are the variables ${@+"$@"} ???
    where do they come from? are they values parsed out from sanitize.pl,
    or are they used as sendmail operators?

    I can see from various debugging tricks that these variables get
    expanded to what I think is

    $(@+ equal the fully qualified sender address
    "$@"} equal the unqualified recipient address

    Here is my problem.

    I wish to have a box in the DMZ, anomyBox. The sendmail there should
    receive all mail for a domain, (multiple domains,) pass the mail through
    the sanitizer, then hand *that* sanitized email on to another sendmail
    running inside the DMZ (where the user account really is.) in other
    words, there is no local user on the anomy box in the DMZ. but there
    are local users on insideBox and otherBox.

    I have tried different things in sendmail to get this to happen.. I
    finally got it to work, but it is a horrible hack, and I wish to make it
    more proper.

    Here is what made it work;

    on anomyBox in DMZ, make the .cf file utilize FEATURE(`mailertable')
    make mailertable say

            mydomain.com sanitize:[insideBox.mydomain.com]

    then hack upon the sanitize script, thusly

    sanitizer.pl $MCFG | sendmail -v -oi -f ${@+"$@"@insideBox.mydomain.com}

    It works. Users who are not local to anomyBox, but who are local to
    insideBox receive sanitized email.

    But, this won't work for users who live on otherBox, because I have
    hard-coded it to insideBox in the script.

    but how best to pass this magic variable back to the script?

    There are a couple of ways I've messed around with, but all have
    undesireable side effects.

    I know there is a better way to do it.

    Any suggestions are appreciated.

    alex



    hosted by molar.is