Bug 149657 - /etc/init.d/postfix start fails if no aliases_database defined in main.cf
/etc/init.d/postfix start fails if no aliases_database defined in main.cf
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: postfix (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Woerner
:
: 150805 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-24 16:25 EST by Steve Revilak
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Steve Revilak 2005-02-24 16:25:46 EST
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)
   RETVAL=1
   [ -z "$alias_database" ] && {
       failure "determination of alias_database"
       echo
       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)
        RETVAL=1
        if test -n "$alias_database"; then 
           /usr/sbin/postalias "$alias_database" 2>/dev/null
           RETVAL=$?
           if test $RETVAL -ne 0; then
               failure "postalias \"$alias_database\""
               echo
               return 0
           fi
        fi

        /usr/sbin/postfix start 2>/dev/null 1>&2 && success || failure
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix
        echo
        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):
postfix-2.1.5-2.2

How reproducible:
Always

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 08:42:52 EST
*** Bug 150805 has been marked as a duplicate of this bug. ***
Comment 2 Thomas Woerner 2005-03-18 09:17:23 EST
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.