[xymon] RE: Mailack delay problems
Henrik Størner
henrik at hswn.dk
Mon Feb 7 13:26:30 CET 2011
Hi Johan
In <B08F3F3D67451844A7A8A029FCC71E4C18DAA3E5FD at WIN01.ad.deltamanagement.se> =?iso-8859-1?Q?Johan_Sj=F6berg?= <johan.sjoberg at deltamanagement.se> 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 */
More information about the Xymon
mailing list