Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2004 00:57:21 -0700
From:      "Darren Pilgrim" <dmp@bitfreak.org>
To:        <questions@freebsd.org>
Subject:   Mail(1) breaks when contrib/sendmail is replaced with postfix?
Message-ID:  <000101c468af$09f42fe0$152a15ac@spud>

next in thread | raw e-mail | index | archive | help
I use postfix for my mail servers, rather than sendmail.  Postfix =
installs
the sendmail-replacement programs under /usr/local.  The programs from
contrib/sendmail are under /usr, so you end up with two copies of these
programs when postfix is installed.  To avoid prevent security issues =
and
other problems I remove the old contrib/sendmail binaries and define
NO_SENDMAIL in /etc/make.conf.

For better integration, postfix can be started through the mailer
configuration in the base system by adding certain lines to /etc/rc.conf =
and
/etc/mail/mailer.conf.  This points sendmail, mailq, etc. to
/usr/local/sbin/sendmail.  This works very well, with one exception, the
periodic scripts don't seem to run.  I've been able to narrow this down =
to
this error from /usr/bin/mail:

/usr/bin/mail tries to run /usr/sbin/sendmail directly.  This probably =
isn't
a good idea, since IIRC sendmail can now be package-ized and removed =
from
the base system as well as excluded from buildworld.  This is what seems =
to
be breaking the periodic script, since I get this error when running
periodic:

# periodic daily
mail: /usr/sbin/sendmail: No such file or directory

# mail someone
Subject: foo
foo=20
.
EOT
# mail: /usr/sbin/sendmail: No such file or directory

Why would /usr/bin/mail be doing this?  I couldn't find any knobs for
periodic.conf or mail.rc that would affect this.  I've had this problem =
with
other programs and shells where if you run a program without giving a =
path
(forcing a path search), then move the program to another point in the =
path
(say from /usr/bin to /usr/local/bin), you'll get similar "file not =
found"
errors.  Rebooting fixes the problem, but rebooting hasn't fixed this =
one.
Also, I can fix the problem by making a symlink from the postfix =
sendmail
binary to /usr/sbin/sendmail, but that's not really a workable solution.

How do I fix this?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000101c468af$09f42fe0$152a15ac>