you should implement a bare bone SMTP server (simple but not trivial...
it should understand at least some basic commands - HELO and so on, maybe you can skip ETRN :-)
)
have a look at NetServer::Generic for a very simple way of implementing a TCP sever..
Update just a question: do you whant to reject or discard incoming mail?