Postfix Integration - Run another filter first

Julian Field MailScanner at ecs.soton.ac.uk
Thu Aug 7 21:56:38 IST 2008



Joseph Jamieson wrote:
> That's a good possibility - I will read more on how messages are
> inspected and handled by postfix.
>
> I could probably have a different process inspect the hold queue,
> process it first, then drop it into another folder which MailScanner
> monitors.
Watch out for file locking! Pulling complete messsages out of the HOLD 
queue is not trivial! You have been warned (it took me a long time to 
finally get it right). And then make sure you use a similar locking 
scheme when you write your processed messages out to the folder that 
MailScanner is going to get them from, or MailScanner will end up 
processing partially-written messages.

The whole locking problem in Postfix is a minefield. It's why the 
Postfix authors hate me so much :-)

> -----Original Message-----
> From: mailscanner-bounces at lists.mailscanner.info
> [mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Leland
> J. Steinke
> Sent: Thursday, August 07, 2008 4:22 PM
> To: MailScanner discussion
> Subject: Re: Postfix Integration - Run another filter first
>
> My recollection is that the cleanup(8) daemon is what places messages in
>
> the hold queue.  MailScanner picks them up there and drops them into 
> incoming when it's done.  http://www.postfix.org/OVERVIEW.html indicates
>
> optional "light-weight content inspection" in the BUILTIN_FILTER_README.
>
> If all else failed, maybe you could set up header_checks to use the 
> FILTER action on Received: headers to a daemon that inserts some other 
> header which you could then use as a trigger for the HOLD action after 
> the message is re-injected.  I make no promises that this would work at 
> all, but it would be cool if it did.  ;-)
>
>
> Leland
> Joseph Jamieson wrote:
>   
>> Greetings,
>>
>>  
>>
>> I'm pretty new to MailScanner, but I do have a working system and it
>>     
> works.
>   
>>  
>>
>> I am having trouble tracking down a few bits of information, though - 
>> and this is mostly a Postfix question but I figured someone here might
>>     
> know.
>   
>>  
>>
>> MailScanner uses the Postfix header-checks "HOLD" feature to scan the 
>> messages.   Postfix drops the message into the hold folder, and every 
>> few moments MailScanner will check the folder, scan all the messages, 
>> and then drop it into a folder for postfix to grab and continue
>>     
> sending 
>   
>> the message on its way.
>>
>>  
>>
>> At what time in the process does Postfix do this?     It appears that 
>> postfix will do this before pretty much anything else.   So, if I have
>>     
> a 
>   
>> filter set up in the master.cf (for instance, dspam) MailScanner
>>     
> always 
>   
>> gets a hold of the message first.    What if I wanted to use dspam to 
>> tag a message probability, and add some scores to SpamAssassin (which
>>     
> is 
>   
>> run by MailScanner?)    That way,  MailScanner remains the only system
>>     
>
>   
>> that's doing any tagging, quarantining, etc.
>>
>>  
>>
>> DSPAM is just an example.   I can think of several other nice little 
>> things I'd like to be able to do, too.
>>
>>  
>>
>> So, I guess the question is:   Is there any way to run a filter via 
>> Postfix **before** MailScanner gets its turn?    Or do I have it all 
>> wrong here?
>>
>>  
>>
>> Thanks in advance.
>>
>>     
>
>   

Jules

-- 
Julian Field MEng CITP CEng
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store

MailScanner customisation, or any advanced system administration help?
Contact me at Jules at Jules.FM

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
PGP public key: http://www.jules.fm/julesfm.asc


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the MailScanner mailing list