From caef674e29106c14aae5e77d82e6c3ab052d3d3b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 31 Oct 2002 13:38:29 +0000 Subject: Sunil Shetye's minor fixes. svn path=/trunk/; revision=3762 --- sink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sink.c') 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++; -- cgit v1.2.3