Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to configure postfix so that ALL mail that arrives (to any domain) is piped into a shell script that I have.

I have tried several things, including setting

mailbox_command = path_to_my_script

and this works, but will only accept mail to actual local accounts.

I also tried to set

local_recipient_maps =

which I believe is supposed to accept all mail, but this does not seem to work.

I am running postfix 2.5.5-1.1 on Ubuntu Jaunty (9.04).

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Take a look at master.cf. There are a lot of services/examples defined there already, it will be a good starting point. Next define virtual_transport and set it to the name you defined in master.cf. For example ( i am using dovecot's LDA at my setups ) :

In master.cf :

dovecot unix    -       n       n       -       -      pipe
  flags=DR user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -n -m ${extension}

In main.cf :

virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

This should get you started :)

Or you can implement it as a check_policy_service filter daemon for the smtpd_recipient_restrictions. Reading the postfix docs is the best place to get you started :)

share|improve this answer
    
I sort of got started with petre's answer, but the clarification of the master.cf-part helped a bit :) –  Francis Rath Sep 4 '09 at 19:45

define a service in master.cf and then in main.cf

virtual_transport = transport_name

or use it in /etc/transport if you don't have virtual addresses

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.