On Thu, 26 Oct 2006 09:31:37 -0400
John Peacock <[EMAIL PROTECTED]> wrote:

> David Muir Sharnoff wrote:
> > +    if ($status) {
> > +    # this section needs to be kept in sync with the
> > cleanup_stat_map +    # array found in Postfix source file
> > src/global/cleanup_strerror.c +    # which in turn uses constants
> > defined in src/global/cleanup_user.h
> 
> It's extremely icky to have Perl code that relies on some other 
> project's .c and .h files like that.  Do you know how frequent changes
> are made to that array?  Is there any way that you can provide code to
> regenerate this block directly from the Postfix source (and perhaps 
> store the result in a DATA block at the end of the plugin, rather than
> inline)?
> 
> If the Postfix array is infrequently updated, then I can see applying 
> your patch, but I'd rather do something that will be easier to
> maintain...
Ok, this patch does something like that. 

The cleanup_stat_map array has changed from postfix 2.2 to 2.3. The
constants and messages used inside are still the same.
We can use a generated perl module made from postfix 2.4 source with a
postfix 2.1 binary. 
The pf2qp.pl inside the diff parses some postfix .c and .h files and
creates a Qpsmtpd::Postfix::Constants module on STDOUT, it requires
postfix source >= v2.3.

The plugins/queue/postfix-queue has been changed to use this module and
should work with any postfix 2.x. The flags given as module parameters
do not have to match the current version you're queueing the messages
to, i.e. setting FLAG_MILTER works with v2.1 (that flag was added in
v2.3), but is silently ignored by cleanup.

        Hanno

Attachment: 667-postfix-constants
Description: Binary data

Reply via email to