SMTPMan is a mail server coded in Perl. It is slightly different from a normal mail server as it is completely dependant upon user input. The post master will be required at the terminal whenever the organisation is to receive its mail.
Note, the colouring does not show up in this example
[root@server ~]# ./smtpman.pl
smtpman - The MANual SMTP Server v0.1
ryandoyle.net - 2009
Opening socket...
Socket created. Listening for new SMTP connections on port 2500
At any time if you want to end the connection, send a 5XX error
(part of SMTP) such as 554 to gracefully end the SMTP conversation
or send KILL (smtpman specific) to sever the TCP connection
***A new client has connected!***
Send a greeting banner. This needs to be atleast 220
and should also include the host name
EG: "220 mail.example.com"
smtp> 220 mai.example.net
EHLO [10.0.0.22]
Client is sending a EHLO (simmilar to a HELO). If you want to accept
its mail, send a 250 command
EG: "250 Hello outmail.example.net, hows it going??"
smtp> 250 hey I'm here, who are you sending to?
MAIL FROM:<danny@example.com>
Client wants to send an email from the address listed above. Make sure
that this email address is allowed to send email to your organisation
and send a 250 back
EG: "250 bob@example.net? got it."
smtp> 250 okay got it
RCPT TO:<somebody@example.net>
Client wants to send its email to the address listed above. Make sure
that this address exists in your organisation and send a 250 if you want
to receive it
EG: "250 alright got it. You can send to noni@example.com"
smtp> 250 yeah got that as well
DATA
Client wants to send data, send a 354
EG: "354 go ahead, end with . on a new line"
smtp> 354 okay give me the data
Message-ID: <4AC75A8A.6010001@example.com>
Date: Sun, 04 Oct 2009 00:07:06 +1000
From: somebody <danny@example.com>
User-Agent: Thunderbird 2.0.0.22 (Windows/20090605)
MIME-Version: 1.0
To: somebody@example.net
Subject: This is the subject
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Humm, it seems a bit slow sending emails... Maybe example.net is running
SMTPMAN!
End of message, send a 250 to the client to confirm
EG: "250 okay got the email"
smtp> 250 yeah I got the message
QUIT
Client wants to quit the connection, send a 250 to confirm
EG: "250 ending connection now"
smtp> 250 signing off
Do you want to save the data from the email? (y/n)
Save? y
Message saved to 1254581258.msg
*** Socket Closed ***!
Waiting for new client...
If for some reason you want to use SMTPman, you can download it below
smtpman.pl
Once you have downloaded it, make it executable
chmod +x smtpman.pland run it
./smtpman.plI reccomend that you don't run it as root (or at all really) for obvious reasons. Now just sit back and wait for the mail to start coming in!
Page updated 4th Oct 2009