6

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

2 Answers2

5

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

sh1ny
  • 535
  • 3
  • 6
0

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

quaie
  • 1,122
  • 6
  • 14