Xymon Mailing List Archive search

Mailack delay problems

list Henrik Størner
Mon, 7 Feb 2011 12:26:30 +0000 (UTC)
Message-Id: <iioodm$4k5$user-e356fad9864f@xymon.invalid>

Hi Johan

In <user-888445fd5188@xymon.invalid> =?iso-8859-1?Q?Johan_Sj=F6berg?= <user-74c177c1220d@xymon.invalid> writes:
I tested on another alert now, and it works if I remove the unnecessary par=
ts of the subject, for example if I change it to "Re: Hobbit [455503] delay=
=3D600". So maybe it's the subject that is too long or something when it is=
not working.
It's possible, but your subject line would have to be very long for this to 
fail - longer than 1 KB. Sounds a bit odd if that is really the case.

The attached diff removes this restriction, so if this solves the problem
I would like to know. I'll probably do this change anyway, since it is
a bit silly to have these random limits.


Regards,
Henrik

Index: xymond/xymon-mailack.c
===================================================================
--- xymond/xymon-mailack.c	(revision 6631)
+++ xymond/xymon-mailack.c	(working copy)
@@ -68,8 +68,8 @@
 			else if ((strncasecmp(STRBUF(inbuf), "ack=", 4) == 0) || (strncasecmp(STRBUF(inbuf), "ack ", 4) == 0)) {
 				/* Some systems cannot generate a subject. Allow them to ack
 				 * via text in the message body. */
-				subjectline = (char *)malloc(1024);
-				snprintf(subjectline, 1023, "Subject: Xymon [%s]", STRBUF(inbuf)+4);
+				subjectline = (char *)malloc(STRBUFLEN(inbuf) + 1024);
+				sprintf(subjectline, "Subject: Xymon [%s]", STRBUF(inbuf)+4);
 			}
 			else if (*STRBUF(inbuf) && !firsttxtline) {
 				/* Save the first line of the message body, but ignore blank lines */