3

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?

Alex
  • 8,111
  • 24
  • 71
  • 99

1 Answers1

2

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.

84104
  • 12,698
  • 6
  • 43
  • 75
  • 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 08: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