OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Wietse Venema (wietseporcupine.org)
Date: Thu Apr 26 2001 - 18:31:52 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    Andrew Diederich:
    > I'm tracing a problem cause by another piece of software. I think they've
    > mucked up the MAIL FROM: when sending email. I turned on debugging level 2
    > in postfix (19991231pl05), and here's a few lines from postfix/smtpd.

    MAIL FROM: is defined in RFC 821, ftp://ftp.isi.edu/in-notes/rfc821.txt

    > I think the problem is the other mailer software put in
    > MAIL FROM:<Andrew diederich <andrewnetdelivery.com>>

    Postfix implements RFC 821, which requires

            MAIL FROM:<userdomain>

    or equivalent forms.

    What you see is an entirely invalid address form. It just so happens
    that Sendmail accepts it.

    I thought I had implemented a workaround for this long ago, but it
    looks like no recent Postfix has a "working" workaround for such
    damaged addresses. I looked at versions back until 19990906-pl09.

    Below is a patch that strips the outer level of <> which are part
    of SMTP, and not part of the address, before Postfix attempts to
    actually parse the address.

    You can disable processing of these invalid address forms by setting

        strict_rfc821_envelopes = yes

    in the main.cf file.

            Wietse

    *** ./smtpd.c- Wed Apr 11 17:07:58 2001
    --- ./smtpd.c Thu Apr 26 19:24:59 2001
    ***************
    *** 523,528 ****
    --- 523,529 ----
          int naddr;
          int non_addr;
          char *err = 0;
    + char *junk;
      
          /*
           * Special case.
    ***************
    *** 544,550 ****
           */
          if (msg_verbose)
              msg_info("%s: input: %s", myname, STR(arg->vstrval));
    ! tree = tok822_parse(STR(arg->vstrval));
      
          /*
           * Find trouble.
    --- 545,557 ----
           */
          if (msg_verbose)
              msg_info("%s: input: %s", myname, STR(arg->vstrval));
    ! if (STR(arg->vstrval)[0] == '<'
    ! && STR(arg->vstrval)[LEN(arg->vstrval) - 1] == '>') {
    ! junk = mystrndup(STR(arg->vstrval) + 1, LEN(arg->vstrval) - 2);
    ! tree = tok822_parse(junk);
    ! myfree(junk);
    ! } else
    ! tree = tok822_parse(STR(arg->vstrval));
      
          /*
           * Find trouble.

    -
    To unsubscribe, send mail to majordomopostfix.org with content
    (not subject): unsubscribe postfix-users