mailscanner, queue & nfs

Julian Field MailScanner at ecs.soton.ac.uk
Mon Mar 17 22:09:54 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Alessandro Dentella wrote:
> On Mon, Mar 17, 2008 at 09:08:22PM +0100, Hugo van der Kooij wrote:
>   
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Alessandro Dentella wrote:
>> | Hi,
>> |
>> |   can I keep the postfix queues on NFS so that 2 concurrent host run
>> |   mailscanner on the same queue?
>> |
>> |   Which kind of problems... am I looking for?
>>
>> How are you managing locks?
>>
>> If you have two hosts then distribute the mail with SMTP on both hosts.
>> That way you can lose one system and still get something done.
>>
>> That NFS ploy is just looking for more trouble instead of solving an issue.
>>     
>
> I'm not yet doing this, so I'm not managing locks!
> This setup would olny be an intermediate way to migrate a system that is
> always under too hight load to a newer one (same hw, really).
>
> I'like to understand how different blocks are impacting on load so I wanted
> to isolate mailscanner, while at it I also wandered if it would be possible
> to go in parallel. (the same box has also imap/pop and we receive around
> 150.000 mail a day)
>
> And what about haveing (temporarily) postfix on a box and mailscanner on a
> different box that works on an NFS exported spool directory.
>
> Would that be again looking for troubles or not (since there should not be
> concurrency between different MailScanner processes.)
>   
You *are* looking for trouble here.
> My understanding (please correct me if I'm wrong) is that mailScanner only
> acts on mails in the queue with HOLD flag and postfix won't touch those
> files. My guess is that non lock problem shou arise, but I'm /really/ not en
> expert un this issue.
>   
:-)
The problems are two-fold:
1) MailScanner mustn't start processing a mail until Postfix has 
finished writing it. It can still be writing it after it has decided to 
put it into the HOLD queue. So you need locking between MailScanner and 
Postfix.
2) MailScanner processes (of which there are "Max Children" in 
MailScanner.conf) compete for access to the same messages, and must lock 
each other out. So you need locking between competing MailScanner children.

(2) is a solved problem (except for 1 poor user at the moment who is 
having problems which I haven't cracked yet). (1) is difficult due to 
the way Postfix is written. I have done it, but it is not NFS-safe. 
There is only 1 locking method that is really NFS-safe, and it's not the 
one Postfix uses (someone will surely correct me here if I'm wrong).

You *really* don't want to get into the game of NFS-mounting Postfix 
mail queues. You are asking for a world of pain.

You have 2 boxes (your intended Postfix box and your intended 
MailScanner box). Why not just run Postfix+MailScanner on them both and 
have 2 identically-weighted MX records pointing to them? Uses the same 
amount of hardware for the same number of messages, gets rid of all your 
locking problems, and will work :-)

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


-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.8.1 (Build 2523)
Comment: Use Thunderbird Enigmail to verify this message
Charset: ISO-8859-1

wj8DBQFH3uw0EfZZRxQVtlQRAmbLAKDE7edODvy9BoefEwadaO3hF5WFIACg1WL+
JW+HX/G2URTE6rbxcblBSkw=
=+GnW
-----END PGP SIGNATURE-----

-- 
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