09.12.2024 00:56, Wietse Venema via Postfix-users пишет:
Michael Tokarev via Postfix-users:
Just to demonstrate what's in debian about the matter, which I basically
just removed a few days ago:

https://salsa.debian.org/postfix-team/postfix-dev/-/commit/60a176aeee7dc0397037bc7980d5f3f265b624fa
 -

"Access blocked: Debian Salsa can only be used within its organization"

That's unfortunate - it should allow public access.  I'll double-check.

Here's the function in question:

runnewaliases() {
    db_get postfix/main_mailer_type && mailer="$RET"
    if [ "$mailer" != "No configuration" ] || [ -f /etc/postfix/main.cf ]; then
        db_fget postfix/newaliases run || true
        if ( $RET ); then
            echo "Running newaliases"
            rm -f /etc/aliases.db   # handle the roll to db2.0
            # newaliases chokes if hostname not set
            # newaliases is equivalent to postalias $(postconf -hx 
alias_database)
            # and in debootstrap, newaliases == /bin/true...
            if [ -z "$(postconf -hx myhostname||true)" ]; then
                cp -a main.cf main.cf.dpkg.$$
                postconf -e 'myhostname=debian'
                newaliases
                db_fset postfix/newaliases run false
                mv main.cf.dpkg.$$ main.cf
            else
                newaliases
                db_fset postfix/newaliases run false
            fi
        fi
    fi
}

Anyway, I think that the correct optimization is run newaliases
etc. well AFTER the machine knows its hostname; that is IMNSHO
better than adding special-case workarounds.

Yes, I've got the idea.  It took 25 years to get there ;)

/mjt
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to