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

list at ptld.com list at ptld.com
Thu Aug 1 17:49:07 EDT 2024


> Mailmunge does indeed create the temporary working directory as soon
> as it receives a valid MAIL From: command; it's just that directory
> might not be named after the queue ID.  If the queue ID is not available,
> Mailmunge generates its own ID.
> 
> So you can save the results of tests in filter_recipient in a file
> in the current working directory (start its name with a lower-case letter
> to avoid conflicts with Mailmunge's files.)  And you can then retrieve
> the results later on from filter_message by reading the file.  You could,
> for example, use Storable to save/restore data structures.
> 
> You don't need to clean up that file.  Mailmunge will delete the entire
> directory when it's done.


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.

Just to double check, there is nothing in mailmunge that will allow me to save and retrieve info between the filters? Or a method that i can use to dump data to the temp directory without me having to use perl file operations? $ctx is scoped to each filter and you said privdata() gets cleaned up with $ctx.

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

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.


More information about the Mailmunge mailing list