On Fri, Nov 06, 2009 at 10:16:35AM +0300, devel anaconda wrote: > Actually, I didn't tell the complete story. > The point is: > > MTA (postfix) recieves the message. Then I need to put this message > to 3 scripts (I must notify three different services about incoming > mail). Now it looks like this: > > mail comes to u...@localhost on my Postfix, on aliases file I have: > > user: user1,user2,user3 > > user1: |/usr/local/bin/script1 > user2: |/usr/local/bin/script2 > user3: |/usr/local/bin/script3 > > probably it'll be more scripts soon. When script1 fails with exit 75, > but script2 and script3 have success, I must return mail for script1 to > queue and try again later, and remove from queue messages for script2 and > script3.
Well, the Postfix "local" delivery agent does not do that for you, it will retry all the scripts again, because local alias expansion is done on each delivery attempt. The queue file stores only the original recipient "user", so that can either be marked completed or re-processed each time. You could attempt to create appropriate "owner-alias" entries to make this work, but with complex alias trees, I can't remember how. Far easier to make your alias expansion to 3 users happen in virtual(5) (pre-queue) not aliases(5) (post-queue). For the throughput you are expecting, and especially running 3 three (and later more) scripts for each message, you are not getting the job done on the hardware you propose without serious optimization and a design that reduces (rather than increases) the number of scripts going forward if at all possible. > That's why I use postfix and that's why I can't use pre-queued > filter. I thought about different scheme, but postfix is the "easy way", so I'm trying speedup things a bit :) You are not going to succeed without more spindles and likely more CPUs. Just launching a "Perl" hello-world script takes >10ms on a fast machine, do that 100 times a second and you've burned a CPU, and non-trivial scripts are slower still. -- Viktor. Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the "Reply-To" header. To unsubscribe from the postfix-users list, visit http://www.postfix.org/lists.html or click the link below: <mailto:majord...@postfix.org?body=unsubscribe%20postfix-users> If my response solves your problem, the best way to thank me is to not send an "it worked, thanks" follow-up. If you must respond, please put "It worked, thanks" in the "Subject" so I can delete these quickly.