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

I have a Debian server running postfix. In the file /etc/postfix/main.cf there is this line:

mailbox_command_maps  = pcre:/etc/postfix/mailbox-pcre

The file /etc/postfix/mailbox-pcre contains lines like this:

/^action/       /usr/sbin/takeaction -q
/^filter/       /usr/bin/filter-special
/^archway/      /usr/bin/archway2

I have a new situation where I want all e-mails with a To: address starting with "tester" to be run through a Perl script. I added a new entry to the file /etc/postfix/mailbox-pcre` like so:

/^action/       /usr/sbin/takeaction -q
/^filter/       /usr/bin/filter-special
/^archway/      /usr/bin/archway2
/^tester/       /usr/bin/tester

I added this line and restarted postfix. When I send an e-mail to the tester e-mail address I am getting an "unknown user" error. So there must be something else I need to do so that postfix recognizes the tester e-mail address.

What else do I need to do?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

User tester must defined as local user (either by listing as system user or define in local_recipient_maps).

Another solution is define your command in alias_maps. For example

#main.cf
alias_maps = hash:/etc/aliases, pcre:/etc/aliases.pcre

#pcre:/etc/aliases.pcre
/^tester/  "|/usr/bin/tester"
/^action/  "|/usr/sbin/takeaction -q"
/^filter/  "|/usr/bin/filter-special"
/^archway/ "|/usr/bin/archway2"

This answer inspired by this thread

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.