[Mailmunge] Add Header based on condition in filter_recipient{}

Dianne Skoll dianne at skollsoft.com
Thu Aug 1 18:40:32 EDT 2024


On Thu, 01 Aug 2024 17:49:07 -0400
list--- via Mailmunge <mailmunge at lists.mailmunge.org> wrote:

> Im only using the filter_recipient() and filter_message() so my
> mailmunge shouldn't be invoked by the MAIL FROM. I will assume it
> creates the directory then on the RCPT-TO.

The directory management happens in the C code, long before any Perl gets
involved.

> Just to double check, there is nothing in mailmunge that will allow
> me to save and retrieve info between the filters?

You have to use the filesystem for that.

> Maybe a future idea of creating something like privdata() that uses
> the temp directory to share privdata() between filters?

We don't need that.  You can just use Storable to dump/restore data
to/from a file in the current directory.  I don't think that needs
a wrapper; it's already very simple.

> My project already does SQL look-ups, so my plan is to use a temp
> table for caching the qid and header for the filter_message() to
> find. Unless mailmunge has a built in method related to the temp
> directory.

All Mailmunge callbacks are invoked with the temp directory being
the current working directory, so you can use relative pathnames
to create files in the temp directory.  If you need the name of the
temp directory, it's $ctx->cwd.

Regards,

Dianne.



More information about the Mailmunge mailing list