Sorry, my answer was probably a bit fast.
You might prefer something like this:
esmtp = strstr(buffer, "ESMTP") != NULL && strstr(buffer, "Mercury") == NULL;
"Mercury" should be replaced by something that is specific for the
greeting of your Mercury server.
Greetings,
Georg
--
*** Exim information can be found at
http://www.exim.org/ ***