Smtp server

Hello,

I plan to implement a SMTP server for my project. I want to use Ruby, at
least for prototyping. But I wonder, can I use Ruby for the REAL thing?
What is the best performance (comparing to sendmail or qmail, for
example) I can expect for a pure ruby based smtp server?

Thanks a lot
Shannon

Hi Shannon,

Hello,

I plan to implement a SMTP server for my project. I want to use Ruby, at
least for prototyping. But I wonder, can I use Ruby for the REAL thing?
What is the best performance (comparing to sendmail or qmail, for
example) I can expect for a pure ruby based smtp server?

Why would you want to do that? If it is writing a toy implementation for
the pure learning experience, then I’d say go for it. If you want to use
it in production code on a real project, I’d think twice about diving into
it. SMTP seems simple, but is actually very hard to get right. I’d
look into integrating an existing server, like sendmail, possibly using
its milter interface to get at the internals that you need. Your time
would be better spent concentrating on your project’s unique properties
than opening up the SMTP can of worms.

Sorry, I redirected your thoughts instead of answering your questions, but
I think it is the right thing to do.

···

On Sun, 22 Dec 2002 19:07:09 +0900 Shannon Fang xrfang@hotmail.com wrote:

Thanks a lot
Shannon


“Daniel P. Zepeda” <daniel@z,e,p,e,d,a,-,z,o,n,e.net>
(Remove commas for address)

::dons his infosecurity hat::

SMTP is not easy to implement, the protocol itself is not too hard, but
the base protocol is no longer suitable for production use. You would
need to add some sort of system to configure the server so it is not an
open relay for anyone (read spammers) to use. You also would probably
want to have hooks to call different filtering routines (ie.
spamassassin or virusscanners) to be sure you aren’t relaying infected
or unwanted mail. Lastly you need to make sure it’s not like sendmail
and full of security holes waiting to be exploited since port 25 is on
ever portscanners checklist.

My recommendation would be to always if possible use Qmail (I know it’s
apain to configure at first, but it is bulletproof in security) for smtp
functions wherever possible. A good project might be to write a
configuration utility in ruby that handles wmail underneath…

Just the thoughts of a security admin.

Jason

Daniel P. Zepeda wrote:

···

Hi Shannon,

On Sun, 22 Dec 2002 19:07:09 +0900 >Shannon Fang xrfang@hotmail.com wrote:

Hello,

I plan to implement a SMTP server for my project. I want to use Ruby, at
least for prototyping. But I wonder, can I use Ruby for the REAL thing?
What is the best performance (comparing to sendmail or qmail, for
example) I can expect for a pure ruby based smtp server?

Why would you want to do that? If it is writing a toy implementation for
the pure learning experience, then I’d say go for it. If you want to use
it in production code on a real project, I’d think twice about diving into
it. SMTP seems simple, but is actually very hard to get right. I’d
look into integrating an existing server, like sendmail, possibly using
its milter interface to get at the internals that you need. Your time
would be better spent concentrating on your project’s unique properties
than opening up the SMTP can of worms.

Sorry, I redirected your thoughts instead of answering your questions, but
I think it is the right thing to do.

Thanks a lot
Shannon

Jason Ashbaugh said:
(…snip…)

My recommendation would be to always if possible use Qmail (I know it’s
apain to configure at first, but it is bulletproof in security) for smtp
functions wherever possible. A good project might be to write a
configuration utility in ruby that handles wmail underneath…

Just the thoughts of a security admin.

I would be forced to agree with Jason on this one. qmail does have a solid
security model, and is an excellent SMTP server. It is, also, extremely
flexible, and I would wager than anything you’re trying to do you could do
with a stock (read: no patches) qmail installation. If, for some reason,
you need control of the queue interaction (some sort of message
filtering), then check out the qmail-queue patch. This should give you
what you need, and its easy to write a Ruby program to interface with
qmail at this level. (I’ve done it a couple times.)

If it is an issue of integration (you have a project that needs SMTP-like
abilities), then I would still try to use qmail where possible. The only
problem with this solution in that case is the fact that it can’t be
packaged with a commercial product, however, it is great for internal
uses.

Cheers,

bs.

On the issue of integration:

Qmail’s greatest success nowadays seems to lie in acting as a
gateway/relay for inbound or outgoing email. In effect as a
virus/spam/rbl warden in either direction. It doesn’t integrate that
well with commercial packages simply because it is designed to deliver
mail to a Unix system (maildir or mbox) or forward the messages to the
server designated to deal with the domain. I use it as an inbound
guardian since I can run every inbound email first through ORBS, then
through both McAfee and F-Prot virus scanners, then finally through
spamassasin to give it a spamrating for users who want to filter that
way. It currently forwards to an exchange server (ick) but I hope to
switch over to communigatepro this summer (which does have good hooks
for running external filters… might be a good place to throw some ruby).

OT, and promising not to conitnue unless asked,
Jason

Ben Schumacher wrote:

···

Jason Ashbaugh said:
(…snip…)

My recommendation would be to always if possible use Qmail (I know it’s
apain to configure at first, but it is bulletproof in security) for smtp
functions wherever possible. A good project might be to write a
configuration utility in ruby that handles wmail underneath…

Just the thoughts of a security admin.

I would be forced to agree with Jason on this one. qmail does have a solid
security model, and is an excellent SMTP server. It is, also, extremely
flexible, and I would wager than anything you’re trying to do you could do
with a stock (read: no patches) qmail installation. If, for some reason,
you need control of the queue interaction (some sort of message
filtering), then check out the qmail-queue patch. This should give you
what you need, and its easy to write a Ruby program to interface with
qmail at this level. (I’ve done it a couple times.)

If it is an issue of integration (you have a project that needs SMTP-like
abilities), then I would still try to use qmail where possible. The only
problem with this solution in that case is the fact that it can’t be
packaged with a commercial product, however, it is great for internal
uses.

Cheers,

bs.