You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2005/09/17 19:27:19 UTC

mod_smtpd and old versions of apache2

So I'm playing around with mod_smtpd_queue_smtp, a module that has
mod_smtpd "queue" messages by forwarding them on to another smtp
server, and I ran into a little snag.

It appears that in older versions of apache2 (2.0.53 in this case)
conn->input_filters->ctx is NULL when smtpd_create_conn_rec gets
called.  This results in a crash when mod_smtpd tries to poke around
in there looking for the client socket, so it can set a big-ass
timeout on it.

Is it even necessary to do this?  Making the timeout conditional on
the context being non-null seems to fix the problem, and things seem
to work ok, but I have to wonder why it's needed in the first place...

-garrett

Re: mod_smtpd and old versions of apache2

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/18/05, Rian Hunter <ri...@mit.edu> wrote:

> Thanks for bringing this up. The timeout setting code is an archaism
> from when mod_smtpd used the ap_rgetline functions for I/O.
> ap_rgetline relied on a timeout set by one of the filters in
> http_filters.c to set a timeout, but since those filters weren't used
> i had to do it manually in mod_smtpd but now it has it's own I/O
> functions so it doesn't need to set this.

Great, thanks for taking care of this.

-garrett

Re: mod_smtpd and old versions of apache2

Posted by Rian Hunter <ri...@MIT.EDU>.
On Sep 17, 2005, at 1:27 PM, Garrett Rooney wrote:

> So I'm playing around with mod_smtpd_queue_smtp, a module that has
> mod_smtpd "queue" messages by forwarding them on to another smtp
> server, and I ran into a little snag.
>
> It appears that in older versions of apache2 (2.0.53 in this case)
> conn->input_filters->ctx is NULL when smtpd_create_conn_rec gets
> called.  This results in a crash when mod_smtpd tries to poke around
> in there looking for the client socket, so it can set a big-ass
> timeout on it.
>
> Is it even necessary to do this?  Making the timeout conditional on
> the context being non-null seems to fix the problem, and things seem
> to work ok, but I have to wonder why it's needed in the first place...
>
> -garrett
>

Thanks for bringing this up. The timeout setting code is an archaism  
from when mod_smtpd used the ap_rgetline functions for I/O.  
ap_rgetline relied on a timeout set by one of the filters in  
http_filters.c to set a timeout, but since those filters weren't used  
i had to do it manually in mod_smtpd but now it has it's own I/O  
functions so it doesn't need to set this.
-rian