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.

Currently I have a /etc/postfix/virtual file that has entries like:

user@foo.com foo@bar.com 

I want to be able to forward user+asdf@foo.com to foo+asd@bar.com

How do I do this?

EDIT: I did set

propagate_unmatched_extensions = canonical, virtual

and

recipient_delimeter = +

but still keep getting Recipient address rejected: User unknown in local recipient table;

EDIT II: I made the changes suggested in @Schot's updated answer with some progress;

Now I get Recipient address rejected: User unknown in virtual alias table; when sending to user+asdf@foo.com

Sending to user@foo.com worked both before and after them modifications

EDIT III:

Postfix is version 2.3.3 - I do not have separate mail.warn or mail.err logs - just the /var/log/maillog. Here is the full (anonymized) snippet:

EDIT IV: Updated to postfix 2.3.19 with no luck.

EDIT V: Doing postconf -n showed that recipient_delimiter was misspelled in the main.cf as well as above and the delimiter was not processed at all.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

It's recipient_delimiter not recipient_delimEter

share|improve this answer

Your current entries are OK, you should look at the propagate_unmatched_extensions configuration parameter. Check that it includes virtual.

About you regex not working, see the man page for virtual(8):

The virtual(8) delivery agent disallows regular expression substitution of $1 etc. in regular expression lookup tables, because that would open a security hole.

Update

I have tested your configuration and it works for me. Maybe one of the following is the problem:

  • Is the virtual domain ("foo.com") listed in mydestination? If it is, remove it.
  • Is the virtual domain listed in virtual_alias_domains? If not, add it.

Side note: Does sending mail to user@foo.com (without a +delimiter) work?

share|improve this answer
    
I made the changes, some progress: now I get Recipient address rejected: User unknown in virtual alias table; when sending to user+asdf@foo.com - user@foo.com worked both before and after them modifications –  Kimvais Aug 29 '10 at 8:22
    
@Kimvais: I'm running out of ideas... What is your postfix version? Anything in /var/log/mail.warn or /var/log/mail.err? –  schot Aug 31 '10 at 13:38
    
@schot - so am I. Updated the question nevertheless... –  Kimvais Sep 1 '10 at 12:06
    
@Kimvais: Version 2.3.3 is pretty old, try upgrading to 2.3.19 or the latest 2.6 or 2.7 release. –  schot Sep 2 '10 at 5:52
    
@schot: just upgraded to 2.3.19 - no help. Will try 2.7 next... –  Kimvais Sep 2 '10 at 9:29

$number substitutions are not allowed in the virtual file as a security precaution. http://www.postfix.org/PCRE_README.html

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.