X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/eca05e65abb3a1c9491c4294ab2600d2cec8615b..665dfc96:/mts/smtp/smtp.c?ds=sidebyside diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 77bcb6e5..b09fde33 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -1,5 +1,4 @@ -/* - * smtp.c -- nmh SMTP interface +/* smtp.c -- nmh SMTP interface * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for @@ -42,20 +41,16 @@ #define NBITS ((sizeof (int)) * 8) -/* - * these codes must all be different! - */ +/* Timeout in seconds for SMTP commands. + * Lore has it they must be distinct. */ #define SM_OPEN 300 /* Changed to 5 minutes to comply with a SHOULD in RFC 1123 */ #define SM_HELO 20 #define SM_RSET 15 #define SM_MAIL 301 /* changed to 5 minutes and a second (for uniqueness), see above */ #define SM_RCPT 302 /* see above */ #define SM_DATA 120 /* see above */ -#define SM_TEXT 180 /* see above */ #define SM_DOT 600 /* see above */ #define SM_QUIT 30 -#define SM_CLOS 10 -#define SM_AUTH 45 static int sm_addrs = 0; static int sm_child = NOTOK; @@ -457,7 +452,7 @@ 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" + inform("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); @@ -469,7 +464,7 @@ sm_winit (char *from, int smtputf8, int eightbit) if (EHLOset ("8BITMIME")) { mail_parameters = " BODY=8BITMIME"; } else { - advise (NULL, "SMTP server does not support 8BITMIME, not sending.\n" + inform("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."); sm_end (NOTOK); @@ -498,7 +493,7 @@ sm_wadr (char *mbox, char *host, char *path) { switch (smtalk (SM_RCPT, host && *host ? "RCPT TO:<%s%s@%s>" : "RCPT TO:<%s%s>", - path ? path : "", mbox, host)) { + FENDNULL(path), mbox, host)) { case 250: case 251: sm_addrs++; @@ -623,7 +618,8 @@ sm_end (int type) case NOTOK: sm_note.code = sm_reply.code; sm_note.length = sm_reply.length; - memcpy (sm_note.text, sm_reply.text, sm_reply.length + 1);/* fall */ + memcpy (sm_note.text, sm_reply.text, sm_reply.length + 1); + /* FALLTHRU */ case DONE: if (smtalk (SM_RSET, "RSET") == 250 && type == DONE) return RP_OK; @@ -764,7 +760,8 @@ sm_wstream (char *buffer, int len) if (netsec_write(nsc, ".", 1, &errstr) != OK) { sm_nerror(errstr); return NOTOK; - } /* FALL THROUGH */ + } + /* FALLTHRU */ default: sm_nl = FALSE;