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 have this in my main.cnf:

alias_maps= regexp:/etc/aliases

Inside that file, I have:

/^reply*$/: jjj

Now, when I send it to reply-124233@mydomain.com, postfix bounces it because

Recipient address rejected: User unknown in local recipient table;

How can I configure my aliases so that people can send reply*@mydomain.com and forward it to jjj@mydomain.com?

share|improve this question
    
Is mydomain.com your primary domain, or is it a virtual domain? –  NickW Apr 12 '13 at 16:36

1 Answer 1

up vote 0 down vote accepted
+250

Assuming that's not a typo and /^reply*$/: jjj really is the entry in your table, then your regular expression is incorrect for what you are trying to do and you are not using the proper syntax for regexp_table(5)

You'd want /^reply.*$/ jjj.

I think you might also be better served by adding and additional table rather than overriding the standard one.

alias_maps = hash:/etc/mail/aliases, regexp:/etc/postfix/reply-regexp-alias

Also, keep in mind that alias_maps are used for local(8) and not virtual(5) delivery, meaning that the system this is occurring on must think of itself as the final destination for all @mydomain.com addresses, though something thing can be done with virtual_alias_maps.

share|improve this answer
    
What's the difference between local and virtual? For my purpose, actually I am piping it to a script. Whenever someone sends an email to reply-12345@mydomain.com, my postfix will catch it via the regexp and pipe it to a python script. Then, my python script will insert a record into the database. –  Alex Apr 14 '13 at 8:55
    
@Alex You can read the links documentation for a more full understanding, but if you are piping to a script you definitely want local, as virtual does not allow for that kind of behavior. –  84104 Apr 15 '13 at 17:24

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.