]> 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 c94ac31..8d778e5 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 {
         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;
         }
             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"
         } 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;
         }
             sm_end (NOTOK);
             return RP_UCMD;
         }
index 2cd512a..c060a16 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: 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
 post: problem initializing server; [BHST] ready; I'll buy that for a dollar!
 send: message not delivered to anyone
 EOF
index 89c6e36..8d5391d 100755 (executable)
@@ -77,6 +77,8 @@ RSET
 QUIT
 EOF
 cat > "${testname}.expected.err" <<EOF
 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
 post: problem initializing server; [BHST] ready; I'll buy that for a dollar!
 send: message not delivered to anyone
 EOF