Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unix daemon that accepts multiple connections on a port 1

Status
Not open for further replies.

msc0tt

IS-IT--Management
Jun 25, 2002
281
CA
OK, Unix programmers...
I'm looking for some sample code for a stand-alone daemon that accepts multiple connections on a single port. Specifically, I need to write a quick "dummy" smtp server that always says "I'm busy - try again later." I know how to write on that runs from inetd, but in this case I need a stand alone one.
Any suggestions on where to look (besides Google)?

Note: for those that are asking why... When we get wind of an active Internet email virus, we take the precaution of killing our real mail daemon (Exim) until the threat has been assessed. During this down time, all our Outlook clients complain that the outbound smtp server is not responding (no kidding). My idea is that when I kill Exim, I start a dummy server to placate the clients in the interim.
 
It should be fairly easy to craft one of those.

Shows the basics of writing any server.
For SMTP, you listen on port 25

ftp://ftp.rfc-editor.org/in-notes/rfc2821.txt
This describes the SMTP protocol. All you need to do is send a '421 <domain> Service not available' code back to whoever tries to connect, then close that connection.



--
 
Thanks Salem,
Both urls refer to very helpful information! I'm on the coding trail.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top