Well,
I was gonna send you a small list of socket programming how tos'...
but seems you have that covered.
I believe you would just output your commands to the socket, since sendmail is a forcked process server that will spawn a child to handle your request, you should be able to interface directly to it and issue your commands... so try it via telnet.
bash-2.04$ telnet mail.domain.com 25
Trying 255.255.255.0...
Connected to mail.domain.com.
Escape character is ']'.
220 domain.com ESMTP Sendmail 8.11.0/8.11.0; Mon, 25 Mar 2002 12:07:26 -08
00 (PST)
help <- TYPE THAT IN AFTER CONNECTING
You'll get this:
214-2.0.0 This is sendmail version 8.11.0
214-2.0.0 Topics:
214-2.0.0 HELO EHLO MAIL RCPT DATA
214-2.0.0 RSET NOOP QUIT HELP VRFY
214-2.0.0 EXPN VERB ETRN DSN AUTH
214-2.0.0 STARTTLS
214-2.0.0 For more info use "HELP <topic>".
214-2.0.0 To report bugs in the implementation send email to
214-2.0.0 sendmail-bugs@sendmail.org.
214-2.0.0 For local information send email to Postmaster at your site.
214 2.0.0 End of HELP info
The moral of the story?
If you want info on a server, connect to it and make it talk to ya 🙂