aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--driver.c5
-rw-r--r--sink.c7
-rw-r--r--transact.c6
4 files changed, 15 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 6523deb3..2e54e93e 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@
* Jan Klaverstijn's verbosity-lowering patch.
* Updated Turkish, German, Catalan, and Danish translation files.
* Fix processing of POP3 messages with missing bodies.
+* Minor fixes by Sunil Shetye: fix generation of auth fail note, handle
+ unexpected SIGALRM, plug memory leak, handle lines beginning with '\0'.
fetchmail-6.1.1 (Fri Oct 18 14:53:51 EDT 2002), 22087 lines:
diff --git a/driver.c b/driver.c
index a0596ec0..ab441b74 100644
--- a/driver.c
+++ b/driver.c
@@ -1114,8 +1114,8 @@ const int maxfetch; /* maximum number of messages to fetch */
*/
if (run.poll_interval
&& !ctl->wehavesentauthnote
- && ((ctl->wehaveauthed && ++ctl->authfailcount == 10)
- || ++ctl->authfailcount == 3)
+ && ((ctl->wehaveauthed && ++ctl->authfailcount >= 10)
+ || (!ctl->wehaveauthed && ++ctl->authfailcount >= 3))
&& !open_warning_by_mail(ctl, (struct msgblk *)NULL))
{
ctl->wehavesentauthnote = 1;
@@ -1509,6 +1509,7 @@ closeUp:
err = PS_SYNTAX;
}
+ set_timeout(0); /* cancel any pending alarm */
signal(SIGALRM, alrmsave);
signal(SIGPIPE, pipesave);
return(err);
diff --git a/sink.c b/sink.c
index 5ac588cb..5f484b17 100644
--- a/sink.c
+++ b/sink.c
@@ -263,6 +263,7 @@ static int send_bouncemail(struct query *ctl, struct msgblk *msg,
char daemon_name[18 + HOSTLEN] = "FETCHMAIL-DAEMON@";
char boundary[BUFSIZ], *bounce_to;
int sock;
+ static char *fqdn_of_host = NULL;
/* don't bounce in reply to undeliverable bounces */
if (!msg->return_path[0] || strcmp(msg->return_path, "<>") == 0)
@@ -273,7 +274,9 @@ static int send_bouncemail(struct query *ctl, struct msgblk *msg,
SMTP_setmode(SMTP_MODE);
/* can't just use fetchmailhost here, it might be localhost */
- strcat(daemon_name, host_fqdn());
+ if (fqdn_of_host == NULL)
+ fqdn_of_host = host_fqdn();
+ strcat(daemon_name, fqdn_of_host);
/* we need only SMTP for this purpose */
if ((sock = SockOpen("localhost", SMTP_PORT, NULL, NULL)) == -1)
@@ -584,7 +587,7 @@ int stuffline(struct query *ctl, char *buf)
/* The line may contain NUL characters. Find the last char to use
* -- the real line termination is the sequence "\n\0".
*/
- last = buf;
+ last = buf + 1; /* last[-1] must be valid! */
while ((last += strlen(last)) && (last[-1] != '\n'))
last++;
diff --git a/transact.c b/transact.c
index 10731986..5ddcba99 100644
--- a/transact.c
+++ b/transact.c
@@ -365,7 +365,8 @@ int readheaders(int sock,
int from_offs, reply_to_offs, resent_from_offs;
int app_from_offs, sender_offs, resent_sender_offs;
int env_offs;
- char *received_for, *rcv, *cp, *delivered_to;
+ char *received_for, *rcv, *cp;
+ static char *delivered_to = NULL;
int n, linelen, oldlen, ch, remaining, skipcount;
struct idlist *idp;
flag no_local_matches = FALSE;
@@ -390,6 +391,8 @@ int readheaders(int sock,
if (msgblk.headers)
free(msgblk.headers);
free_str_list(&msgblk.recipients);
+ if (delivered_to)
+ free(delivered_to);
/* initially, no message ID */
if (ctl->thisid)
@@ -955,6 +958,7 @@ int readheaders(int sock,
{
find_server_names(delivered_to, ctl, &msgblk.recipients);
free(delivered_to);
+ delivered_to = NULL;
}
else if (received_for)
/*