]> diplodocus.org Git - nmh/commitdiff
Output an error message from post(8) when user specifies
authorDavid Levine <levinedl@acm.org>
Tue, 18 Oct 2016 20:45:30 +0000 (16:45 -0400)
committerDavid Levine <levinedl@acm.org>
Tue, 18 Oct 2016 20:45:30 +0000 (16:45 -0400)
mhbuild -headerencoding utf-8 but the SMTP server doesn't
support SMTPUTF8.

mts/smtp/smtp.c
test/post/test-post-basic
test/post/test-rfc6531

index c94ac31308063d2de637c531b857779b5051bae3..8d778e5e93c4acbad2b34827ed4f4176091a56c6 100644 (file)
@@ -453,6 +453,9 @@ sm_winit (char *from, int smtputf8, int eightbit)
         if (EHLOset ("8BITMIME")  &&  EHLOset ("SMTPUTF8")) {
             mail_parameters = " BODY=8BITMIME SMTPUTF8";
         } else {
+            advise (NULL, "SMTP server does not support %s, not sending.\n"
+                    "Rebuild message with 7-bit headers, WITHOUT -headerencoding utf-8.",
+                    EHLOset ("SMTPUTF8") ? "8BITMIME" : "SMTPUTF8");
             sm_end (NOTOK);
             return RP_UCMD;
         }
@@ -464,7 +467,7 @@ sm_winit (char *from, int smtputf8, int eightbit)
         } else {
             advise (NULL, "SMTP server does not support 8BITMIME, not sending.\n"
                     "Suggest encoding message for 7-bit transport by setting your\n"
-                    "locale to C, and/or specifying *b64 in mhbuild directives.\n");
+                    "locale to C, and/or specifying *b64 in mhbuild directives.");
             sm_end (NOTOK);
             return RP_UCMD;
         }
index 2cd512a62751b042cb3ac3fea84e3f90c4575f2b..c060a16e7e751978c9e9084dcd6b05325ea2cd31 100755 (executable)
@@ -132,7 +132,6 @@ cat > "${testname}.err.expected" <<EOF
 post: SMTP server does not support 8BITMIME, not sending.
 Suggest encoding message for 7-bit transport by setting your
 locale to C, and/or specifying *b64 in mhbuild directives.
-
 post: problem initializing server; [BHST] ready; I'll buy that for a dollar!
 send: message not delivered to anyone
 EOF
index 89c6e36db8cc0ccebdca4189afa93252cca41c2d..8d5391dc1a558eaade8e886e2dd1e941ea0bf70a 100755 (executable)
@@ -77,6 +77,8 @@ RSET
 QUIT
 EOF
 cat > "${testname}.expected.err" <<EOF
+post: SMTP server does not support SMTPUTF8, not sending.
+Rebuild message with 7-bit headers, WITHOUT -headerencoding utf-8.
 post: problem initializing server; [BHST] ready; I'll buy that for a dollar!
 send: message not delivered to anyone
 EOF