# BEGIN_MTA_ARGS
# MTA: postfix
# command line parsing

# we won't need any of this once amavis
# receives input from SMTP; but then,
# $SENDER and @RECIPS must be initialised
# from the SMTP dialogue

# need two args in any case
if ($#untaint_ARGV < 1) {
    do_log(0,"Missing arguments to postfix");
    do_exit($REGERR, __LINE__);
}

# optionally, we allow to use amavis with a -f <sender> flag
# to make invocation similar to sendmail
if ($untaint_ARGV[0] eq "-f") {
    # in this case, we need at least three args
    do_exit($REGERR, __LINE__) if ($#untaint_ARGV < 2);

    shift @untaint_ARGV;
}

$SENDER = shift @untaint_ARGV;
@RECIPS = @untaint_ARGV;

# END_MTA_ARGS
