Postfix's virtual alias maps

Postfix's virtual alias maps

Postfix allows you to store virtual alias maps in a text file, which tells postfix how to route virtual email addresses to real users on the system. This setting and the file location is determined in the postfix configuration file /etc/postfix/main.cf like so:

12virtual_alias_maps = hash:/etc/postfix/virtual

The format of the file is with the alias on one side, and the destination on the other, for example like so:

1234john_smith@example.com john
john-smith@example.com john
fred@example.com john

This routes all email addressed to john_smith@example.com, john-smith@example.com and fred@example.com to the real user (or system alias) john. It's possible to have a catch-all alias :x which will route anything addressed to @example.com to a particular user like so:

12@example.com john

If you wanted everything to go to "john" except for mail to fred@ then you can do it like this:

123@example.com john
fred@example.com fred

Just editing the /etc/postfix/virtual file is not enough to make the changes take affect. You must run the postmap command to make postfix read the file, like so:

12/usr/sbin/postmap /etc/postfix/virtual

This creates a new file called /etc/postfix/virtual.db and the aliases are now loaded into postfix.

 

Labels: ,

Yorum Gönder

Emoticon
:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

Author Name

İletişim Formu

Ad

E-posta *

Mesaj *

Blogger tarafından desteklenmektedir.