Peter:
> Also the log entry says this:
> > Dec 15 17:59:09 mailhost postfix/local[7486]: B4D124341:
> > to=<foo-test@mailhost>, relay=local, delay=0, status=bounced (unknown
> > user: "foo-test")
> 
> Wouldn't that be better if it says, '(unknown user: "foo")'?  This in

Yes, that would make sense.

It looks like the local(8) "unknown user" error handling pre-dates
the recipient delimiter implementation.

This includes the error handling for a missing alias for "postmaster"
or "mailer-daemon". All this code should use the extension-less
localpart, instead of the full localpart as they do now.

Patch follows.

        Wietse

*** ./unknown.c-        Mon Jan  9 19:35:49 2012
--- ./unknown.c Sat Dec 15 20:47:15 2012
***************
*** 150,158 ****
       */
  #define STREQ(x,y) (strcasecmp(x,y) == 0)
  
!     if (STREQ(state.msg_attr.local, MAIL_ADDR_MAIL_DAEMON)
!       || STREQ(state.msg_attr.local, MAIL_ADDR_POSTMASTER)) {
!       msg_warn("required alias not found: %s", state.msg_attr.local);
        dsb_simple(state.msg_attr.why, "2.0.0", "discarded");
        return (sent(BOUNCE_FLAGS(state.request), SENT_ATTR(state.msg_attr)));
      }
--- 150,158 ----
       */
  #define STREQ(x,y) (strcasecmp(x,y) == 0)
  
!     if (STREQ(state.msg_attr.user, MAIL_ADDR_MAIL_DAEMON)
!       || STREQ(state.msg_attr.user, MAIL_ADDR_POSTMASTER)) {
!       msg_warn("required alias not found: %s", state.msg_attr.user);
        dsb_simple(state.msg_attr.why, "2.0.0", "discarded");
        return (sent(BOUNCE_FLAGS(state.request), SENT_ATTR(state.msg_attr)));
      }
***************
*** 161,167 ****
       * Bounce the message when no luser relay is specified.
       */
      dsb_simple(state.msg_attr.why, "5.1.1",
!              "unknown user: \"%s\"", state.msg_attr.local);
      return (bounce_append(BOUNCE_FLAGS(state.request),
                          BOUNCE_ATTR(state.msg_attr)));
  }
--- 161,167 ----
       * Bounce the message when no luser relay is specified.
       */
      dsb_simple(state.msg_attr.why, "5.1.1",
!              "unknown user: \"%s\"", state.msg_attr.user);
      return (bounce_append(BOUNCE_FLAGS(state.request),
                          BOUNCE_ATTR(state.msg_attr)));
  }

Reply via email to