I am just getting aquatinted with node.js. I was wondering if anyone has heard of or done some work on a simple email server with node.
I would like to set up an email to web system so that people with cell phones can email pictures to an address that will automatically update their blog.
Just wanted to ask here before I got to far down the path myself.
Thanks,
Terry Riegel
> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>
>
Although, do be wary and take note that doing email isn't an easy task.
Yours,
Micheil Smith
--
BrandedCode.com
So far I can send any email to it from osx Mail and it thinks it is talking to a real server.
One thing that threw me was when the callback for incoming data triggered I assumed it would fire for every line coming in, but it received the whole body before firing. So instead of checking for the first three characters to be .\r\n I have to check the last three characters.
Also something interesting I discovered with Apples Mail program. It keeps the connection alive after sending the message for 1-2 minutes, then it issues the quit to close.
Looks like node.js will make this task extremely easy. Loving it so far!
Terry Riegel
On Jul 20, 2010, at 6:23 PM, talltyler <tall...@gmail.com> wrote:
> Are you planning on open-sourcing your work? I wouldn't mind helping
> with this project if so. I run a few mailing list that I would love to
> switch over to something that I have a little more programatic control
> of.
Hopefully you're implementing this as a module and to the RFC's on the
SMTP / IMAP protocols. In which case, it'd be great if you could release
the module as open-source for others to use.
Yours,
Micheil Smith
--
BrandedCode.com
Yes, you need to write your own parser for the data. I like to think that the one I'm using in
node-websocket-server is a good example of one, and when I work on node-smtp-client
again, I'll be reimplementing it's parser in a similar way.
Link: http://github.com/miksago/node-websocket-server/blob/development/lib/ws/connection.js#L369-403
Yours,
Micheil Smith
--
BrandedCode.com
Next up is the parsing phase. Can't wait :)
I would like to convert any non-utf encodings to utf-8 as it comes in. So I will have to look up charsets with node.
You can send an email to it currently. Just address it to...
WhateverYouW...@mailer.youbelong.net
The full source code is available here...
http://youbelong.net/pages/start/nodeSMTP/email.html
The source is the live copy of what I am actively developing and what the server is currently running. So depending on when you try the source may have changed. There is a little triangle in the page that would allow you to view the change history.
node.js is cool!
Terry
Oh no! Doing It Wrong!
"git init" should be the first thing you do for any project. Stop
what you're doing right now, install git, and read through one of the
many "basic getting started" tutorials out there.
Use it diligently, and after a few months, you'll wonder how you ever
lived without it, I promise. If nothing else, it makes it WAY easier
to get feedback on your code. I even track my dot-files and websites
content/configs in git, so that I can roll back any change that causes
a problem, and push the content between machines easily.
But git isn't really about all that stuff.
Git is an editor that you use to write the ongoing biography of your
program. It's not really about controlling versions, or pushing
between servers, or even collaboration, though it does make those
tasks much simpler. It's about tracking information in a low-impact
way.
*Now* is the time to start tracking your decisions, in real time, as
you're experimenting and trying things out. The un-mature project
benefits *most* from added meta information! What good is a biography
that doesn't cover one's childhood?
If git is indeed the first version control system you've ever used,
then I envy you, sir, for you have much less cruft to unlearn.
--i
--
--
I'm rather new to Git but I must say it's great, particularly combined
with a powerful editor (Emacs) and a great add-on that knows how to
Git (It's Magit! [1]).
I've been happy with CVS for a while, then SVN for a while (definitely
wouldn't be happy with them now), then with Perforce. Currently I'm
happy with Mercurial but I must bow to the wonderfulness of Git and
I'm slowly moving my projects to it.
Anything is a lot better than no versioning at all, so whatever you
do, if you care about your code, and even if you don't, go for some
version control system.
Cheers,
-Mihai
[1] http://philjackson.github.com/magit/
--
Mihai Bazon,
http://mihai.bazon.net/blog
Anyway, good work :)
Yours,
Micheil Smith
--
BrandedCode.com
If I do this...
git push g...@github.com:riegel/node.js-SMTP-server.git
it works.
if I do this...
git push origin server
it fails with...
error: src refspec server does not match any.
error: failed to push some refs to 'g...@github.com:riegel/node.js-SMTP-server.git'
I thought this command...
git remote add origin g...@github.com:riegel/node.js-SMTP-server.git
setup the thing "origin" so that I could just do "push origin server" but I am getting an error. any ideas?
There must be a concept I am not getting.
Thanks,
Terry
if I do this...
git push origin server
it fails with...
error: src refspec server does not match any.
error: failed to push some refs to 'g...@github.com:riegel/node.js-SMTP-server.git'
--
http://www.python.org/download/
Email is a complicated beast, probably because it has been around for
ages and there are thousands of different implementations out there.
If you try to roll your own parser from scratch it will either a) take
you a very long time or b) be so full of bugs that it won't be useful
in real-world scenarios. A couple of things I like about Python's
email parser:
1) It's very forgiving. When dealing with email you need to be as
lenient as possible. If you read through the email/mime RFC's, they
talk about being forgiving all over the place. For example, section
2.1.1 of RFC 2822 suggests that email messages should not contain more
than 78 characters per line (plus the CRLF), but that they may contain
up to 998. A good email parser should be robust enough to accept
either one. This is just one small example.
2) It's a feed-style parser. This means that you can stream data to it
instead of buffering the whole message before you begin the parse. As
you probably know, this is what Node is all about. We prefer to stream
everything in Node to keep it as fast as possible and to keep the
memory footprint small.
Anyways, if you want a great example to follow (especially for Node),
there it is. The code is already there, so it should be relatively
easy to do a port.
Michael
--
Michael Jackson
http://mjijackson.com
@mjijackson
On Wed, Jul 21, 2010 at 7:45 AM, Terry Riegel
<rie...@clearimageonline.com> wrote:
> Ok here is the code for my rudimentary email server. Currently it accepts connections from everywhere. It will go through the motions but the email is dumped upon completion.
>
>
>
> Next up is the parsing phase. Can't wait :)
> I would like to convert any non-utf encodings to utf-8 as it comes in. So I will have to look up charsets with node.
>
>
>
> You can send an email to it currently. Just address it to...
> WhateverYouW...@mailer.youbelong.net
>
>
>
> The full source code is available here...
> http://youbelong.net/pages/start/nodeSMTP/email.html
>
>
>
> The source is the live copy of what I am actively developing and what the server is currently running. So depending on when you try the source may have changed. There is a little triangle in the page that would allow you to view the change history.
>
>
> node.js is cool!
>
>
>
> Terry
>
>
>
>
> On Jul 21, 2010, at 8:10 AM, Micheil Smith wrote:
>
>> Hi Terry,
>>
>> Yes, you need to write your own parser for the data. I like to think that the one I'm using in
>> node-websocket-server is a good example of one, and when I work on node-smtp-client
>> again, I'll be reimplementing it's parser in a similar way.
>>
>> Link: http://github.com/miksago/node-websocket-server/blob/development/lib/ws/connection.js#L369-403
>>
>> Yours,
>> Micheil Smith
>> --
>> BrandedCode.com
>>
>> On 21/07/2010, at 10:00 PM, Terry Riegel wrote:
>>
>>> Currently I am learning the node.js ropes so to speak so I don't have a lot of 'baggage' in what/how I have already done it. So I definitely can look at making it a module.
>>>
>>> I do have a question about the net module. When a on data event fires the data may be multiple lines long. Is there a way to have it fire after each line? Otherwise I have to split and then go through each line at a time. If the event fired for each line I could avoid that and possibly save buffering resources.
>>>
>>> Thanks,
>>>
>>> Terry
>>>
>>>
>>> On Jul 21, 2010, at 12:11 AM, Stephen Belanger wrote:
>>>
>>>> I would certainly appreciate an open-source email server. If one isn't made by someone else, I'll have to make one myself for work before too long. :)
>>>>
>>>> On Tue, Jul 20, 2010 at 8:23 PM, Micheil Smith <mic...@brandedcode.com> wrote:
>>>> Hi Terry,
>>>>
>>>> Hopefully you're implementing this as a module and to the RFC's on the
>>>> SMTP / IMAP protocols. In which case, it'd be great if you could release
>>>> the module as open-source for others to use.
>>>>
>>>> Yours,
>>>> Micheil Smith
>>>> --
>>>> BrandedCode.com
>>>>
>>>> On 21/07/2010, at 11:34 AM, Terry Riegel wrote:
>>>>
>>>>> I have the server running it will accept an email. It echos what comes in and what it sends to the console.
>>>>>
>>>>> So far I can send any email to it from osx Mail and it thinks it is talking to a real server.
>>>>>
>>>>> One thing that threw me was when the callback for incoming data triggered I assumed it would fire for every line coming in, but it received the whole body before firing. So instead of checking for the first three characters to be .\r\n I have to check the last three characters.
>>>>>
>>>>> Also something interesting I discovered with Apples Mail program. It keeps the connection alive after sending the message for 1-2 minutes, then it issues the quit to close.
>>>>>
>>>>> Looks like node.js will make this task extremely easy. Loving it so far!
>>>>>
>>>>> Terry Riegel
>>>>>
>>>>>
>>>>> On Jul 20, 2010, at 6:23 PM, talltyler <tall...@gmail.com> wrote:
>>>>>
>>>>>> Are you planning on open-sourcing your work? I wouldn't mind helping
>>>>>> with this project if so. I run a few mailing list that I would love to
>>>>>> switch over to something that I have a little more programatic control
>>>>>> of.
>>>>>>
>>>>>> On Jul 20, 2:48 pm, Terry Riegel <rie...@clearimageonline.com> wrote:
>>>>>>> Hello,
>>>>>>>
>>>>>>> I am just getting aquatinted with node.js. I was wondering if anyone has heard of or done some work on a simple email server with node.
>>>>>>>
>>>>>>> I would like to set up an email to web system so that people with cell phones can email pictures to an address that will automatically update their blog.
>>>>>>>
>>>>>>> Just wanted to ask here before I got to far down the path myself.
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Terry Riegel
>>>>>
Terry