[Mimedefang] Multiplexor Issue

David F. Skoll dfs at roaringpenguin.com
Fri Feb 14 13:35:01 EST 2003


On Fri, 14 Feb 2003, Jesus Martinez Rubio wrote:

> For example, I save some data in a new record of the table "mail" when is
> executed filter_sender, and also data of recipients in table "recipients"
> where is executed filter_recipients, and so on for attachments, etc. With
> that issue, it impossible to know with absolutly sure, which
> "mail_identifier" of the database I created when filter_sender was called,
> when I must to use it in filter_recipient in order to establish the correct
> relation of the data between tables.

Well, there is an easy way around this:

Do all your work in filter_begin.  You have all the info you
need there, and it's only called once for each message.  The sender is
in $Sender, and the recipients are in @Recipients.

However, I've been thinking about this same problem, and agree that it
would be nice to keep state.  The next beta release will solve it as
follows: The MIMEDefang spool directory will be created before
filter_relay gets called.  All of the filter_* functions will be able
to access this directory in the global $CWD variable, and the Perl
filter will chdir() to that directory before calling the filter_*
functions.  That way, you can store state directly in files in the
spool directory, or just use the directory name as a unique key for
database lookups.  (Though on very busy mail servers, a name might be
reused, so be careful.)

Regards,

David.



More information about the MIMEDefang mailing list