Link to home
Start Free TrialLog in
Avatar of jmicorp
jmicorpFlag for United States of America

asked on

Postfix Aliases table does not support user@domain aliasing?

I've switched a very old and heavily used sendmail server over to postfix for maildir support.

I'm having trouble with the aliases table which holds some 200 aliases. Some are written as:
"username:  username, username, username"

whereas others are written as:
"username: email@address.org, email@address.org"

some of which are local virtually hosted domains. this worked fine with sendmail, but seems to fail with postfix. Is there a workaround?
SOLUTION
Avatar of Maciej S
Maciej S
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmicorp

ASKER

example:

aliasname: user.one@domainone.com, user.two@domaintwo.com

This implies an alias name is delivered to TWO domains virtually hosted on this single postfix server. Domainone and domaintwo are both MX'd to this server, however neither are the hostname's domain.

Remember that I'm using domainnames outside of the system's hostname.
I asked for exact error message.
Your configuration isn't very unusual - I'm using something similar on one of my servers and it works perfectly.
More than this - for testing purposes, I configured such alias, which is pointing to another addresses in some virtual domains hosted on the same mailserver - works as expected.
So - as you wrote "seems to fail with postfix" - what does it mean exactly? Post appropriate part of maillog with some errors saying that it doesn't work.

do you have the following in main.cf ?
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

have you then run
postalias /etc/aliases

and then
postfix reload
You can also use the sendmail command 'newaliases'
Avatar of jmicorp

ASKER

I don't have the specific error message as i've rewritten all the aliases in the format that it likes -- i couldn't go even an hour without them working.

The error message would rewrite the recipient domain. For example:

alias_to_test:     user1@centos.org, user2@fedorasolved.com, user3@cnn.com

error message:     550, message undeliverable to user1@localhostname.org
                          550, message undeliverable to user2@localhostname.org
                          550, message undeliverable to user3@localhostname.org

All three domain names are included in "mydestination = /etc/postfix/hostnames"
All aliases are referenced with "alias_maps = hash:/etc/aliases"
All aliases are built with "postalias hash:/etc/aliases"

Postfix has been reloaded as "/etc/init.d/postfix restart" numerous times during troubleshooting.

Thanks for your help. Sorry I'm not able to produce a more specific error message.
Avatar of jmicorp

ASKER

As a note explaining the error message,

A particular user on my network will have a username fitting a particular organization of first name letters and last name letters, sometimes followed by a number. Their virtusertable ("virtual_maps = hash:/etc/postfix/virtusertable") file will specify a publically recognizable name (full first name dot full last name at particular domain) and map it to the correct user account. We had been making aliases for the sake of multiple deliveries of a single message.

For example, we could make a virtusertable entry of:
rabidsportsfan@victoriassecret.com                             ridiculous_alias

Then an entry in aliases to distribute it:
ridiculous_alias:                    charlie.long@companyname.org, chuck.wagon@othercompanyhosted.com

Both "companyname.org" and "othercompanyhosted.com" are listed in my aforementioned "/etc/postfix/hostnames" file, and entries for charlie.long@companyname.org and chuck.wagon@othercompanyhosted.com are in the virtusertable pointing to valid local account names.

Though a bit complicated to explain, i hope that clears up any questions about how/what I'm doing here.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmicorp

ASKER

ok, so if i moved them to /etc/postfix/virtual -- then aliases can write to these names?
I think so, but I haven't tried it.

I generally prefer to use the virtual table instead of aliases anyway.
The reason I do this is that I store my virtual table in a mysql database with a web interface for easy management.
I just use the aliases file in /etc to hold local system aliases such as
webmaster: root
postmaster: root
root: dave
For something like above, you don't need aliases at all.
You may do this in virtual:
rabidsportsfan@victoriassecret.com   charlie.long@companyname.org, chuck.wagon@othercompanyhosted.com

You need aliases only when you want to point some email address to command - this cannot be done with virtual.
Avatar of jmicorp

ASKER

sendmail didn't support multiple recipients in a virtual table. Are you certain this is OK in postfix?
Yes I am :)
I'm using such configuration. It's described in man virtual (http://www.postfix.org/virtual.5.html).
Almost all above posts are answers for initial question.
Hm.. as for initial question in very first jmicorp's post, correct answer is in my opinion http:#23653787