aboutsummaryrefslogtreecommitdiffstats
path: root/smtp.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2003-08-06 04:31:11 +0000
committerEric S. Raymond <esr@thyrsus.com>2003-08-06 04:31:11 +0000
commit2cec9def937bc3f3b08ca1afeb9cf80413d8e4b4 (patch)
tree429c386abc29ea48315c00ef69062ca453f2679b /smtp.c
parenta5a7f5681a22b4e3fbdd0c4261af38cb1c064490 (diff)
downloadfetchmail-2cec9def937bc3f3b08ca1afeb9cf80413d8e4b4.tar.gz
fetchmail-2cec9def937bc3f3b08ca1afeb9cf80413d8e4b4.tar.bz2
fetchmail-2cec9def937bc3f3b08ca1afeb9cf80413d8e4b4.zip
Ready to ship.
svn path=/trunk/; revision=3831
Diffstat (limited to 'smtp.c')
-rw-r--r--smtp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/smtp.c b/smtp.c
index c3fdaa68..fd987950 100644
--- a/smtp.c
+++ b/smtp.c
@@ -87,7 +87,7 @@ static void SMTP_auth(int sock, char *username, char *password, char *buf)
SockPrintf(sock, "AUTH CRAM-MD5\r\n");
SockRead(sock, smtp_response, sizeof(smtp_response) - 1);
strncpy(tmp, smtp_response, sizeof(tmp));
- tmp[sizeof(tmp)-1] == '\0';
+ tmp[sizeof(tmp)-1] = '\0';
if (strncmp(tmp, "334 ", 4)) { /* Server rejects AUTH */
SMTP_auth_error(sock, GT_("Server rejected the AUTH command.\n"));
@@ -147,7 +147,7 @@ static void SMTP_auth(int sock, char *username, char *password, char *buf)
SockPrintf(sock, "AUTH LOGIN\r\n");
SockRead(sock, smtp_response, sizeof(smtp_response) - 1);
strncpy(tmp, smtp_response, sizeof(tmp));
- tmp[sizeof(tmp)-1] == '\0';
+ tmp[sizeof(tmp)-1] = '\0';
if (strncmp(tmp, "334 ", 4)) { /* Server rejects AUTH */
SMTP_auth_error(sock, GT_("Server rejected the AUTH command.\n"));
@@ -164,7 +164,7 @@ static void SMTP_auth(int sock, char *username, char *password, char *buf)
SockPrintf(sock, "%s\r\n", b64buf);
SockRead(sock, smtp_response, sizeof(smtp_response) - 1);
strncpy(tmp, smtp_response, sizeof(tmp));
- tmp[sizeof(tmp)-1] == '\0';
+ tmp[sizeof(tmp)-1] = '\0';
p = strchr(tmp, ' ');
if (!p) {
SMTP_auth_error(sock, GT_("Bad base64 reply from server.\n"));
@@ -213,7 +213,7 @@ int SMTP_ehlo(int sock, const char *host, char *name, char *password, int *opt)
*opt |= hp->value;
if (strncmp(hp->name, "AUTH ", 5) == 0)
strncpy(auth_response, smtp_response, sizeof(auth_response));
- auth_response[sizeof(auth_response)-1] == '\0';
+ auth_response[sizeof(auth_response)-1] = '\0';
}
if ((smtp_response[0] == '1' || smtp_response[0] == '2' || smtp_response[0] == '3') && smtp_response[3] == ' ') {
if (*opt & ESMTP_AUTH)
@@ -327,6 +327,8 @@ int SMTP_eom(int sock)
return ok;
}
+time_t last_smtp_ok = 0;
+
int SMTP_ok(int sock)
/* returns status of SMTP connection */
{
@@ -360,6 +362,8 @@ int SMTP_ok(int sock)
return SM_UNRECOVERABLE;
}
+ last_smtp_ok = time((time_t *) NULL);
+
if ((smtp_response[0] == '1' || smtp_response[0] == '2' || smtp_response[0] == '3') &&
smtp_response[3] == ' ')
return SM_OK;