[hobbit] hobbit-mailack questions

ZanDAhaR allan at zandahar.net
Tue Mar 21 23:19:07 CET 2006


Henrik Stoerner wrote:
> On Tue, Mar 21, 2006 at 11:55:56AM +1100, ZanDAhaR wrote:
>
>   
>> Obviously sms has no subject so I am just wondering how the mailack 
>> would work when recieving a message back ? By default does it look for 
>> the ACK code only in the subject or does it also look in the body ? If 
>> by default it only looks in the subject is it possible for us to bodge 
>> up the code and tell it to read from the body & subject, or just the body ?
>>     
>
> Currently, it only looks in the subject for the ack code.
>
> You can change that. Try this patch against the hobbit-mailack.c file:
> Save it to a file, then run 
>    patch hobbitd/hobbit-mailack.c </tmp/ack-body.patch
> and re-compile with "make".
>
> With this patch, you should be able to put a line into the message 
> body with
>    ack 129102
> which is the ack code that is normally taken from the subject. You
> can also put a
>    delay=120
> to make the ack valid for 120 minutes.
>
> The first line which does not match either of these is taken a the
> ack message which is displayed on the webpage.
>
>
> Regards,
> Henrik
>
>   
> ------------------------------------------------------------------------
>
> --- hobbitd/hobbit-mailack.c	2005/07/16 09:53:14	1.10
> +++ hobbitd/hobbit-mailack.c	2006/03/21 06:40:59
> @@ -64,8 +64,14 @@
>  				duration = durationvalue(inbuf+6);
>  				continue;
>  			}
> -			/* Save the first line of the message body, but ignore blank lines */
> +			else if ((subjectline == NULL) && (strncasecmp(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: Hobbit [%s]", inbuf+4);
> +			}
>  			else if (*inbuf && !firsttxtline) {
> +				/* Save the first line of the message body, but ignore blank lines */
>  				firsttxtline = strdup(inbuf);
>  			}
>  
>
>   
> ------------------------------------------------------------------------
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
>   
Henrik I'm guessing by the timestamp on the patch file that you only 
just created this patch after I mailed about it ?

If so I cannot thank you enough and I'm sure many others will also. Your 
constant work effort and dedication to hobbit is excellent :)

Allan Spencer
Corporate Learning Systems
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20060322/6da860b4/attachment.html>


More information about the Xymon mailing list