haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
5.02k stars 662 forks source link

`hook_rcpt` from in_host_list plugin returns without calling next #1253

Closed dminkovsky closed 8 years ago

dminkovsky commented 8 years ago

Hi,

Very new to this codebase, so I am sorry if this is a false flag, which it probably is.

But, I noticed this line returns from a plugin without calling next().

Is this a bug? If not, what's the point of doing this?

Thanks you.

baudehlo commented 8 years ago

There are some situations where the transaction can go away while in a hook. It's a bit weird and we should probably protect against it elsewhere, but this is just a safety check. Once this happens and this situation arises there's no point calling next().

On Mon, Nov 23, 2015 at 3:03 PM, Dmitry Minkovsky notifications@github.com wrote:

Hi,

Very new to this codebase, so I am sorry if this is a false flag, which it probably is.

But, I noticed this line https://github.com/haraka/Haraka/blame/fa6b06129e5f5f7355fd401ce3201cf205dce58d/plugins/rcpt_to.in_host_list.js#L23 returns from a plugin without calling next().

Is this a bug? If not, what's the point of doing this?

Thanks you.

— Reply to this email directly or view it on GitHub https://github.com/haraka/Haraka/issues/1253.

dminkovsky commented 8 years ago

Does it make sense for it to be next(ERR) where ERR is some error code? If the check fails, won't the return without next() cause a wait until hook time expires?

baudehlo commented 8 years ago

Maybe. I'm not really sure of the consequences at this point.

On Mon, Nov 23, 2015 at 3:40 PM, Dmitry Minkovsky notifications@github.com wrote:

Does it make sense for it to be next(ERR) where ERR is some error code? If the check fails, won't the return without next() cause a wait until hook time expires?

— Reply to this email directly or view it on GitHub https://github.com/haraka/Haraka/issues/1253#issuecomment-159057876.

dminkovsky commented 8 years ago

Cool! Thanks.