<div dir="ltr">As far as the sleep() thing goes, you may be running into this, from the 'man 3 sleep' man page:<div><br></div><div>   BUGS<br>          sleep()  may be implemented using SIGALRM; mixing calls to alarm(2) and<br>          sleep() is a bad idea.<br></div><div><br></div><div>I don't know how you'd fix it.  Hopefully this gives you a starting point.</div><div><br></div><div>Ralph Mitchell</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 29, 2021 at 4:11 PM Shawn Heisey <<a href="mailto:hobbit@elyograg.org">hobbit@elyograg.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Over ten years ago, I asked on this list how I could get rid of the <br>
"incorrect pipelining message" logged by postfix every time the smtp, <br>
smtps, or submission tests are done.<br>
<br>
<a href="https://lists.xymon.com/oldarchive/2010/11/msg00207.html" rel="noreferrer" target="_blank">https://lists.xymon.com/oldarchive/2010/11/msg00207.html</a><br>
<br>
The fix that I claim worked (multiple send commands) was for a job I had <br>
at the time.  Now I am have a personal mail server (that also runs <br>
xymon) and that fix I mentioned so long ago is not working.<br>
<br>
I tweaked the code to allow a "pause" action in protocols.cfg and after <br>
modifying protocols.cfg to utilize it, I have eliminated the "incorrect <br>
command pipelining" message in mail.log.  Here's the patch:<br>
<br>
--- xymon-4.3.28/lib/netservices.c      2017-01-05 19:00:06.000000000 -0700<br>
+++ pause-xymon-4.3.28/lib/netservices.c        2021-05-29 <br>
12:51:09.717461323 -0600<br>
@@ -259,6 +259,10 @@<br>
                                 }<br>
                         }<br>
                 }<br>
+               else if (strncmp(l, "pause ", 6) == 0) {<br>
+                       int pausetime = atoi(skipwhitespace(l+5));<br>
+                       sleep(pausetime);<br>
+               }<br>
         }<br>
<br>
         if (fd) stackfclose(fd);<br>
<br>
Here's the new definitions I created in protocols.cfg:<br>
<br>
[smtp]<br>
    pause 2<br>
    send "ehlo xymonnet.localdomain\r\n"<br>
    pause 2<br>
    send "mail\r\n"<br>
    pause 2<br>
    send "quit\r\n"<br>
    expect "220"<br>
    options banner<br>
    port 25<br>
<br>
[smtps]<br>
    pause 2<br>
    send "ehlo xymonnet.localdomain\r\n"<br>
    pause 2<br>
    send "mail\r\n"<br>
    pause 2<br>
    send "quit\r\n"<br>
    expect "220"<br>
    options ssl,banner<br>
#  No default port-number assignment for smtps - nonstandard according <br>
to IANA<br>
<br>
[submission|msa]<br>
    pause 2<br>
    send "ehlo xymonnet.localdomain\r\n"<br>
    pause 2<br>
    send "mail\r\n"<br>
    pause 2<br>
    send "quit\r\n"<br>
    expect "220"<br>
    options banner<br>
    port 587<br>
<br>
<br>
And this is now what I see in mail.log (testing smtps and submission:<br>
<br>
May 29 13:51:15 bilbo postfix/submission/smtpd[16324]: connect from <br>
<a href="http://bilbo.elyograg.org" rel="noreferrer" target="_blank">bilbo.elyograg.org</a>[172.31.8.104]<br>
May 29 13:51:15 bilbo postfix/submission/smtpd[16324]: disconnect from <br>
<a href="http://bilbo.elyograg.org" rel="noreferrer" target="_blank">bilbo.elyograg.org</a>[172.31.8.104] quit=1 commands=1<br>
May 29 13:51:15 bilbo postfix/smtps/smtpd[16325]: connect from <br>
<a href="http://bilbo.elyograg.org" rel="noreferrer" target="_blank">bilbo.elyograg.org</a>[172.31.8.104]<br>
May 29 13:51:15 bilbo postfix/smtps/smtpd[16325]: disconnect from <br>
<a href="http://bilbo.elyograg.org" rel="noreferrer" target="_blank">bilbo.elyograg.org</a>[172.31.8.104] quit=1 commands=1<br>
<br>
Interesting thing here is that it's not actually pausing.  Which <br>
probably means that I implemented it incorrectly.  My training on C is <br>
ancient and I'm very rusty.  But even though it doesn't pause, the error <br>
is gone, simply because each smtp command is now sent in a separate <br>
packet, which appears to *sometimes* be enough "delay" for postfix to <br>
not complain about pipelining.  What happens now is occasionally I will <br>
get a yellow status on smtps with the xymon UI saying "Service smtps on <br>
<a href="http://bilbo.elyograg.org" rel="noreferrer" target="_blank">bilbo.elyograg.org</a> is not OK : Unexpected service response".<br>
<br>
So I think what I will do before submitting a patch is implement a <br>
"null" action (which will do nothing) as well as a "pause" action, and <br>
get some help from the real C developers here for making "pause" behave <br>
as advertised.  Can somebody point me to some instructions on properly <br>
creating and submitting a patch?  Also, if I could get some info on any <br>
other files I need to modify (man pages, readme files, etc), I would <br>
really appreciate it.<br>
<br>
Thanks,<br>
Shawn<br>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</blockquote></div>