*/
#endif
-#define TRUE 1
-#define FALSE 0
-
#define NBITS ((sizeof (int)) * 8)
/*
if (sm_mts == MTS_SMTP)
return smtp_init (client, server, port, watch, verbose,
debug, sasl, saslmech, user, oauth_svc, tls);
- else
- return sendmail_init (client, watch, verbose, debug, sasl,
- saslmech, user);
+
+ return sendmail_init (client, watch, verbose, debug, sasl,
+ saslmech, user);
}
static int
} else {
client = LocalName(1); /* no clientname -> LocalName */
}
- }
-
- /*
- * Last-ditch check just in case client still isn't set to anything
- */
- if (client == NULL || *client == '\0')
- client = "localhost";
+ /*
+ * Last-ditch check just in case client still isn't set to anything
+ */
+ if (client == NULL || *client == '\0')
+ client = "localhost";
+ }
nsc = netsec_init();
client = clientname;
else
client = LocalName(1); /* no clientname -> LocalName */
- }
-
- /*
- * Last-ditch check just in case client still isn't set to anything
- */
- if (client == NULL || *client == '\0')
- client = "localhost";
+ /*
+ * Last-ditch check just in case client still isn't set to anything
+ */
+ if (client == NULL || *client == '\0')
+ client = "localhost";
+ }
nsc = netsec_init();
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;
}
} 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;
}
&errstr)) != NULL ; ) {
if (doingEHLO
- && strncmp (buffer, "250", sizeof("250") - 1) == 0
+ && HasPrefix(buffer, "250")
&& (buffer[3] == '-' || doingEHLO == 2)
&& buffer[4]) {
if (doingEHLO == 2) {
continue;
if (sm_reply.code < 100) {
if (sm_verbose) {
- printf ("%s\n", sm_reply.text);
+ puts(sm_reply.text);
fflush (stdout);
}
goto again;
for (ehlo = EHLOkeys; *ehlo; ehlo++) {
ep = *ehlo;
- if (strncmp (ep, s, len) == 0) {
+ if (HasPrefix(ep, s)) {
for (ep += len; *ep == ' '; ep++)
continue;
return ep;
return NOTOK;
}
- if (strncmp(line, "334 ", 4) != 0) {
+ if (!HasPrefix(line, "334 ")) {
netsec_err(errstr, "Improper SASL protocol response: %s", line);
return NOTOK;
}
if (line == NULL)
return NOTOK;
- if (strncmp(line, "235 ", 4) != 0) {
+ if (!HasPrefix(line, "235 ")) {
if (len > 4)
netsec_err(errstr, "Authentication failed: %s", line + 4);
else