Possibly for a good reason - I expect to get slapped by Henrik... :)<br><br>Ralph<br><br><br><div class="gmail_quote">On Wed, Jul 9, 2008 at 8:13 PM, Phil Wild <<a href="mailto:philwild@gmail.com">philwild@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Ralph,</div>
<div> </div>
<div>Well done....</div>
<div> </div>
<div>This is not documented in the man page...</div>
<div> </div>
<div>Cheers</div>
<div> </div>
<div>Phil<br><br></div>
<div class="gmail_quote">2008/7/10 Ralph Mitchell <<a href="mailto:ralphmitchell@gmail.com" target="_blank">ralphmitchell@gmail.com</a>>:<div><div></div><div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div>On Wed, Jun 25, 2008 at 7:44 PM, Allan Spencer <<a href="mailto:allan@zandahar.net" target="_blank">allan@zandahar.net</a>> wrote:<br></div>
<div class="gmail_quote">
<div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">HI all<br><br>A LONG time ago I asked about ack'ing an alert via email (or via sms-to-email) and to be able to do so without a subject. A patch was written at the time and it was included into the main codebase but unfortunately I did not get a chance to imeplement what I wanted to and never ended up testing it. Thats has just changed recently and now I am having issues acking an alert via text in the body.<br>

<br>If i reply to an email and maintain the subject it works fine, if I try cut the subject and paste it as the body nothing happens. I havent gone as far as testing it via the sms-to-email app yet as I cant get it working from a normal email.</blockquote>

</div>
<div><br><br>The hobbit-mailack.c program loops through the incoming email, looking for interesting stuff.  Here's where it finds the subject line:<br><br>     else if (strncasecmp(STRBUF(inbuf), "subject:", 8) == 0) <br>

         subjectline = strdup(skipwhitespace(STRBUF(inbuf)+8));<br> <br></div></div>Once the headers are done with, it goes on to look for some things in the email body, such as "delay=" and "ack=":<br>

<br>     else if ((strncasecmp(STRBUF(inbuf), "ack=", 4) == 0) || <br>                (strncasecmp(STRBUF(inbuf), "ack ", 4) == 0)) {<br>                                /* Some systems cannot generate a subject. Allow them to ack<br>

                                 * via text in the message body. */<br>                                subjectline = (char *)malloc(1024);<br>                                snprintf(subjectline, 1023, "Subject: Hobbit [%s]", STRBUF(inbuf)+4);<br>

                        }<br><br>So, does the email body contain a line that starts with "ack=NNNNNN" or "ack NNNNN"??  If not, it won't match the above code fragment.  It looks like it should be *just* the number, as that gets filled in between the square brackets in the faked subject line.<br>

<br>I noticed something else interesting in the code.  The last thing it does is call sendmessage, handing it a buffer loaded like this:<br><br>     p += sprintf(p, "hobbitdack %s %d %s", cookie, duration, firsttxtline);<br>

        if (fromline) {<br>           p += sprintf(p, "\nAcked by: %s", fromline);<br>        }<br><br>I figured it wouldn't hurt to try doing this:<br><br>     server/bin/bb localhost "hobbitdack NNNNNN 60 this thing is broken<br>

     Acked by: <a href="mailto:me@this.domain.com" target="_blank">me@this.domain.com</a>"<br><br>where NNNNNN came from a real, current warning message.  Note the placement of the double-quotes - there needs to be a newline between the message and "Acked by".  And now, just below the "Status unchanged in...." message at the bottom of the page I find this:<br>

<br>          <font style="color: rgb(0, 0, 0);" color="#87a9e5" size="-1"><font size="-1">Current acknowledgment: this thing is broken<br>               Acked by: <a href="mailto:me@this.domain.com" target="_blank">me@this.domain.com</a><br>

               Next update at: 12:54 2008-07-09<br><br>and there's a nice yellow check mark on the all-non-green page.  So it looks like an ACK *can* be sent via the command line...<br><br>Ralph<br><br></font></font></blockquote>

</div></div></div><br><br clear="all"><div><div></div><div class="Wj3C7c"><br>-- <br>Tel: 0400 466 952<br>Fax: 0433 123 226<br>email: philwild AT <a href="http://gmail.com" target="_blank">gmail.com</a> 
</div></div></blockquote></div><br>