Postfix: Difference between revisions

From miki
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:
* [http://www.postfix.org/postconf.5.html Postfix Configuration Parameters].
* [http://www.postfix.org/postconf.5.html Postfix Configuration Parameters].


== Adding aliases ==
== Aliases ==
=== Add static aliases in default configuration ===
* Edit {{file|/etc/aliases}}
* Edit {{file|/etc/aliases}}
* Then run ''newaliases'':
* Then run ''newaliases'':
Line 8: Line 9:
newaliases
newaliases
</source>
</source>

=== Uses regexp (dynamic) aliases ===
Edit file {{file|/etc/postfix/main.cf}} as follows [http://superuser.com/questions/353488/regex-multiple-catch-all-setup-in-postfix]:
alias_maps = regexp:/etc/postfix/aliases-regexp

Then create {{file|/etc/postfix/aliases-regexp}} as follows:

/^tom\..*@domain.com$/ tom@other.com
/^phil\..*@domain.com$/ phil@other.com


== Troubleshooting ==
== Troubleshooting ==

Revision as of 04:55, 13 July 2016

References

Aliases

Add static aliases in default configuration

  • Edit /etc/aliases
  • Then run newaliases:
newaliases

Uses regexp (dynamic) aliases

Edit file /etc/postfix/main.cf as follows [1]:

alias_maps = regexp:/etc/postfix/aliases-regexp

Then create /etc/postfix/aliases-regexp as follows:

/^tom\..*@domain.com$/     tom@other.com
/^phil\..*@domain.com$/    phil@other.com

Troubleshooting

Debugging aliases

Use postmap:

postmap -q mip@prime.immie.org hash:/etc/aliases regexp:/etc/aliases-regexp
postmap -q mip hash:/etc/aliases regexp:/etc/aliases-regexp