Loading ...
Sorry, an error occurred while loading the content.

"mime-error improper use of 8-bit data in message header" vs. smtpd_proxy_filter

Expand Messages
  • Ralf Hildebrandt
    Today I encountered this on the python.org mailserver: Jan 2 14:49:54 albatross postfix/cleanup[5983]: 949B8EE99E: reject mime-error improper use of 8-bit
    Message 1 of 4 , Jan 2, 2011
    • 0 Attachment
      Today I encountered this on the python.org mailserver:

      Jan 2 14:49:54 albatross postfix/cleanup[5983]: 949B8EE99E: reject mime-error improper use of 8-bit data in message header: To: Alice Bevan?McGregor <alice@....com>, web-sig@... from localhost[127.0.0.1]; from=<pje@....com> to=<web-sig@...>

      which resulted in this:

      Jan 2 14:49:54 albatross postfix/smtpd[4866]: proxy-reject:
      END-OF-MESSAGE: 554 permanent error; from=<pje@....com>
      to=<web-sig@...> proto=ESMTP helo=<sparrow.telecommunity.com>

      In the bounce, pje only got the "554 permanent error" message.

      master.cf has:

      smtpd pass - - - - - smtpd
      -o receive_override_options=no_address_mappings
      -o smtpd_proxy_filter=127.0.0.1:8025
      -o smtpd_proxy_options=speed_adjust

      127.0.0.1:8025 runs a spamfilter written in python. So the question is
      - can I change something in the spamfilter to pass the error code back
      to the original client?

      On the other hand I'm wondering what that invalid 8-bit character
      might be, since it LOOKS like a space in the bounce I got from pje.

      --
      Ralf Hildebrandt
      Geschäftsbereich IT | Abteilung Netzwerk
      Charité - Universitätsmedizin Berlin
      Campus Benjamin Franklin
      Hindenburgdamm 30 | D-12203 Berlin
      Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
      ralf.hildebrandt@... | http://www.charite.de
    • Ralf Hildebrandt
      ... It was a strange hyphen. -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin
      Message 2 of 4 , Jan 2, 2011
      • 0 Attachment
        * Ralf Hildebrandt <Ralf.Hildebrandt@...>:

        > On the other hand I'm wondering what that invalid 8-bit character
        > might be, since it LOOKS like a space in the bounce I got from pje.

        It was a strange hyphen.

        --
        Ralf Hildebrandt
        Geschäftsbereich IT | Abteilung Netzwerk
        Charité - Universitätsmedizin Berlin
        Campus Benjamin Franklin
        Hindenburgdamm 30 | D-12203 Berlin
        Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
        ralf.hildebrandt@... | http://www.charite.de
      • Wietse Venema
        ... When the MIME processor was added to Postfix, there was no way to get the error message back to the SMTP client. I suppose that the following patch brings
        Message 3 of 4 , Jan 2, 2011
        • 0 Attachment
          Ralf Hildebrandt:
          > Today I encountered this on the python.org mailserver:
          >
          > Jan 2 14:49:54 albatross postfix/cleanup[5983]: 949B8EE99E: reject mime-error improper use of 8-bit data in message header: To: Alice Bevan?McGregor <alice@....com>, web-sig@... from localhost[127.0.0.1]; from=<pje@....com> to=<web-sig@...>
          >
          > which resulted in this:
          >
          > Jan 2 14:49:54 albatross postfix/smtpd[4866]: proxy-reject:
          > END-OF-MESSAGE: 554 permanent error; from=<pje@....com>
          > to=<web-sig@...> proto=ESMTP helo=<sparrow.telecommunity.com>
          >
          > In the bounce, pje only got the "554 permanent error" message.

          When the MIME processor was added to Postfix, there was no way to get
          the error message back to the SMTP client.

          I suppose that the following patch brings Postfix MIME error
          reporting up to the same level as reject messages from Postfix
          header/body_checks.

          Wietse

          diff -cr /var/tmp/postfix-2.8-20110102/src/cleanup/cleanup_message.c src/cleanup/cleanup_message.c
          *** /var/tmp/postfix-2.8-20110102/src/cleanup/cleanup_message.c Tue Jul 27 16:34:20 2010
          --- src/cleanup/cleanup_message.c Sun Jan 2 17:00:13 2011
          ***************
          *** 880,885 ****
          --- 880,886 ----
          {
          CLEANUP_STATE *state = (CLEANUP_STATE *) context;
          const char *origin;
          + const char *error_text;

          /*
          * Message header too large errors are handled after the end of the
          ***************
          *** 889,897 ****
          if ((origin = nvtable_find(state->attr, MAIL_ATTR_LOG_ORIGIN)) == 0)
          origin = MAIL_ATTR_ORG_NONE;
          #define TEXT_LEN (len < 100 ? (int) len : 100)
          msg_info("%s: reject: mime-error %s: %.*s from %s; from=<%s> to=<%s>",
          ! state->queue_id, mime_state_error(err_code), TEXT_LEN, text,
          origin, state->sender, state->recip ? state->recip : "unknown");
          }
          }

          --- 890,901 ----
          if ((origin = nvtable_find(state->attr, MAIL_ATTR_LOG_ORIGIN)) == 0)
          origin = MAIL_ATTR_ORG_NONE;
          #define TEXT_LEN (len < 100 ? (int) len : 100)
          + error_text = mime_state_error(err_code);
          msg_info("%s: reject: mime-error %s: %.*s from %s; from=<%s> to=<%s>",
          ! state->queue_id, error_text, TEXT_LEN, text,
          origin, state->sender, state->recip ? state->recip : "unknown");
          + if (state->reason == 0)
          + state->reason = dsn_prepend("5.7.1", error_text);
          }
          }
        • Wietse Venema
          ... This is not needed. Postfix should already report one MIME error to the SMTP client, as long as the message has no other reject errors.
          Message 4 of 4 , Jan 2, 2011
          • 0 Attachment
            Wietse Venema:
            > Ralf Hildebrandt:
            > > Today I encountered this on the python.org mailserver:
            > >
            > > Jan 2 14:49:54 albatross postfix/cleanup[5983]: 949B8EE99E: reject mime-error improper use of 8-bit data in message header: To: Alice Bevan?McGregor <alice@....com>, web-sig@... from localhost[127.0.0.1]; from=<pje@....com> to=<web-sig@...>
            > >
            > > which resulted in this:
            > >
            > > Jan 2 14:49:54 albatross postfix/smtpd[4866]: proxy-reject:
            > > END-OF-MESSAGE: 554 permanent error; from=<pje@....com>
            > > to=<web-sig@...> proto=ESMTP helo=<sparrow.telecommunity.com>
            > >
            > > In the bounce, pje only got the "554 permanent error" message.
            >
            > When the MIME processor was added to Postfix, there was no way to get
            > the error message back to the SMTP client.
            >
            > I suppose that the following patch brings Postfix MIME error
            > reporting up to the same level as reject messages from Postfix
            > header/body_checks.

            This is not needed. Postfix should already report one MIME error
            to the SMTP client, as long as the message has no other "reject"
            errors.

            > Wietse
            >
            > diff -cr /var/tmp/postfix-2.8-20110102/src/cleanup/cleanup_message.c src/cleanup/cleanup_message.c
            > *** /var/tmp/postfix-2.8-20110102/src/cleanup/cleanup_message.c Tue Jul 27 16:34:20 2010
            > --- src/cleanup/cleanup_message.c Sun Jan 2 17:00:13 2011
            > ***************
            > *** 880,885 ****
            > --- 880,886 ----
            > {
            > CLEANUP_STATE *state = (CLEANUP_STATE *) context;
            > const char *origin;
            > + const char *error_text;
            >
            > /*
            > * Message header too large errors are handled after the end of the
            > ***************
            > *** 889,897 ****
            > if ((origin = nvtable_find(state->attr, MAIL_ATTR_LOG_ORIGIN)) == 0)
            > origin = MAIL_ATTR_ORG_NONE;
            > #define TEXT_LEN (len < 100 ? (int) len : 100)
            > msg_info("%s: reject: mime-error %s: %.*s from %s; from=<%s> to=<%s>",
            > ! state->queue_id, mime_state_error(err_code), TEXT_LEN, text,
            > origin, state->sender, state->recip ? state->recip : "unknown");
            > }
            > }
            >
            > --- 890,901 ----
            > if ((origin = nvtable_find(state->attr, MAIL_ATTR_LOG_ORIGIN)) == 0)
            > origin = MAIL_ATTR_ORG_NONE;
            > #define TEXT_LEN (len < 100 ? (int) len : 100)
            > + error_text = mime_state_error(err_code);
            > msg_info("%s: reject: mime-error %s: %.*s from %s; from=<%s> to=<%s>",
            > ! state->queue_id, error_text, TEXT_LEN, text,
            > origin, state->sender, state->recip ? state->recip : "unknown");
            > + if (state->reason == 0)
            > + state->reason = dsn_prepend("5.7.1", error_text);
            > }
            > }
            >
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.