Bug 149657 - /etc/init.d/postfix start fails if no aliases_database defined in main.cf
Summary: /etc/init.d/postfix start fails if no aliases_database defined in main.cf
Alias: None
Product: Fedora
Classification: Fedora
Component: postfix   
(Show other bugs)
Version: 3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact:
: 150805 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-02-24 21:25 UTC by Steve Revilak
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-18 14:17:23 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Steve Revilak 2005-02-24 21:25:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.5.6 (KHTML, like Gecko) Safari/125.12

Description of problem:
with fc3, "/etc/init.d/postfix start" fails if there is no
aliases_database defined in main.cf.  Specifically, here is the
problem section:

   alias_database=$(postconf -h alias_database 2>/dev/null)
   [ -z "$alias_database" ] && {
       failure "determination of alias_database"
       return 0        

Postfix is quite happy to operate without an aliases database (eg - a
"dumb relay" that only forwards messages to a delivery hub).  If
postfix is happy to run without a alias file, then the init.d script
should be happy as well.

If there's no aliases file, the init.d script should simply not attempt
to run newaliases: eg

   start() {
        # Start daemons.
        echo -n "Starting postfix: "
        alias_database=$(postconf -h alias_database 2>/dev/null)
        if test -n "$alias_database"; then 
           /usr/sbin/postalias "$alias_database" 2>/dev/null
           if test $RETVAL -ne 0; then
               failure "postalias \"$alias_database\""
               return 0

        /usr/sbin/postfix start 2>/dev/null 1>&2 && success || failure
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix
        return $RETVAL

If it would help to have a clearer picture of the mail routing
arrangement we're using, here is a brief description:

  * we have one `hub' host.  This host handles outbound delivery of
    mail to the internet, binds to a public ip, has an aliaes file
    defined, and has $mydestinations defined.

  * we have a series of dumb relays.  These machines

     - have a postfix that listens on the loopback address only
       ("inet_interfaces = localhost")
     - do not accept mail for any destination
       ("mydestination" has a value of an empty string, as do 
        "alias_maps" and "alias_database").
     - relay all locally-generated messages to the hub host
       ("relayhost" is set to the name of the hub).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. in /etc/postfix/main.cf, set alias_database to an empty string
2. /etc/init.d/postfix restart


Actual Results:  /etc/init.d/postfix exited with a failure code; it did not attempt to start postfix.  (See "description" for script portion in question.

Expected Results:  If alias_database is not set, /etc/init.d/postfix should skip the attempt to run newaliases; it should simply start the postfix daemon instead.

Additional info:

My workaround has been to use a modified /etc/init.d/postfix script.

Comment 1 Thomas Woerner 2005-03-18 13:42:52 UTC
*** Bug 150805 has been marked as a duplicate of this bug. ***

Comment 2 Thomas Woerner 2005-03-18 14:17:23 UTC
Fixed in rawhide in rpm postfix-2.2.1-1 or newer.

Note You need to log in before you can comment on or make changes to this bug.