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

234872PATCH: Creating empty bounce message template

Expand Messages
  • Wietse Venema
    Feb 28 1:09 PM
    • 0 Attachment
      Sacha Chlytor:
      > I have a client who wants to have no intro to his bounce messages.
      > Whether or not this is a good idea is not the issue. The problem is that
      > when I edit the bounce.cf file to read as below, postconf -b bounce.cf
      > returns the error: missing message text in failure template -- ignoring
      > this template
      >
      > [snip]
      > failure_template = <<EOF
      > Charset: us-ascii
      > From: MAILER-DAEMON (Mail Delivery System)
      > Subject: Undelivered Mail Returned to Sender
      > Postmaster-Subject: Postmaster Copy: Undelivered Mail
      >
      > EOF
      > [snip]
      >
      > I tried adding '-' on a line above the EOF, but that causes postconf to
      > dump core.

      You found a bug that triggers with one-line text templates.
      Below is a patch that stops Postfix from doing stupid things.

      > A little testing shows that one line of text and one blank
      > line causes the template to get processed correctly, but anything less
      > crashes.
      >
      > Am I missing something or is this not possible without modifying the code?

      Empty text is not allowed, but you can use a "." which is almost invisible.

      Wietse

      diff -cr /var/tmp/postfix-2.6-20080221/src/bounce/bounce_template.c ./bounce_template.c
      *** /var/tmp/postfix-2.6-20080221/src/bounce/bounce_template.c Tue Jan 8 16:03:33 2008
      --- ./bounce_template.c Thu Feb 28 15:52:27 2008
      ***************
      *** 343,349 ****
      * Is this 7bit or 8bit text? If the character set is US-ASCII, then
      * don't allow 8bit text. Don't assume 8bit when charset was changed.
      */
      ! #define NON_ASCII(p) (*(p) && !allascii((p)))

      if (NON_ASCII(cp) || NON_ASCII(tval)) {
      if (strcasecmp(tp->mime_charset, "us-ascii") == 0) {
      --- 343,349 ----
      * Is this 7bit or 8bit text? If the character set is US-ASCII, then
      * don't allow 8bit text. Don't assume 8bit when charset was changed.
      */
      ! #define NON_ASCII(p) ((p) && *(p) && !allascii((p)))

      if (NON_ASCII(cp) || NON_ASCII(tval)) {
      if (strcasecmp(tp->mime_charset, "us-ascii") == 0) {
    • Show all 3 messages in this topic