* 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:
*/
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;
err = PS_SYNTAX;
}
+ set_timeout(0); /* cancel any pending alarm */
signal(SIGALRM, alrmsave);
signal(SIGPIPE, pipesave);
return(err);
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)
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)
/* 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++;
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;
if (msgblk.headers)
free(msgblk.headers);
free_str_list(&msgblk.recipients);
+ if (delivered_to)
+ free(delivered_to);
/* initially, no message ID */
if (ctl->thisid)
{
find_server_names(delivered_to, ctl, &msgblk.recipients);
free(delivered_to);
+ delivered_to = NULL;
}
else if (received_for)
/*