1

... related to a previous question about trouble running postfix on Centos 5.2(Final)

Looks like postfix relies on aliases.db which is built by newaliases.postfix command

When I run newaliases.postfix it just hangs indefinitely. I have found some tips, but they weren't helpful (I've changed /etc/hosts and /etc/sysconfig/network accordingly to no effect)

Running strace newaliases.postfix shows this

...
close(4)                                = 0
munmap(0x2b9bb210c000, 4096)            = 0
read(0,  <unfinished ...>

Apparently it's trying to read from standard input but never gets any input.

Am I supposed to feed something to newaliases?

When I try newaliases.postfix < /etc/aliases I get

newaliases.postfix: fatal: Recipient addresses must be specified on \
the command line or via the -t option

3 Answers 3

1

You shouldn't have to specify newaliases.postfix, it should just be newaliases - but then again, you didn't tell me if you are on FreeBSD, Linux, OS X, or ? What are you running?

Just the command by itself should digest the file. If it's hanging on the digest then something is horked.

EDIT:

Ok, you have /etc/aliases.db now, but postfix is failing to start on CentOS.

Try this (as root):

yum upgrade postfix
service postfix restart ; tail -f /var/log/maillog

When postfix fails to start, it should dump out an error message at the end of the log, and the tail command will show that message for you.

3
  • it's centos 5.2
    – Evgeny
    Jul 29, 2009 at 18:16
  • well that made some difference I am cautiously optimistic :)
    – Evgeny
    Jul 29, 2009 at 18:18
  • now I have aliases.db, but postfix still does not start
    – Evgeny
    Jul 29, 2009 at 18:20
3

you have to put this on console and choose the right MTA (postfix in this case)

alternatives --config mta

then run

newaliases

this worked for me

1
  • 3
    For the record: I've just installed a completely fresh Centos 6.2 with only postfix installed. alternatives --config mta only had 1 option which was already selected, but selecting it again caused a /usr/bin/newaliases to be created. This seems to be a symlink via the /etc/alternatives/mta-newaliases link to /usr/bin/newaliases.postfix, yet the two behave differently. strace shows newaliases.postfix stops when it reads on stdin (read(0, ") .. newaliases doesn't read on stdin, it just seems to open /etc/passwd a few times then complete normally.
    – Neek
    Jul 19, 2012 at 3:46
0

Having exactly the same problem, newaliases.postfix hanging, strace the same.
CentOs v7.9.2009
Postfix v2.10.1

Read main.cf :

# If you change the alias database, run "postalias /etc/aliases" (or
# wherever your system stores the mail alias file), or simply run
# "newaliases" to build the necessary DBM or DB file.

And this command is working for me (aliases.db updating):
postalias /etc/aliases

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .