Robin Bowes said the following on 02/23/2006 01:01 AM:
> Johan Almqvist said the following on 02/21/2006 02:29 PM:
> 
>>hook_queue, and make sure your plugin is listed _after_ the 'real' 
>>queue plugin in config/plugins. The qpsmtpd design will make sure  your
>>plugin only gets run if the message was successfully queued  (i.e.
>>accepted).
> 
> 
> OK, I'm trying this out.
> 
> I'm using the adaptive logging plugin as follows:
> 
> logging/adaptive accept 4 reject 7 prefix #
> 
> I've written a small pluging called accepted_log which hooks queue:
> 
> sub hook_queue {
>   my ($self, $transaction) = @_;
> 
>   $self->log(LOGDEBUG, 'details of accepted mail go here');
> 
>   return DONE;
> }
> 
> (I'll make it write msg details when I get it working)
> 
> I can see that the plugin is being registered as I see this when qpsmtpd
> starts up:
> 
> 2006-02-23 00:57:33.383344500 7725 queue::qmail_2dqueue hooking queue
> 2006-02-23 00:57:33.386391500 7725 logging::accepted_log hooking queue
> 
> However, when I send a test mail I don't see my message in the log.
> 
> All I see is this:
> 
> 2006-02-23 01:00:19.561056500 7901 running plugin (queue):
> queue::qmail_2dqueue
> 2006-02-23 01:00:19.561061500 7903 queue::qmail_2dqueue plugin: (for
> 7901 ) Queuing qp 7903 to /var/qmail/bin/qmail-queue
> 2006-02-23 01:00:19.624941500 7901 Plugin queue::qmail_2dqueue, hook
> queue returned OK, Queued! 1140656419 qp 7903 <>
> 2006-02-23 01:00:19.624953500 7901 250 Queued! 1140656419 qp 7903 <>
> 2006-02-23 01:00:19.624959500 7901 # from email address :
> [<[EMAIL PROTECTED]>]
> 2006-02-23 01:00:19.624965500 7901 # to email address :
> [<[EMAIL PROTECTED]>]
> 2006-02-23 01:00:19.624970500 7901 dispatching QUIT

OK, I've tried swapping the order of the qmail-queue and accepted_log
plugins in config/plugins and it seems that only hook_queue in the first
one listed in plugins is called.

i.e. if plugins contains:

queue/qmail-queue
logging/accepted_log

Then only the hook_queue in qmail-queue is run.

Similarly, if plugins contains:

logging/accepted_log
queue/qmail-queue

Then only the hook_queue in accepted_log is run.

I tried changing the last line of accepted_log to read "return (OK,
"accepted_log finished") but this made no difference.

Am I doing something wrong, is this a "bug", or is what I'm trying to do
not possible?

Thanks,

R.

Reply via email to