> If in doubt, RTFM.

:-)

http://www.postfix.org/local.8.html

     Mailbox delivery can be delegated  to  alternative  message  transports
     specified  in the master.cf file.  The mailbox_transport_maps and mail-
     box_transport configuration  parameters  specify  an  optional  message
     transport  that  is  to be used for all local recipients, regardless of
     whether they  are  found  in  the  UNIX  passwd  database.

I checked the source code.

src/local/mailbox.c:296:

    if (*var_mailbox_transport) {
        state.msg_attr.rcpt.offset = -1L;
        *statusp = deliver_pass(MAIL_CLASS_PRIVATE, var_mailbox_transport,
                                state.request, &state.msg_attr.rcpt);
        return (YES);
    }

    /*
     * Skip delivery when this recipient does not exist.
     */
    if ((errno = mypwnam_err(state.msg_attr.user, &mbox_pwd)) != 0) {
        msg_warn("error looking up passwd info for %s: %m",
                 state.msg_attr.user);
        dsb_simple(state.msg_attr.why, "4.0.0", "user lookup error");
        *statusp = defer_append(BOUNCE_FLAGS(state.request),
                                BOUNCE_ATTR(state.msg_attr));
        return (YES);
    }
    if (mbox_pwd == 0)
        return (NO);

Execution must not reach the second 'if' because I have mailbox_transport.
However I find "user lookup error" messages in the log. (And mail is
not passed to mailbox_transport defined by main.cf.)
So the message does not come from here but from
src/local/dotforward.c:126:

    /*
     * Skip non-existing users. The mailbox delivery routine will catch the
     * error.
     */
    if ((errno = mypwnam_err(state.msg_attr.user, &mypwd)) != 0) {
        msg_warn("error looking up passwd info for %s: %m",
                 state.msg_attr.user);
        dsb_simple(state.msg_attr.why, "4.0.0", "user lookup error");
        *statusp = defer_append(BOUNCE_FLAGS(state.request),
                                BOUNCE_ATTR(state.msg_attr));
        return (YES);
    }
    if (mypwd == 0)
        return (NO);


Also "local -v" shows the same:

Feb 16 15:10:24 NEWMTA postfix/local[6860]: deliver_alias: hash:/etc/aliases-arc
hive(0,lock|no_regsub|no_proxy|no_unauth|fold_fix): +trash not found
Feb 16 15:10:24 NEWMTA postfix/local[6860]: deliver_dotforward[7]: local +trash 
recip +tr...@newmta.example.com exten  deliver tr...@newmta.example.com 
exp_from tra
sh
Feb 16 15:10:24 NEWMTA postfix/local[6860]: warning: error looking up passwd 
info for +trash: No such file or directory
[...]
Feb 16 15:10:24 NEWMTA postfix/local[6860]: send attr status = 4.0.0
Feb 16 15:10:24 NEWMTA postfix/local[6860]: send attr diag_type =
Feb 16 15:10:24 NEWMTA postfix/local[6860]: send attr diag_text =
Feb 16 15:10:24 NEWMTA postfix/local[6860]: send attr mta_type =
Feb 16 15:10:24 NEWMTA postfix/local[6860]: send attr mta_mname =
Feb 16 15:10:24 NEWMTA postfix/local[6860]: send attr action = delayed
Feb 16 15:10:24 NEWMTA postfix/local[6860]: send attr reason = user lookup error
Feb 16 15:10:24 NEWMTA postfix/local[6860]: private/defer socket: wanted 
attribute: status

(In this test I wanted to drop mail into "Trash" shared folder.)

Now I try to figure out why the deliver_dotforward() code is executed
instead of deliver_mailbox() ...

Gabor

Reply via email to