You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by mock <mo...@obscurity.org> on 2004/02/23 10:16:47 UTC

ANNOUNCE: Apache::SMTP

A while ago I attended an interesting talk by Stas at the Vancouver pm.  The
idea of building an SMTP server using mod_perl was mentioned and the task kind
of appealed to me, so here's my first attempt at it.  Note that it uses
Apache::TieBucketBrigade, which is my attempt at making bucket brigades look
like IO::Handles.  This may or may not be a good idea; I'd appreciate some
feedback.

BTW, I'm trying to figure out how to test both of these modules using 
Apache::Test, but I'm not having a lot of luck.  Any pointers would be 
helpfull.

thanks, and enjoy my sketchy code ;)

code can be found here: http://search.cpan.org/~mock/

mock

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
[...]
>> I'm having a little difficulty figuring out how to create request 
>> which isn't
>> HTTP.  I'll move TestTieBucketBrigade and rerelease just as soon as I 
>> figure
>> out how to make Apache::TestRequest do what I want.
> 
> 
> See:
> http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlHeaderParserHandler 

> Scroll down to the send_http_email.pl client.

and you can always talk via socket. See modperl-2.0/t/protocol/

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Stas Bekman <st...@stason.org>.
mock wrote:
> On Mon, Feb 23, 2004 at 11:27:33AM -0800, Stas Bekman wrote:
> 
>>Cool. It looks nice, but you shouldn't have rushed to release things on 
>>CPAN, IMHO.
>>
>>Why taking over the Apache::SMTP namespace if you don't implement a full 
>>SMTP protocol? It's usually a good idea to post a proposal here so we may 
>>help to choose a suitable name. If you badly want to put things on CPAN, 
>>include _ in the version number so that the PAUSE indexer won't index it.
>>
>>Besides taking over Apache::SMTP, it should probably live somewhere under 
>>Apache::Protocol::. For some ideas see:
>>http://perl.apache.org/products/apache-modules.html#Module_Naming_Conventions
> 
> 
> It should be a full implementation of SMTP, if it isn't then there's a bug.

I guess I was thinking about your docco in:
http://search.cpan.org/~mock/Apache-SMTP-0.01/lib/Apache/SMTP.pm

   This implements a very simple SMTP server using Apache and mod_perl 2....

So I thought that there could be a not so simple SMTP server which may want to 
live around the same namespace.

> What it doesn't do, is proper queuing, any sort of real validation of the
> sender or recipient, domain specific configuration, or local delivery.  My 
> thought for the namespace was that those sorts of things would be implemented
> in subclasses - Apache::SMTP::LocalDelivery - and the like.  I'm not sure I
> like the Apache::Protocol:: namespace as it, to my mind at least, doesn't 
> capture the idea that it implements a daemon.  I toyed with 
> Apache::Net::Server::Mail::SMTP since it really is just Net::Server::Mail::SMTP
> bolted on to a handler, but that name space is just fugly ;).  I suppose it
> could be Apache::Server::SMTP or perhaps Apache::Daemon::SMTP but both of those
> seem somehow redundant; I mean, "Apache::Server?" Apache is a Server.  Anyway
> after agonizing over the namespace for quite some time I decided to just go
> with simple and to the point Apache::SMTP (although I thought about putting
> a D on the end for Apache::SMTPD).  Anyway, obviously I ate too much lead paint
> as a child, however I'm certainly willing to move to a different name space
> if someone thinks there'll be others wanting to camp out in Apache::SMTP.

I don't know what's the best name to use. As I originally commented, I'm just 
trying to reserve global namespaces. But that's why you should have posted 
here and hopefully others will come up with good ideas.

My 2 cents is that what you wrote is really an application/wrapper. So may be 
the namespace should reflect that.

>>You want to keep TestTieBucketBrigade.pm out of project/lib and put it 
>>under t instead. See the modperl-2.0 test suite.
>>
> 
> 
> I'm having a little difficulty figuring out how to create request which isn't
> HTTP.  I'll move TestTieBucketBrigade and rerelease just as soon as I figure
> out how to make Apache::TestRequest do what I want.

See:
http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlHeaderParserHandler

Scroll down to the send_http_email.pl client.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by mock <mo...@obscurity.org>.
On Mon, Feb 23, 2004 at 11:27:33AM -0800, Stas Bekman wrote:
> Cool. It looks nice, but you shouldn't have rushed to release things on 
> CPAN, IMHO.
> 
> Why taking over the Apache::SMTP namespace if you don't implement a full 
> SMTP protocol? It's usually a good idea to post a proposal here so we may 
> help to choose a suitable name. If you badly want to put things on CPAN, 
> include _ in the version number so that the PAUSE indexer won't index it.
> 
> Besides taking over Apache::SMTP, it should probably live somewhere under 
> Apache::Protocol::. For some ideas see:
> http://perl.apache.org/products/apache-modules.html#Module_Naming_Conventions

It should be a full implementation of SMTP, if it isn't then there's a bug.
What it doesn't do, is proper queuing, any sort of real validation of the
sender or recipient, domain specific configuration, or local delivery.  My 
thought for the namespace was that those sorts of things would be implemented
in subclasses - Apache::SMTP::LocalDelivery - and the like.  I'm not sure I
like the Apache::Protocol:: namespace as it, to my mind at least, doesn't 
capture the idea that it implements a daemon.  I toyed with 
Apache::Net::Server::Mail::SMTP since it really is just Net::Server::Mail::SMTP
bolted on to a handler, but that name space is just fugly ;).  I suppose it
could be Apache::Server::SMTP or perhaps Apache::Daemon::SMTP but both of those
seem somehow redundant; I mean, "Apache::Server?" Apache is a Server.  Anyway
after agonizing over the namespace for quite some time I decided to just go
with simple and to the point Apache::SMTP (although I thought about putting
a D on the end for Apache::SMTPD).  Anyway, obviously I ate too much lead paint
as a child, however I'm certainly willing to move to a different name space
if someone thinks there'll be others wanting to camp out in Apache::SMTP.

> 
> As for Apache::TieBucketBrigade, it's probably a good idea to make it a 
> part of the mp2 core and implement it in C. There is a plan to provide TIE 
> API for filters as written down at modperl-2.0/todo/features_new

Well, I think I've kinda proven it would be usefull.  Many of the things I
did are kinda hackish in perl.

> 
> >BTW, I'm trying to figure out how to test both of these modules using 
> >Apache::Test, but I'm not having a lot of luck.  Any pointers would be 
> >helpfull.
> 
> http://perl.apache.org/docs/general/testing/testing.html
> http://www.perl.com/pub/a/2003/05/22/testing.html
> modperl-2.0 test suite and several other Apache:: modules on CPAN which now 
> include a test suite.
> 
> You want to keep TestTieBucketBrigade.pm out of project/lib and put it 
> under t instead. See the modperl-2.0 test suite.
>

I'm having a little difficulty figuring out how to create request which isn't
HTTP.  I'll move TestTieBucketBrigade and rerelease just as soon as I figure
out how to make Apache::TestRequest do what I want.

thanks

mock

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Ged Haywood <ge...@jubileegroup.co.uk>.
Hi all,

On Tue, 24 Feb 2004, mock wrote:

> Apache::Net::Server::Mail::SMTP::Mail::Audit::PGP or something of the like is
> just aesthetically sucky.  So, suggestions please?

You're quite right.  I'm starting to think there should be some kind
of an on-the-hoof database lookup  for namespaces.

73,
Ged.

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Stas Bekman <st...@stason.org>.
mock wrote:

>>>stupid when I try to attach something like Mail::Audit to it.
>>>Apache::Net::Server::Mail::SMTP::Mail::Audit::PGP or something of the like 
>>>is
>>>just aesthetically sucky.  So, suggestions please?
>>
>>That's exactly where the problem is with your name choice. If you plan to 
>>add things which are aren't Net::SMTP, then the name is wrong. As I 
>>suggested it looks more like an application than a framework or protocol 
>>API. It just happens to work only Apache. Therefore Apache::SMTP is 
>>inappropriate. Usually when you write an application you give it some name, 
>>not after the protocol but something else, usually unique and cool of 
>>possible. e.g. Apache::MockMail. And several people have suggested to put 
>>new Apache App modules into the Apache::App:: namespace, but it's up to you 
>>to decide.
> 
> 
> You raise a good point.  The App space seems like it would be more 
> appropriate.  MockMail, seems a bit pretensious ;), however I think your
> correct, SMTP is perhaps not right.  How about Apache::App::SMTP?  Can
> everyone else live with that?  Alternatively, Apache::App::SMTPd.

-0 for Apache::App::SMTP (still conflicting IMHO)
+1 for Apache::App::SMTPd (or anything else ;)

Of course if you can come up with your own cool name then you can take over 
the 2nd namespace. The added value is that people will most likely remember 
Apache::HippoCart and not Apache::App::SMTPd.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by mock <mo...@obscurity.org>.
On Tue, Feb 24, 2004 at 09:35:57AM -0800, Stas Bekman wrote:

> You probably want to talk to Geoff, since he said he has already started 
> working on it. May be he has enough dough, so that you can finish it off. 
> And as he said it'll will in the APR:: namespace, so there is no collision. 
> I suppose once the core supports it, you can just nuke it from CPAN if you 
> are happy with it.

This works for me.

> >stupid when I try to attach something like Mail::Audit to it.
> >Apache::Net::Server::Mail::SMTP::Mail::Audit::PGP or something of the like 
> >is
> >just aesthetically sucky.  So, suggestions please?
> 
> That's exactly where the problem is with your name choice. If you plan to 
> add things which are aren't Net::SMTP, then the name is wrong. As I 
> suggested it looks more like an application than a framework or protocol 
> API. It just happens to work only Apache. Therefore Apache::SMTP is 
> inappropriate. Usually when you write an application you give it some name, 
> not after the protocol but something else, usually unique and cool of 
> possible. e.g. Apache::MockMail. And several people have suggested to put 
> new Apache App modules into the Apache::App:: namespace, but it's up to you 
> to decide.

You raise a good point.  The App space seems like it would be more 
appropriate.  MockMail, seems a bit pretensious ;), however I think your
correct, SMTP is perhaps not right.  How about Apache::App::SMTP?  Can
everyone else live with that?  Alternatively, Apache::App::SMTPd.

> 
> Meanwhile, I've linked to your module from:
> http://perl.apache.org/docs/2.0/user/handlers/protocols.html#CPAN_Modules
> as the first mp2 protocol implementation on CPAN, that I know of.

cool

mock

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Ged Haywood <ge...@jubileegroup.co.uk>.
Hi guys,

On Tue, 24 Feb 2004, Stas Bekman wrote:

> when you write an application you give it some name ... unique and cool
> ... e.g. Apache::MockMail

Now that's nice!

73,
Ged.

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> I think I need to read the Brigade docs again :).  But, yeah, when I was 
> building the thing, I was kinda thinking about it like it was a filter.  
> Your approach sounds like it might be better though.

it was just an idea that I had, and I hadn't investigated brigades to the
point where I fully understood whether my desires were proper or not.  ymmv :)

>>anyway, the (very, very rough) work in progress is here
>
> Cool, I'll take a look and see what can be done.

just to be clear, I only posted it so you could steal any useful ideas from
within - I'm not planning on releasing it anymore, so feel free to do your
own thing (steal it, ignore it, whatever).

> I'll try and fix it up so it isn't destructive (if I can, and still make it
> work the way I need it to). 

right, it may not be possible, or the needs of filters may be different.  as
I said, I was starting at a different point - in Apache::Upload, $bb
represents an uploaded file, which I wouldn't want to consume in case other
people wanted to read from it as well. creating an interface that met the
needs of both types of brigades was a sticking point for me, which is
partially why I moved on :)

> I'm not sure if I can pull out all the mod_perl
> dependencies though.  If that is the case it should stay in the Apache 
> namespace, right?

yeah, I'd say so.  in truth, APR:: isn't entirely separate from mod_perl
yet, but that's the plan.  so I'd suggest saying out of a new namespace on
CPAN until the core APR:: modules are clean.  but I don't feel strongly
about that, so yet another suggestion.

good luck and kudos for getting something fully working - I knew it was a
good idea :)

--Geoff


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by mock <mo...@obscurity.org>.
On Tue, Feb 24, 2004 at 02:29:16PM -0500, Geoffrey Young wrote:
> 
> > You probably want to talk to Geoff, since he said he has already started
> > working on it. May be he has enough dough, so that you can finish it
> > off. And as he said it'll will in the APR:: namespace, so there is no
> > collision. I suppose once the core supports it, you can just nuke it
> > from CPAN if you are happy with it.
> 
> mock is much farther along with it than I am - I was creating it as a
> tutorial for people who get a $bb and don't know what to do with it (as with
> Apache::Upload).  but they look surprisingly similar :)
> 
> the one thing I was focusing on before I got sidetracked was support for $/
> - specifically if $/ is undef letting READLINE use $bb->flatten to return
> the entire brigade, but also splitting the

This is a good idea... I'll see what I can do with my bits.

> 
> another thing I was debating was how to treat the brigade when reading - you
> seem to be treating the brigade like you would for Apache filters,
> destroying the brigade while reading.  I wanted more of a filehandle
> interface where the brigade could be manipulated over and over again
> (reading a file is non-destructive, as is APR::Brigade::flatten.
>

I think I need to read the Brigade docs again :).  But, yeah, when I was 
building the thing, I was kinda thinking about it like it was a filter.  
Your approach sounds like it might be better though.
 
> anyway, the (very, very rough) work in progress is here
> 
> http://www.modperlcookbook.org/~geoff/modules/experimental/APR-TieBrigade-0.01.tar.gz
> 
> debug statements and other ugliness included.  but it might trigger some
> ideas you had, or give you an idea as to how better use Apache-Test.  for
> what it's worth :)
>

Cool, I'll take a look and see what can be done.
 
> anyway, I asked modules@apache.org to add an APR:: namespace to CPAN a while
> ago, but they might not have gotten around it it yet.  however, before
> releasing to that namespace I'd consider a name that more specifically suits
> the intended purpose - if indeed the module is only relevant to brigades use
> in input/output filters, where you need to destroy the incoming and write to
> a new outgoing, then I'd probably either keep it in the Apache:: namespace
> to name it something like APR::TieFilterBrigade.  also note that there
> should be _zero_ mod_perl dependencies if placed in the APR:: namespace (I
> wasn't quite there either :)

I'll try and fix it up so it isn't destructive (if I can, and still make it
work the way I need it to).  I'm not sure if I can pull out all the mod_perl
dependencies though.  If that is the case it should stay in the Apache 
namespace, right?

thanks

mock

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> You probably want to talk to Geoff, since he said he has already started
> working on it. May be he has enough dough, so that you can finish it
> off. And as he said it'll will in the APR:: namespace, so there is no
> collision. I suppose once the core supports it, you can just nuke it
> from CPAN if you are happy with it.

mock is much farther along with it than I am - I was creating it as a
tutorial for people who get a $bb and don't know what to do with it (as with
Apache::Upload).  but they look surprisingly similar :)

the one thing I was focusing on before I got sidetracked was support for $/
- specifically if $/ is undef letting READLINE use $bb->flatten to return
the entire brigade, but also splitting the

another thing I was debating was how to treat the brigade when reading - you
seem to be treating the brigade like you would for Apache filters,
destroying the brigade while reading.  I wanted more of a filehandle
interface where the brigade could be manipulated over and over again
(reading a file is non-destructive, as is APR::Brigade::flatten.

anyway, the (very, very rough) work in progress is here

http://www.modperlcookbook.org/~geoff/modules/experimental/APR-TieBrigade-0.01.tar.gz

debug statements and other ugliness included.  but it might trigger some
ideas you had, or give you an idea as to how better use Apache-Test.  for
what it's worth :)

anyway, I asked modules@apache.org to add an APR:: namespace to CPAN a while
ago, but they might not have gotten around it it yet.  however, before
releasing to that namespace I'd consider a name that more specifically suits
the intended purpose - if indeed the module is only relevant to brigades use
in input/output filters, where you need to destroy the incoming and write to
a new outgoing, then I'd probably either keep it in the Apache:: namespace
to name it something like APR::TieFilterBrigade.  also note that there
should be _zero_ mod_perl dependencies if placed in the APR:: namespace (I
wasn't quite there either :)

HTH

--Geoff


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Stas Bekman <st...@stason.org>.
mock wrote:
> On Mon, Feb 23, 2004 at 03:38:17PM -0800, Stas Bekman wrote:
> 
>>Geoffrey Young wrote:
>>
>>
>>>>By commenting on Apache::TieBucketBrigade I was trying to
>>>>reserve that or a similar namespace for the modperl core. So later there
>>>>would be no collision/confusion.
>>>
>>>oh, I didn't get that from your comment.  anyway, if something like that
>>>ever makes it into core it probably ought to be in the APR namespace, so I
>>>guess we're safe :)
>>
>>Yup, which also shows that the Apache::TieBucketBrigade name is a wrong 
>>name, since it's an APR feature and not Apache's one.
>>
>>But if it's already implemented, nothing stops us from putting it into the 
>>core as it is (in perl) and then port it to C when we get time. Or may be 
>>'mock' will want to do that ;)
>>
> 
> 
> I was about to release a new version of TieBucketBrigade with a proper test
> suite, now that I've kinda figured out Apache::Test (thanks for the pointers
> Stas, I knew I was missing something).  Is there a different namespace I 
> should use? or shall I just go ahead and drop the code and hope it all sorts
> itself out later?  As for a C port, I may get to that if I have enough 
> time + motivation, but it's a little outside the scope of the project
> I'm working on, so I don't know if I'll get to it.  I'll race you ;).

You probably want to talk to Geoff, since he said he has already started 
working on it. May be he has enough dough, so that you can finish it off. And 
as he said it'll will in the APR:: namespace, so there is no collision. I 
suppose once the core supports it, you can just nuke it from CPAN if you are 
happy with it.

> Speaking of namespace, unless someone comes up with something better, I'm going
> to continue using Apache::SMTP.  I'm reasonably ok with Apache::Protocol::SMTP,
> or something of similar size, but any deeper than that and it's going to get
> stupid when I try to attach something like Mail::Audit to it.
> Apache::Net::Server::Mail::SMTP::Mail::Audit::PGP or something of the like is
> just aesthetically sucky.  So, suggestions please?

That's exactly where the problem is with your name choice. If you plan to add 
things which are aren't Net::SMTP, then the name is wrong. As I suggested it 
looks more like an application than a framework or protocol API. It just 
happens to work only Apache. Therefore Apache::SMTP is inappropriate. Usually 
when you write an application you give it some name, not after the protocol 
but something else, usually unique and cool of possible. e.g. 
Apache::MockMail. And several people have suggested to put new Apache App 
modules into the Apache::App:: namespace, but it's up to you to decide.

Meanwhile, I've linked to your module from:
http://perl.apache.org/docs/2.0/user/handlers/protocols.html#CPAN_Modules
as the first mp2 protocol implementation on CPAN, that I know of.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by mock <mo...@obscurity.org>.
On Mon, Feb 23, 2004 at 03:38:17PM -0800, Stas Bekman wrote:
> Geoffrey Young wrote:
> 
> >>By commenting on Apache::TieBucketBrigade I was trying to
> >>reserve that or a similar namespace for the modperl core. So later there
> >>would be no collision/confusion.
> >
> >oh, I didn't get that from your comment.  anyway, if something like that
> >ever makes it into core it probably ought to be in the APR namespace, so I
> >guess we're safe :)
> 
> Yup, which also shows that the Apache::TieBucketBrigade name is a wrong 
> name, since it's an APR feature and not Apache's one.
> 
> But if it's already implemented, nothing stops us from putting it into the 
> core as it is (in perl) and then port it to C when we get time. Or may be 
> 'mock' will want to do that ;)
> 

I was about to release a new version of TieBucketBrigade with a proper test
suite, now that I've kinda figured out Apache::Test (thanks for the pointers
Stas, I knew I was missing something).  Is there a different namespace I 
should use? or shall I just go ahead and drop the code and hope it all sorts
itself out later?  As for a C port, I may get to that if I have enough 
time + motivation, but it's a little outside the scope of the project
I'm working on, so I don't know if I'll get to it.  I'll race you ;).

Speaking of namespace, unless someone comes up with something better, I'm going
to continue using Apache::SMTP.  I'm reasonably ok with Apache::Protocol::SMTP,
or something of similar size, but any deeper than that and it's going to get
stupid when I try to attach something like Mail::Audit to it.
Apache::Net::Server::Mail::SMTP::Mail::Audit::PGP or something of the like is
just aesthetically sucky.  So, suggestions please?

mock

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:

>>By commenting on Apache::TieBucketBrigade I was trying to
>>reserve that or a similar namespace for the modperl core. So later there
>>would be no collision/confusion.
> 
> oh, I didn't get that from your comment.  anyway, if something like that
> ever makes it into core it probably ought to be in the APR namespace, so I
> guess we're safe :)

Yup, which also shows that the Apache::TieBucketBrigade name is a wrong name, 
since it's an APR feature and not Apache's one.

But if it's already implemented, nothing stops us from putting it into the 
core as it is (in perl) and then port it to C when we get time. Or may be 
'mock' will want to do that ;)

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
>> hey, you weren't quite as enthusiastic when I mentioned it ;)
>>
>> http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=107514358415593&w=2
> 
> 
> That's a totally different thing. What I said above is that it's
> probably not the most urgent thing to do, if we ever want to get 2.0
> released. 

eesh, I was just kidding :)

/me points at the winky-smily

> By commenting on Apache::TieBucketBrigade I was trying to
> reserve that or a similar namespace for the modperl core. So later there
> would be no collision/confusion.

oh, I didn't get that from your comment.  anyway, if something like that
ever makes it into core it probably ought to be in the APR namespace, so I
guess we're safe :)

--Geoff


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:

>>As for Apache::TieBucketBrigade, it's probably a good idea to make it a
>>part of the mp2 core and implement it in C.
> 
> 
> hey, you weren't quite as enthusiastic when I mentioned it ;)
> 
> http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=107514358415593&w=2

That's a totally different thing. What I said above is that it's probably not 
the most urgent thing to do, if we ever want to get 2.0 released. By 
commenting on Apache::TieBucketBrigade I was trying to reserve that or a 
similar namespace for the modperl core. So later there would be no 
collision/confusion.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
>> Note that it uses
>> Apache::TieBucketBrigade, which is my attempt at making bucket
>> brigades look
>> like IO::Handles.  

heh, I started APR::TieBrigade (actually APR::TieBrigadePerl and
APR::TieBrigadeC) a while ago but haven't quite finished them yet.

> As for Apache::TieBucketBrigade, it's probably a good idea to make it a
> part of the mp2 core and implement it in C.

hey, you weren't quite as enthusiastic when I mentioned it ;)

http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=107514358415593&w=2

--Geoff


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: Apache::SMTP

Posted by Stas Bekman <st...@stason.org>.
mock wrote:
> A while ago I attended an interesting talk by Stas at the Vancouver pm.  The
> idea of building an SMTP server using mod_perl was mentioned and the task kind
> of appealed to me, so here's my first attempt at it.  Note that it uses
> Apache::TieBucketBrigade, which is my attempt at making bucket brigades look
> like IO::Handles.  This may or may not be a good idea; I'd appreciate some
> feedback.

Cool. It looks nice, but you shouldn't have rushed to release things on CPAN, 
IMHO.

Why taking over the Apache::SMTP namespace if you don't implement a full SMTP 
protocol? It's usually a good idea to post a proposal here so we may help to 
choose a suitable name. If you badly want to put things on CPAN, include _ in 
the version number so that the PAUSE indexer won't index it.

Besides taking over Apache::SMTP, it should probably live somewhere under 
Apache::Protocol::. For some ideas see:
http://perl.apache.org/products/apache-modules.html#Module_Naming_Conventions

As for Apache::TieBucketBrigade, it's probably a good idea to make it a part 
of the mp2 core and implement it in C. There is a plan to provide TIE API for 
filters as written down at modperl-2.0/todo/features_new

> BTW, I'm trying to figure out how to test both of these modules using 
> Apache::Test, but I'm not having a lot of luck.  Any pointers would be 
> helpfull.

http://perl.apache.org/docs/general/testing/testing.html
http://www.perl.com/pub/a/2003/05/22/testing.html
modperl-2.0 test suite and several other Apache:: modules on CPAN which now 
include a test suite.

You want to keep TestTieBucketBrigade.pm out of project/lib and put it under t 
instead. See the modperl-2.0 test suite.

> thanks, and enjoy my sketchy code ;)
> 
> code can be found here: http://search.cpan.org/~mock/

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html