Source-

Special Build-

August 11, 2008

Project Dead

The sad news is the project is dead.

The project has met my purposes of expanding my abilities and understanding of computer programming. I have learned a lot of things and will continue to try and develop new applications to show the world. I have many other projects that I hope to work on and share.

If you would like to take over or add to the project, feel free to let me know and I'll be happy to provide links to the new website...or simply put your source code here on my site.

If you ever have any questions about the code, please let me know and I'll try and lend a hand!



March 23, 2008

Today, I added the all important time out feature.

In the process I discovered several bugs. For example if you type the Mail from: command then you type something like Mail To: It'll think it is the same thing. So thats a bug I've found.

I also feel the code needs some major cleaning up.

Anyways BL4's SMTP Server V0.1.10 is up and running. I didn't see any other bugs or major fixes needed. Enjoy and good luck ;-)



March 2, 2008

Well, I am trying to revive the projects that are incomplete or at least bring back their source code for your enjoyment.

BL4's SMTP Server is back. BL4's SMTP server served as my email server for about a year. At which time I lost interest due to life events. Well, now its making a come back!

Bl4's SMTP server V0.1.9R was completeled in November 2006. I am hoping to work on a new release to come out sometime by the end of March 2008.

BL4's SMTP server. V0.1.7 - V0.1.9R Readme notes:

Versions 0.1.7, 0.1.8, and 0.1.9 are not released. Versions 0.1.7, 0.1.8, and 0.1.9 involve work on a new function that is yet to be spoken of. I found that a function that someone had asked for had actually been implemented during my work, so I thought I would cut out most of the unstable/horrible code, and make the release 0.1.9R. Yay, another special release.

Changes for this version: -Added the ability to run a script when each email is received. The script resides in the same directy as ./smtp. The program runs ./script (file name of email). For example, the server just received f242.txt, the server would the run ./script f242.txt.

April 7, 2006
Alright, new changes have come. I believe that the incoming SMTP server is becoming a very usuable thing now. I have lots of new features I have added. Yes, lots of cools stuff. I have released the BL4smtp-0.1.5 version now. This is one of the best versions yet. I also released a varient of the version, known as BL4smtp-0.1.5-mpkg. The mpkg version has it set only to receive mail from specified users and receive mail to specified users.

BL4smtp-0.1.5 has the following new developments from V0.1.3. Added helpful information to the readme; Added a file to edit instead of using a hardcoded value for domains; added the ability to receive mail for multiple domains; Added different debug output levels; Added easier access to changing the server name; Added the ability to have the server run as a different user than root if started as root.

Both of these versions are being put online as of today. As for future work, I will be adding more code to the inbound server to make it follow the SMTP specs further. I will also be writing a seperate outgoing SMTP server. Then at some future point I will add the ability to sort and manage the incoming mail, instead of just leaving everything in little files everywhere.

April 6, 2006
Ah, many new changes are coming to the SMTP server.

What I added in the past little bit.

Modified results that are printed to TXT file to all have \r\n and the end of line.
-Ahhh, what a nasty little error. Now things look much better :-). They are also now consistent through the entire file.

Added Comments
-Yes, sadly, it was in dire need of comments. I hope they make sense to someone out there besides just myself.

Changed server responses to be more user friendly
-One or two of my response were rather rude. Yes, rather rude. Well, I modified those so they aren't such a thorn in your side. Oh how I will miss them. I really like having my server just say NO. No explanation, nothing. Oh well. :-(

Added RFC 2821 for more information regarding the SMTP protocol.
-This is mainly for anyone who downloads my program at the current time. I figured it might be helpful to have all the information I based the server off of. Now its all in one spot.

Removed the hardcoded value of 10 connections at once. Set the number of connections to a defined value in smtp.h.
-This by far is the biggest and best change for the SMTP server. Now you can specify the number of connections just by modifying one spot in the text.

February 16, 2006
An update for the BL4smtp server project.

I have added my project to the freshmeat project under BL4smtp.

I have also added the daemonize command to the server. The server will now deamonize. I have added the readme file, which currently contains the newest version info and the updates I am currently planning on making. The next obvious step is to remove the hardcoded values and either use a configuration file, or something smiliar to it.

January 24, 2006
Well, it took me a little longer to get things online. I got my smtp server to a beta version I suppose... At anyrate, its like a big garbage can. It accepts mail from anyone, and doesn't send anything out. It will only accept mail for a hardcoded domain at the current time. Yes, I know, it is horrible, and some other hard coded things are horrible to. Well deal with it.

Anyways, I thought I would post the code online so everybody can check it out, steal(I mean use) it, and make it better. I haven't spent a huge amount of time on it, but it has been fun so far. I'm sure better versions will come out soon....er...or later. At anyrate, you can download the source listed above.

January 12, 2006
I've been working on my SMTP server for my email server. I'm hoping I'll have a working alpha version by the end of the week. Considering I am working 8 hour shifts, I hope I can at least take a shot at working on it. I also need to get a grip at work...anyways, that belongs in another place.

Now for some technical details regarding my project. I used to have this Chat server that I was writing. Well, it could really use some improvements. Anyways, I stole that code to use for my SMTP server/client. Yes, it is crazy, but it'll work. I came up with this new crazy idea. I used to use multithreading, but I thought, I wonder if I can do this project without threads. For a low memory deally bob thing.

Anyways, I discovered something new about sockets today. I used to have a socket that would sit there, until I got a connection. Then I would thread it out, and close the listening socket. Then I would start another socket listening on the port again. Does this sound absurd...well, not at the time I wrote it.

Writing server software, is a new thing to me. What I found was that I could simply use the poll(blah, blah, blah); function. I would poll the listening thread, whenever I cared to, to see if it has any available connections. Then, if there is, I would pawn it off to another socket, and keep listening.

What a novel idea. Well, I bet someone has done it before me, but it is new to me. I hope it helps someone else out there. Anyways, once the project is a bit further along...like it can receive messages via smtp, then I'll post the "commented" code up. It'll be great I tell you. Well, the comments.

Anyways, here is some stuff I did using telnet today, rather interesting. I won't really take the time to make it a useful format, just cut and paste.

Bizzare1:~ Bl4QKUBARTNNDFHR$ telnet -K 
telnet> toggle crlf
Will send carriage returns as telnet <CR><LF>.
telnet> open 198.60.22.221 25
Trying 198.60.22.221...
Connected to mx.xmission.com.
Escape character is '^]'.
EHLO220 mgr6.xmission.com ESMTP Exim 4.50 Thu, 12 Jan 2006 17:27:50 -0700
 bar.com
250-mgr6.xmission.com Hello 3-1-21.ore.fiber.net [209.90.103.22]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250 HELP
250 HELP
500 unrecognized command
HELP
214-Commands supported:
214 AUTH STARTTLS HELO EHLO MAIL RCPT DATA NOOP QUIT RSET HELP
NOOP
250 OK
QIT
500 unrecognized command
QUIT
221 mgr6.xmission.com closing connection
Connection closed by foreign host.
Bizzare1:~ Bl4QKUBARTNNDFHR$ telnet -K 
telnet> open open 198.60.22.221 25
usage: open [-l user] [-a] [-s src_addr] host-name [port]
telnet> toggle crlf          
Will send carriage returns as telnet <CR><LF>.
telnet> open 209.90.125.254 25
Trying 209.90.125.254...
Connected to mailfilter.fiber.net.
Escape character is '^]'.
220 mailfilter1.fiber.net ESMTP Sendmail 8.13.5/8.13.4; Thu, 12 Jan 2006 17:30:23 -0700 (MST)
EHLO yahoo.com
250-mailfilter1.fiber.net Hello 3-1-21.ore.fiber.net [209.90.103.22], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 20971520
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
MAIL FROM:<bl4qkubartnndfhr@yahoo.com>
250 2.1.0 <bl4qkubartnndfhr@yahoo.com>... Sender ok
RCPT TO:<bl4qkubartnndfhr@fiber.net>
250 2.1.5 <bl4qkubartnndfhr@fiber.net>... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Testing
.
250 2.0.0 k0D0UNde066693 Message accepted for delivery
quit
221 2.0.0 mailfilter1.fiber.net closing connection
Connection closed by foreign host.
Bizzare1:~ Bl4QKUBARTNNDFHR$ telnet -K 
telnet> toggle crlf
Will send carriage returns as telnet <CR><LF>.
telnet> open 64.156.215.5 25
Trying 64.156.215.5...
Connected to mta-v20.level3.mail.yahoo.com.
Escape character is '^]'.
220 mta135.mail.scd.yahoo.com ESMTP YSmtp service ready
EHLO 209.90.103.22
250-mta135.mail.scd.yahoo.com
250-8BITMIME
250-SIZE 31981568
250 PIPELINING
HELP
250 OK.  Yahoo! MTA
MAIL FROM:<postmaster@209.90.103.22>
250 sender <postmaster@209.90.103.22> ok
RCPT TO:<bl4qkubartnndfhr@yahoo.com>
250 recipient <bl4qkubartnndfhr@yahoo.com> ok
DATA
354 go ahead
test test test
test test
.
451 mta135.mail.scd.yahoo.com Resources temporarily unavailable. Please try again later [#4.16.5].
RSET
250 reset ok
QUIT
221 mta135.mail.scd.yahoo.com
Connection closed by foreign host.
Bizzare1:~ Bl4QKUBARTNNDFHR$ mail
No mail for Bl4QKUBARTNNDFHR
Bizzare1:~ Bl4QKUBARTNNDFHR$ telnet -K 
telnet> toggle crlf
Will send carriage returns as telnet <CR><LF>.
telnet> open 209.90.125.254 25
Trying 209.90.125.254...
telnet: connect to address 209.90.125.254: Connection refused
telnet: Unable to connect to remote host
telnet> open 209.90.103.22 25
Trying 209.90.103.22...
^C
Bizzare1:~ Bl4QKUBARTNNDFHR$ telnet -K 
telnet> toggle clrf
'clrf': unknown argument ('toggle ?' for help).
telnet> toggle crlf
Will send carriage returns as telnet <CR><LF>.
telnet> open 64.156.215.5 25
Trying 64.156.215.5...
^C
Bizzare1:~ Bl4QKUBARTNNDFHR$ telnet -K 
telnet> toggle clrf
'clrf': unknown argument ('toggle ?' for help).
telnet> toggle crlf
Will send carriage returns as telnet <CR><LF>.
telnet> opne 64.156.215.5 25
?Invalid command
telnet> open 64.156.215.5 25
Trying 64.156.215.5...
Connected to mta-v20.level3.mail.yahoo.com.
Escape character is '^]'.
220 mta131.mail.scd.yahoo.com ESMTP YSmtp service ready
EHLO 209.90.103.22     
250-mta131.mail.scd.yahoo.com
250-8BITMIME
250-SIZE 31981568
250 PIPELINING
MAIL FROM:<postmaster@209.90.103.22
501 Syntax error in parameters or arguments
RSET
250 reset ok
MAIL FROM:<postmaster@209.90.103.22
501 Syntax error in parameters or arguments
RSET    
250 reset ok
MAIL FROM:<postmaster@209.90.103.22>
250 sender <postmaster@209.90.103.22> ok
RCPT TO:<bl4qkubartnndfhr@yahoo.com>
250 recipient <bl4qkubartnndfhr@yahoo.com> ok
DATA
354 go ahead
FROM: "dude" <postmaster@209.90.103.22>
TO: "dude" <bl4qkubartnndfhr@yahoo.com>
Subject: Hello!
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hello, this is great, isn't it?

Well, I hope this isn't too much of a bother.  
I did work very hard on this one.  Hopefully I've got it right!

.
250 ok dirdel
quit
221 mta131.mail.scd.yahoo.com
Connection closed by foreign host.