# aliases not working in postfix



## Fireball (Oct 17, 2012)

Hello!
I have FreeBSD 7.4 with postfix 2.4.5. Also I have OpenLDAP 2.3.38.
When I am trying to use aliases, for example, like this two@company.com.
in /etc/mail/aliases I get message from MAILER-IDAEMON@mail.company.com with topic "Undelivered Mail Returned to Sender".

The mail system

```
<two@company.com>: user unknown
```
But actually I create user two in OpenLDAP.

In file /etc/mail/aliases there is string

```
two: user1, user2
```

And in postfix config

```
alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases
```
And then I did
`# postalias /etc/mail/aliases`

I read http://www.postfix.org/VIRTUAL_README.html#virtual_alias and
http://www.postfix.org/ADDRESS_REWRITING_README.html but I didn't understand what I do not correctly.

Output of *postconf* in the attached file.


----------



## mamalos (Oct 18, 2012)

If company.com is a virtual domain, then mail_aliases is not what you're looking for, virtual_alias_maps is, which is set to virtual_maps in your case, which is unset. I have only read your config diagonally, so I don't have a decent view and hence I might be mistaken.

I'd suggest a minimal config that definitely runs correctly and then slowly migrate to one using LDAP.


----------

