Ruby SMTP server library ?

L

Lothar Scholz

Hello,

Is there any library that implements a simple SMTP, allowing me to send
emails directly instead using the service from my web hoster that
requires stupid things like POP3 before SMTP.
 
Z

Zach Dennis

Lothar said:
Hello,

Is there any library that implements a simple SMTP, allowing me to send
emails directly instead using the service from my web hoster that
requires stupid things like POP3 before SMTP.

er... net/smtp in the standard library?

Zach
 
B

Bill Kelly

From: "Zach Dennis said:
er... net/smtp in the standard library?

Keep in mind some hosts will reject mail from systems
whose IP's resolve into something that looks too much
like a resedential account.

For ex. my employer has a business DSL account, and
our SMTP server is properly configured (doesn't allow
relaying, etc.) - but some sites refuse to receive
mail from us because they see the "dsl" in our
reverse lookup.

Just FYI . . .

Regards,

Bill
 
K

Kirk Haines

Hello,

Is there any library that implements a simple SMTP, allowing me to send
emails directly instead using the service from my web hoster that
requires stupid things like POP3 before SMTP.

I'd love to see even the front end of something like that. Just enough of an
SMTP server to receive and email from a client and then let the rest of the
code decide what to do with it (dump it to a file somewhere, or silently
discard would both be valuable).


Kirk Haines
 
J

James Britt

Kirk said:
I'd love to see even the front end of something like that. Just enough of an
SMTP server to receive and email from a client and then let the rest of the
code decide what to do with it (dump it to a file somewhere, or silently
discard would both be valuable).


Yes. It would be sweet to be able to E-mail an application and have it
respond with stats ("Dear program, how are you?"), or encrypt the
content and E-mail updates to your running code while away.



James


--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
 
S

Steven Jenkins

James said:
Yes. It would be sweet to be able to E-mail an application and have it
respond with stats ("Dear program, how are you?"), or encrypt the
content and E-mail updates to your running code while away.

I think Lothar was asking about the sending end of the transaction. As
for the receiving end, any real MTA gives you the ability to specify the
delivery agent--deliver to a mailbox, pipe to a process, whatever.
It's not Ruby, but it'd be pretty simple to set up Postfix to do just
what you said. Postfix is pretty.

Steve
 
J

James Britt

Steven Jenkins wrote:
...
I think Lothar was asking about the sending end of the transaction. As
for the receiving end, any real MTA gives you the ability to specify the
delivery agent--deliver to a mailbox, pipe to a process, whatever. It's
not Ruby, but it'd be pretty simple to set up Postfix to do just what
you said. Postfix is pretty.

Ah. Still, I'd like an app that listened on port 25 and knew the HELO,
and so on, commands, so that there would be no dependency on some
external MTA. (This is probably not so hard to do, maybe more a matter
of time; I think at one point I had to go poking around the SMTP
protocol so that some bit of code could talk directly to the recipient
process.

I've seen some Sendmail stuff that invokes a process, but it always
seemed painful to go learn the little quirks of yet another
mini-language so that my app can process mail.

(Still, MTAs make handy message queues for inter-app communication.)


James
 
L

Lothar Scholz

Hello James,

Exactly. I run into it when i wrote a script yesterday helping me to
send out some mass email. Even with about a few hunderts of email
addresses the current SMTP class is running into problem very soon if
you use foreign SMTP servers.

Postfix is nice but maybe a complete overkill for most systems. A
simple receiving SMTP + POP3 server would be enough. The original SMTP
internet protocol is so damned simple.

JB> Ah. Still, I'd like an app that listened on port 25 and knew the HELO,
JB> and so on, commands, so that there would be no dependency on some
JB> external MTA. (This is probably not so hard to do, maybe more a matter
JB> of time; I think at one point I had to go poking around the SMTP
JB> protocol so that some bit of code could talk directly to the recipient
JB> process.

Yes, the python library does this in 549 lines or 19 KByte.
 
K

Kirk Haines

Hello James,


Exactly. I run into it when i wrote a script yesterday helping me to
send out some mass email. Even with about a few hunderts of email
addresses the current SMTP class is running into problem very soon if
you use foreign SMTP servers.

I send some email newsletters for clients, and have had absolutely no problems
with this. A completely unoptimized single threaded process going to a
completely unoptimized sender, constructing dynamic emails (content is
constructed from a database profile according to recipient data) nets me
about 200 messages sent per minute from my server. I'm just using tmail for
this.

If you are doing a lot of email generation, the efficient way to do it is to
generate the emails and put them out to disk where you can have a seperate
queuing system running multiprocess/multithreaded to submit these to your
sending system (likely a send farm of more than one dedicated sender if you
really do a lot of email). That way your generating throughput isn't
throttled down by your sending throughput, and it gives you more control to
generate when it's convenient and send when it's convenient.

I worked for years in the email business, and I have no doubt that my Ruby
based engine could, when compared to the engine that my last employer still
uses (Java based), compete well in the performance area with theirs (and
completely blow the doors off of their when it comes to ease of constructing
new dynamic emails).

But, I'm going off on a tangent. The point is, I don't see any weakness with
Ruby when it comes to sending email.


Kirk Haines
 
K

Kirk Haines

Ah. Still, I'd like an app that listened on port 25 and knew the HELO,
and so on, commands, so that there would be no dependency on some
external MTA. (This is probably not so hard to do, maybe more a matter
of time; I think at one point I had to go poking around the SMTP
protocol so that some bit of code could talk directly to the recipient
process.

SMTP is simple, so it should not be hard to code one of these, if nobody has
done it before. I recall a while ago someone released a Ruby project for
creating state engines. At the time, it seemed to me that tool might be a
perfect way to build a simple MTA.

Postfix or that ilk isn't desireable to me because this is something that I
would like to be able to include directly in certain pieces of software, and
no matter how easy or pretty Postfix is, the fact that it's an external
application dependency introduces an additional knot of complexity that I
don't want to introduce.


Thanks,

Kirk Haines
 
L

Lothar Scholz

Hello Kirk,

KH> I send some email newsletters for clients, and have had absolutely no problems
KH> with this. A completely unoptimized single threaded process going to a
KH> completely unoptimized sender, constructing dynamic emails (content is

Well it only works if the owner of the SMTP server to which you
connect with smtp.rb has configured its server well. There are many
hosters that add timeouts, restrict sending emails to 100 per day or
do other things that prevents the effective use of his SMTP server.
If you are bound to one of them you have no choice as to run your own
server and talk to the receiving end yourself.

So i'm not talking about technical ruby problems but about common business
policies to run an email server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,501
Latest member
log5Sshell/alfa5

Latest Threads

Top