On Sun, Mar 09, 2025 at 01:13:06AM +0100, Andreas Kuhlen via Postfix-users 
wrote:

> > I am running Postfix out of /opt, with just "alternatives" symlinks for
> > /usr/sbin/sendmail.  So less prone to conflicts with system updates.
> 
> Could you please tell me a little more about the "alternatives"
> symlinks for /usr/sbin/sendmail? Why are these necessary and what are
> you linking sendmail against?

Well, local mail submission, e.g. from cron jobs, uses
/usr/sbin/sendmail (perhaps indirectly via /bin/mail or /bin/mailx),
which needs to ultimately resolve to the sendmail(1) for the active
Postfix.

So I have:

    $ f=/usr/sbin/sendmail
    $ while :; do
        printf "%s\n" "$f"
        g=$(readlink "$f")
        if [ -z "$g" -o "$g" = "$f" ]; then break; fi
        f="$g"
      done
    /usr/sbin/sendmail
    /etc/alternatives/mta
    /opt/postfix/sbin/sendmail

Configured by customising /var/lib/alternatives/mta.

The systemd unit starts Postfix from /opt/:

    Type=forking
    PIDFile=/var/spool/postfix/pid/master.pid
    EnvironmentFile=-/etc/sysconfig/network
    PrivateTmp=true
    ProtectSystem=false
    PrivateDevices=false
    ExecStart=/opt/postfix/sbin/postfix start
    ExecReload=/opt/postfix/sbin/postfix reload
    ExecStop=/opt/postfix/sbin/postfix stop

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

Reply via email to