20120330 Workaround: specify "\c" at the start of an smtp_reject_footer template to suppress the line break between the reply text and the footer text. Files: global/smtp_reply_footer.c, proto/postconf.proto. diff --exclude=man --exclude=html --exclude=README_FILES --exclude=.indent.pro --exclude=Makefile.in -cr /var/tmp/postfix-2.10-20120308/proto/postconf.proto ./proto/postconf.proto *** /var/tmp/postfix-2.10-20120308/proto/postconf.proto Mon Mar 5 10:39:49 2012 --- ./proto/postconf.proto Fri Mar 30 17:22:43 2012 *************** *** 14156,14166 **** server 4XX or 5XX response.
!Example:
/etc/postfix/main.cf:
! smtpd_reject_footer = For assistance, call 800-555-0101.
Please provide the following information in your problem report:
time ($localtime), client ($client_address) and server
($server_name).
--- 14156,14168 ----
server
4XX or 5XX response.
! The following example uses "\c" at the start of the template
! (supported in Postfix 2.10 and later) to suppress the line break
! between the reply text and the footer text.
/etc/postfix/main.cf:
! smtpd_reject_footer = \c. For assistance, call 800-555-0101.
Please provide the following information in your problem report:
time ($localtime), client ($client_address) and server
($server_name).
***************
*** 14169,14176 ****
Server response:
! 550-5.5.1 <user@example> Recipient address rejected: User unknown
! 550 5.5.1 For assistance, call 800-555-0101. Please provide the
following information in your problem report: time (Jan 4 15:42:00),
client (192.168.1.248) and server (mail1.example.com).
--- 14171,14178 ----
Server response:
! 550-5.5.1 <user@example> Recipient address rejected: User
! unknown. For assistance, call 800-555-0101. Please provide the
following information in your problem report: time (Jan 4 15:42:00),
client (192.168.1.248) and server (mail1.example.com).
***************
*** 14224,14229 ****
--- 14226,14236 ----
enhanced status code) from the original Postfix reject message.
+ To work around mail software that mis-handles multi-line replies,
+ specify the two-character sequence \c at the start of the template.
+ This suppresses the line break between the reply text and the footer
+ text (Postfix 2.10 and later).
+
This feature is available in Postfix 2.8 and later.
%PARAM postscreen_expansion_filter see "postconf -d" output
diff --exclude=man --exclude=html --exclude=README_FILES --exclude=.indent.pro --exclude=Makefile.in -cr /var/tmp/postfix-2.10-20120308/src/global/smtp_reply_footer.c ./src/global/smtp_reply_footer.c
*** /var/tmp/postfix-2.10-20120308/src/global/smtp_reply_footer.c Sun Jun 26 15:04:57 2011
--- ./src/global/smtp_reply_footer.c Sat Apr 7 18:56:10 2012
***************
*** 36,41 ****
--- 36,44 ----
/* expanded. The two-character sequence "\n" is replaced by a
/* line break followed by a copy of the original SMTP reply
/* code and optional enhanced status code.
+ /* The two-character sequence "\c" at the start of the template
+ /* suppresses the line break between the reply text and the
+ /* template text.
/* .IP filter
/* The set of characters that are allowed in attribute expansion.
/* .IP lookup
***************
*** 94,99 ****
--- 97,103 ----
char *end;
ssize_t dsn_len;
int crlf_at_end = 0;
+ int reply_patch_undo_offs = -1;
/*
* Sanity check.
***************
*** 112,117 ****
--- 116,122 ----
|| (cp[3] != ' ' && cp[3] != '-'))
return (-1);
cp[3] = '-';
+ reply_patch_undo_offs = cp + 3 - STR(buffer);
if ((next = strstr(cp, "\r\n")) == 0) {
next = end;
break;
***************
*** 141,156 ****
} else {
next = end;
}
! /* Append a clone of the SMTP reply code. */
! vstring_strcat(buffer, "\r\n");
! VSTRING_SPACE(buffer, 3);
! vstring_strncat(buffer, STR(buffer) + start, 3);
! vstring_strcat(buffer, next != end ? "-" : " ");
! /* Append a clone of the optional enhanced status code. */
! if (dsn_len > 0) {
! VSTRING_SPACE(buffer, dsn_len);
! vstring_strncat(buffer, STR(buffer) + start + 4, (int) dsn_len);
! vstring_strcat(buffer, " ");
}
/* Append one line of footer text. */
mac_expand(buffer, cp, MAC_EXP_FLAG_APPEND, filter, lookup, context);
--- 146,167 ----
} else {
next = end;
}
! if (cp == template && strncmp(cp, "\\c", 2) == 0) {
! /* Handle \c at start of template. */
! cp += 2;
! } else {
! /* Append a clone of the SMTP reply code. */
! vstring_strcat(buffer, "\r\n");
! VSTRING_SPACE(buffer, 3);
! vstring_strncat(buffer, STR(buffer) + start, 3);
! vstring_strcat(buffer, next != end ? "-" : " ");
! /* Append a clone of the optional enhanced status code. */
! if (dsn_len > 0) {
! VSTRING_SPACE(buffer, dsn_len);
! vstring_strncat(buffer, STR(buffer) + start + 4, (int) dsn_len);
! vstring_strcat(buffer, " ");
! }
! reply_patch_undo_offs = -1;
}
/* Append one line of footer text. */
mac_expand(buffer, cp, MAC_EXP_FLAG_APPEND, filter, lookup, context);
***************
*** 160,165 ****
--- 171,178 ----
} else
break;
}
+ if (reply_patch_undo_offs > 0)
+ STR(buffer)[reply_patch_undo_offs] = ' ';
if (crlf_at_end)
vstring_strcat(buffer, "\r\n");
return (0);