# postfix problem  [SOLVED]

## joePRL

I hope this is the right forum for this question.I have been using an older postfix version for several years until the old machine just wouldn't run anymore. So, I am trying to install postfix on a server. I have emerged postfix 2.2.5 successfully, but I can't find my aliases file anywhere. I looked in /etc/postfix and its not there.  I did see a /etc/mail/aliases but its not the same one as I used before.

Once I start postfix I get this error:

```

Apr 7 16:45:22 monk postfix/local[10605]: fatal: open database /etc/postfix/aliases.db: no such file or directory

```

In my main.cf file I have the variables:

alias_maps = hash:/etc/postfix/aliases

alias_database = hash:/etc/postfix/aliases

I can't think of what to do next. I've been going on memory. Can anybody recommend a good Howto or FAQ for installing postfix on Gentoo. I don't hink I need the Virtual Mailhosting System howto that I saw in the Gentoo Docs section because I'm only dealing with one domain.

Thanks,

JoeLast edited by joePRL on Thu Apr 13, 2006 9:36 pm; edited 1 time in total

----------

## kashani

Postfix expects a has file of aliases which makes for fast comparisons rather than a human readable text file which is slow to parse. Do the following which will create the aliases.db

```

cd /etc/postfix/

postmap aliases

/etc/init.d/postfix restart

tail -f /var/log/messages

```

Things should look better in your logs at this point.

kashani

----------

## joePRL

I appreciate the suggestion Kashani, especially since it looked so straightforward.

I tried your command in the proper directory as root. But I recieved the following complaint:

```

 postmap aliases

postmap: fatal: open aliases: No such file or directory

```

I then restarted postfix anyway and saw some mail waiting in the queue but also some error messages.

```

Apr 10 09:55:03 monk postfix/master[15732]: daemon started -- version 2.2.5,

configuration /etc/postfix

Apr 10 09:55:03 monk postfix/qmgr[15734]: BCC3A13E61:from=<admin@pandalog.com>, size=3785, nrcpt=1 (queue active)

Apr 10 09:55:03 monk postfix/qmgr[15734]: 358D213E63:from=<jcameron@princerupert.ca>, size=260491, nrcpt=1 (queue active)

Apr 10 09:55:03 monk postfix/qmgr[15734]: 1D08213E60:from=<Stefanie.Hencheroff@redcross.ca>, size=4232, nrcpt=1 (queue active)

Apr 10 09:55:03 monk postfix/local[15736]: fatal: open database /etc/postfix/aliases.db: No such file or directory

Apr 10 09:55:04 monk postfix/master[15732]: warning: process/usr/lib/postfix/local pid 15736 exit status 1

Apr 10 09:55:04 monk postfix/master[15732]: warning: /usr/lib/postfix/local:bad command startup -- throttling

Apr 10 09:55:13 monk postfix/postmap[15737]: fatal: open aliases: No such file or directory

Apr 10 09:56:04 monk postfix/local[15740]: fatal: open database /etc/postfix/aliases.db: No such file or directory

Apr 10 09:56:05 monk postfix/master[15732]: warning: process /usr/lib/postfix/local pid 15740 exit status 1

Apr 10 09:56:05 monk postfix/master[15732]: warning: /usr/lib/postfix/local:bad command startup -- throttling 

```

Any other suggestions?

Joe

----------

## joePRL

Hello Kashani and others who have read my posting.

I have improved my situation a bit.

I looked at my original main.cf file and saw that the original location of  the aliases file was /etc/mail/aliases.

I moved that file from there to /etc/postfix/aliases

I restarted postfix and saw several mail messages being managed but no error messages. So that's an improvement. I then  attempted to send myself a message and that went through. That is joe@princerupertlibrary.ca to joe@monk.princerupertlibrary.ca

Then I sent a message from an outside email account to myself and that worked too! Pine received it fine.

But when I sent an email message from the new postfix install on monk TO an outside account it failed.

I saw the following error in the logfile:

```

Apr 10 11:59:33 monk postfix/qmgr[16441]: B4EC313E60:from=<joe@monk.princerupertlibrary.ca>, size=607, nrcpt=1 (queue active)

Apr 10 11:59:34 monk postfix/smtp[16485]: B4EC313E60: to=<deplib@citytel.net>,relay=cuda.citytel.net[204.244.98.55], delay=1, status=bounced (host cuda.citytel.net[204.244.98.55] said: 550 <joe@monk.princerupertlibrary.ca>:

Sender address rejected: Domain not found (in reply to RCPT TO command)) 

```

I will explore this error.

Joe

----------

## kashani

Joe, 

When I read your original post I assumed that you had created a /etc/postfix/aliases file and had set Postfix to use it as well. Assuming you're start from a default config, do the following.

remove all that hash:/etc/postfix/aliases stuff you added.

edit /etc/mail/aliases and make your changes

run the command newaliases

restart postfix and you should be good to go.

kashani

----------

## joePRL

Hello Kashani:

Well, I hope I understand you correctly. When you wrote:

remove all that hash:/etc/postfix/aliases stuff you added.

edit /etc/mail/aliases and make your changes

run the command newaliases

I think you meant by "remove..." line to change the variable alias_maps in main.cf back to hash:/etc/aliases

and variable alias_database=hash:/etc/aliases.

I have done the editing to /etc/aliases (well, I assigned a user to root; I'll add other aliases later)

Then I restarted postfix

And when I tried to run the command newaliases -as root , in the /etc/postfix directory

a prompt returned with no errors

I then sent an email from joe to joe and it was received. I will keep watching the logs for errors.

Now I think I have to get a pop3 server running on the machine. So far I've emerged qpopper but haven't figured out how to turn it on yet.

Joe

----------

