Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 714
  • Last Modified:

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?
0
jmicorp
Asked:
jmicorp
  • 6
  • 5
  • 5
2 Solutions
 
Maciej SsysadminCommented:
What error are you getting? Postfix has no problems at all with aliases in format you wrote (alias_name: user1@email, user2@email): http://www.postfix.org/aliases.5.html
0
 
jmicorpAuthor Commented:
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.
0
 
Maciej SsysadminCommented:
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.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
bevhostCommented:

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
0
 
bevhostCommented:
You can also use the sendmail command 'newaliases'
0
 
bevhostCommented:
0
 
jmicorpAuthor Commented:
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.
0
 
jmicorpAuthor Commented:
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.
0
 
bevhostCommented:
companyname.org and other companyhosted.com
should not be listed in /etc/postfix/hostnames, but rather in the virtual domains or the virtual file.

Read this carefully
http://www.postfix.org/VIRTUAL_README.html

Eg if you want to have
sales@companyname.org sales1user
sales@othercompanyhosted.com sales2user

then you cannot list these domains in /etc/postfix/hostnames.

See also
http://www.postfix.org/virtual.8.html

/etc/postfix/virtual
companyname.org
othercompanyhosted.com
sales@companyname.org           sales1user
sales@othercompanyhosted.com       sales2user


0
 
jmicorpAuthor Commented:
ok, so if i moved them to /etc/postfix/virtual -- then aliases can write to these names?
0
 
bevhostCommented:
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
0
 
Maciej SsysadminCommented:
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.
0
 
jmicorpAuthor Commented:
sendmail didn't support multiple recipients in a virtual table. Are you certain this is OK in postfix?
0
 
Maciej SsysadminCommented:
Yes I am :)
I'm using such configuration. It's described in man virtual (http://www.postfix.org/virtual.5.html).
0
 
Maciej SsysadminCommented:
Almost all above posts are answers for initial question.
0
 
Maciej SsysadminCommented:
Hm.. as for initial question in very first jmicorp's post, correct answer is in my opinion http:#23653787
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 6
  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now