Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 16964 invoked from network); 23 Aug 2005 17:14:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Aug 2005 17:14:53 -0000 Received: (qmail 60629 invoked by uid 500); 23 Aug 2005 17:14:49 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 60566 invoked by uid 500); 23 Aug 2005 17:14:48 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 60553 invoked by uid 99); 23 Aug 2005 17:14:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2005 10:14:48 -0700 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (asf.osuosl.org: transitioning domain of rian@mit.edu does not designate 209.42.38.167 as permitted sender) Received: from [209.42.38.167] (HELO mail.thelaststop.net) (209.42.38.167) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2005 10:15:05 -0700 Received: from [192.168.1.150] (www [192.168.1.150]) by mail.thelaststop.net (Postfix) with ESMTP id AA3F584994 for ; Mon, 22 Aug 2005 11:15:49 -0400 (EDT) Subject: mod_smtpd hook system From: Rian Hunter To: dev@httpd.apache.org Content-Type: text/plain Message-Id: <1124817283.27314.17.camel@www> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 23 Aug 2005 13:14:44 -0400 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I've changed the hook system for mod_smtpd a little to allow more flexibility and module cooperation. Basically it works like this now: When a hook is called smtpd_run_*, each registered hook is called until one returns something other than SMTPD_DECLINED or SMTPD_OK. If all the hooks return SMTPD_DECLINED, then the call to smtpd_run_* returns SMTPD_DECLINED. If all hooks return SMTPD_DECLINED but one or more return SMTPD_OK, then the call to smtpd_run_* returns SMTPD_OK. This is different from the conventional "run all" hook we have where the call to smtpd_run_* returns SMTPD_OK even if it was declined by all the hooks. This is also different from a "run first" hook, where calling hooks stop as soon as one returns something other than declined. The purpose of this change was to allow the call to smtpd_run_queue to call all the hooks even if one already accepted it with SMTPD_OK (so other modules can process other recipients), and to know that at least one accepted the message. If they all returned SMTPD_DECLINED then tell the client that the message was not queued. Of course the other SMTPD_DENY* return codes still apply. This required a new run implementor macro that I've dubbed APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL_MOD and defined in smtpd.h, but would something like this make it into the APR release? It seems silly and hackish within smtpd.h. Also should a APR_IMPLEMENT_OPTIONAL_HOOK_RUN_FIRST also be defined in APR? Thanks. -rian