If you still want to build your own protocol after reading merlyn's post...
in reply to creating a state machine
POE Cookbook have many examples and you can always look on source code of existing POE components. Since your protocol is close to SMTP then source code of POE::Component::Server::SMTP is probably the best example.
Ilya Martynov, firstname.lastname@example.org
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org