# /etc/aliases not working as expected



## pez (Dec 9, 2017)

I have a problem that seems to be particular to my arm systems, it may not be just arm and I may (probably) have stuffed up but I have other FreeBSD systems that I've setup without issue.

my hostname is beaglebone
in postfix i have

```
myhostname = beaglebone.dodgydivetours.org
mydomain = dodgydivetours.org
myorigin = dodgydivetours.org
```

in /etc/resolv.conf

```
search dodgydiverours.org
```

I have added an entry in /etc/aliases

```
root:    andrew@anotherdomain.com
```

however any emails to root go to andrew@dodgydivetours.org

previously, on another installation, in postfix the domain was mydomain.com and emails to root went to andrew@mydomain.com despite having

```
root: andrew@anotherdomain.com
```
in the aliases file.

I have other FreeBSD systems, amd64, that seem to work this out ok, however it is also possible I've made a configuration error in main.cf

sure I can work around it, however any clues to what I have stuffed up would be nice

thanks in advance
andrew


----------



## Oko (Dec 9, 2017)

Did you run `newaliases` after updating the file?


----------



## pez (Dec 10, 2017)

yeah I did. after further testing. it appears that no matter what i put in /etc/aliases, it will send to andrew@whateverdomain is in postfix main.cf as myorigin
which probably means i've done it wrong


----------



## ShelLuser (Dec 10, 2017)

pez said:


> in resolv.conf
> search dodgydiverours.org


This seems to be missing a t, not that it would change the behavior.



pez said:


> I have added an entry in /etc/aliases
> root:    andrew@anotherdomain.com
> 
> however any emails to root go to andrew@dodgydivetours.org


You forgot to mention the most important settings.

So what did you define for alias_maps, virtual_alias_maps and/or newaliases_path? And did you by any chance change local_recipients_maps?


----------



## pez (Dec 10, 2017)

alias_maps isn't defined
virtual_alias_maps isn't even in my main.cf
newaliases_path = /usr/local/bin/newaliases

I didn't change local_recipients_maps


----------



## ShelLuser (Dec 11, 2017)

pez said:


> alias_maps isn't defined


I think that could be an issue, but I am not sure because I don't have hands on experience with Arm devices. Thing is:


```
# The alias_maps parameter specifies the list of alias databases used
# by the local delivery agent. The default list is system dependent.
```
So if /etc/aliases doesn't work and `# postalias /etc/aliases` nor `# newalises` had any effect then I cannot help wonder if Postfix maybe doesn't consider this to be a default.

Either way, it won't hurt. So I'd suggest to define alias_maps in your main.cf to see what happens next (don't forget to reload or restart Postfix).


----------



## pez (Dec 14, 2017)

well I was about to try that, but first I thought I'd do some more thorough testing, as it seemed /etc/aliases was being used only for the local username and ignoring the domain. 

only now it is working as intended. so I don't know if it was actually broken or I was trying too many different things at once.

thankyou people for taking the time to respond, I apppreciate it
regards
pez


----------

