summaryrefslogtreecommitdiff
path: root/mailutils/sendmail.c
diff options
context:
space:
mode:
authorDenys Vlasenko2011-11-18 22:25:35 +0100
committerDenys Vlasenko2011-11-18 22:25:35 +0100
commit41fea01066539ed8e958c21591a5fe7155565ceb (patch)
treea4531fe81eaa3b1231ef810589477fcb323ba25e /mailutils/sendmail.c
parenta0bef7cc276476e69e2496e728bf97b32d3b561d (diff)
downloadbusybox-41fea01066539ed8e958c21591a5fe7155565ceb.zip
busybox-41fea01066539ed8e958c21591a5fe7155565ceb.tar.gz
sendmail: stop doing -t unconditionally; makemime: generate 76 char base64 lines
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'mailutils/sendmail.c')
-rw-r--r--mailutils/sendmail.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/mailutils/sendmail.c b/mailutils/sendmail.c
index dbd4910..f96ca32 100644
--- a/mailutils/sendmail.c
+++ b/mailutils/sendmail.c
@@ -281,17 +281,19 @@ int sendmail_main(int argc UNUSED_PARAM, char **argv)
// analyze headers
// To: or Cc: headers add recipients
- if (0 == strncasecmp("To:", s, 3) || 0 == strncasecmp("Bcc:" + 1, s, 3)) {
- rcptto(sane_address(s+3));
- goto addheader;
+ if (opts & OPT_t) {
+ if (0 == strncasecmp("To:", s, 3) || 0 == strncasecmp("Bcc:" + 1, s, 3)) {
+ rcptto(sane_address(s+3));
+ goto addheader;
+ }
+ // Bcc: header adds blind copy (hidden) recipient
+ if (0 == strncasecmp("Bcc:", s, 4)) {
+ rcptto(sane_address(s+4));
+ free(s);
+ continue; // N.B. Bcc: vanishes from headers!
+ }
}
- // Bcc: header adds blind copy (hidden) recipient
- if (0 == strncasecmp("Bcc:", s, 4)) {
- rcptto(sane_address(s+4));
- free(s);
- // N.B. Bcc: vanishes from headers!
- } else
- if (strchr(s, ':') || (list && skip_whitespace(s) != s)) {
+ if (strchr(s, ':') || (list && isspace(s))) {
// other headers go verbatim
// N.B. RFC2822 2.2.3 "Long Header Fields" allows for headers to occupy several lines.
// Continuation is denoted by prefixing additional lines with whitespace(s).