Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

postfix-script maildrop permission errors, but not using maildrop for delivery

1,331 views
Skip to first unread message

terrygal...@fastest.cc

unread,
Aug 18, 2014, 10:21:43 PM8/18/14
to
Im having a heck of a time figuring this one out! I'm betting I missed something in config but "hellifikno"!

Mail's working for me in both directions. But when I start postfix I get in my logs

==> mail.warn <==
Aug 18 13:19:51 tgdesktop postfix/postfix-script[11288]: warning: not owned by group maildrop: /var/spool/postfix/public
Aug 18 13:19:51 tgdesktop postfix/postfix-script[11289]: warning: not owned by group maildrop: /var/spool/postfix/maildrop

==> mail <==
Aug 18 13:19:51 tgdesktop postfix/postfix-script[11302]: starting the Postfix mail system
Aug 18 13:19:51 tgdesktop postfix/master[11303]: daemon started -- version 2.9.6, configuration /etc/postfix

The only mention of maildrop I can find in any of the postfix configs is

cat /master.cf
...
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
...

Checking just to be sure that it's there

ls -al /usr/local/bin/maildrop
-rwxrwxr-x+ 1 vmail vmail 238K Jul 14 07:07 /usr/local/bin/maildrop*

In my postfix config I don't use maildrop to deliver, instead I use dovecot

egrep virtual "main.cf|postdrop"
setgid_group = postdrop
virtual_mailbox_domains = $mydomain
virtual_mailbox_maps = lmdb:${config_directory}/vmailbox
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_alias_maps = lmdb:${config_directory}/virtual

I dug around online and found a bunch of suggestions & guesses about what to do. Last attempt I did all of

systemctl stop postfix
killall -9 postdrop
chmod -x,g-w /usr/local/etc/postfix/*
chmod g-w /usr/local/etc/postfix/scripts/*
chgrp postdrop /usr/local/sbin/postqueue
chgrp postdrop /usr/local/sbin/postdrop
chmod g+s /usr/local/sbin/postqueue
chmod g+s /usr/local/sbin/postdrop
chgrp -R postdrop /var/spool/postfix/public
chgrp -R postdrop /var/spool/postfix/maildrop
postfix set-permissions
postfix check
systemctl start postfix

with no errors afaict. But it still doesn't make that warning go away.

Is something actually broken in my setup? Or is this just a noisy warning I can ignore? Can I fix it, or make it go away?

I'm not even clear on what to look for for the actual source of these messages :-/

Terry

Viktor Dukhovni

unread,
Aug 18, 2014, 10:38:49 PM8/18/14
to
On Mon, Aug 18, 2014 at 07:21:43PM -0700, terrygal...@fastest.cc wrote:

> Im having a heck of a time figuring this one out! I'm betting I missed something in config but "hellifikno"!
>
> Mail's working for me in both directions. But when I start postfix I get in my logs
>
> ==> mail.warn <==
> Aug 18 13:19:51 tgdesktop postfix/postfix-script[11288]: warning: not owned by group maildrop: /var/spool/postfix/public
> Aug 18 13:19:51 tgdesktop postfix/postfix-script[11289]: warning: not owned by group maildrop: /var/spool/postfix/maildrop

Note, the "maildrop" in question is the group specified with
"setgid_group" and is unrelated to the "maildrop" LDA.

> The only mention of maildrop I can find in any of the postfix configs is

Check the compiled-in default value of "setgid_group".

> chgrp -R postdrop /var/spool/postfix/maildrop

That won't help, since the expected group is "maildrop".

> postfix set-permissions

This (executed as root) should normally set the correct permissions,


> Is something actually broken in my setup? Or is this just a noisy warning I can ignore? Can I fix it, or make it go away?

Post the output of:

$ ls -ld /var/spool/maildrop
$ ls -ld /usr/sbin/postdrop
$ postconf config_directory setgid_group

On some BSD systems there is a Postfix in the base system as well as
a separate Postfix installed by the package manager. In that case you
need to make sure you're listing the right binaries, and looking at
the right configs.

--
Viktor.

terrygal...@fastest.cc

unread,
Aug 18, 2014, 10:55:09 PM8/18/14
to
Hi

On Mon, Aug 18, 2014, at 07:38 PM, Viktor Dukhovni wrote:
> Note, the "maildrop" in question is the group specified with
> "setgid_group" and is unrelated to the "maildrop" LDA.

Well that helps some!

> > The only mention of maildrop I can find in any of the postfix configs is
>
> Check the compiled-in default value of "setgid_group".

I though that'd get an override from

egrep virtual "main.cf|postdrop"
setgid_group = postdrop

> > chgrp -R postdrop /var/spool/postfix/maildrop
>
> That won't help, since the expected group is "maildrop".
>
> > postfix set-permissions
>
> This (executed as root) should normally set the correct permissions,

I executed is as root.

> > Is something actually broken in my setup? Or is this just a noisy warning I can ignore? Can I fix it, or make it go away?
>
> Post the output of:
>
> $ ls -ld /var/spool/maildrop
> $ ls -ld /usr/sbin/postdrop
> $ postconf config_directory setgid_group
>

ls -ld /var/spool/maildrop
ls: cannot access /var/spool/maildrop: No such file or directory
ls -ld /usr/sbin/postdrop
-rwxr-sr-x 1 root maildrop 15K Oct 18 2013 /usr/sbin/postdrop*
postconf config_directory setgid_group
config_directory = /usr/local/etc/postfix
setgid_group = postdrop

> On some BSD systems there is a Postfix in the base system as well as
> a separate Postfix installed by the package manager. In that case you
> need to make sure you're listing the right binaries, and looking at
> the right configs.

This is Linux/64. My own build of postfix is in

ls -al `which postfix`
-rwxr-xr-x+ 1 root root 149K Jul 10 17:09 /usr/local/sbin/postfix*

postconf -d | grep ^mail_version
mail_version = 2.11.1

and is running

ps ax | grep postfix
11303 ? Ss 0:00 /usr/lib/postfix/master

The distro does have a local build installed

rpm -qa | grep -i postfix
postfix-2.9.6-7.4.1.x86_64

that I try pretty hard to ignore.

Terry

Viktor Dukhovni

unread,
Aug 18, 2014, 11:06:20 PM8/18/14
to
On Mon, Aug 18, 2014 at 07:55:09PM -0700, terrygal...@fastest.cc wrote:

> > Post the output of:
> >
> > $ ls -ld /var/spool/maildrop
> > $ ls -ld /usr/sbin/postdrop
> > $ postconf config_directory setgid_group
> >
>
> ls -ld /var/spool/maildrop
> ls: cannot access /var/spool/maildrop: No such file or directory

Naturally, I meant /var/spool/postfix/maildrop

> ls -ld /usr/sbin/postdrop
> -rwxr-sr-x 1 root maildrop 15K Oct 18 2013 /usr/sbin/postdrop*

Clearly, the postdrop executable belongs to the "maildrop" group, but
likely the directory does not.

> postconf config_directory setgid_group
> config_directory = /usr/local/etc/postfix
> setgid_group = postdrop

And yet main.cf (seemingly) specifies "postdrop". And your
configuration is in /usr/local/etc/postfix. Where are the binaries:

$ postconf command_directory queue_directory

> ls -al `which postfix`
> -rwxr-xr-x+ 1 root root 149K Jul 10 17:09 /usr/local/sbin/postfix*

But you also have Postfix binaries /usr/sbin, creating much confusion.


> and is running
>
> ps ax | grep postfix
> 11303 ? Ss 0:00 /usr/lib/postfix/master

And this is unlikely to be the same Postfix whose config_directory
is /usr/local/etc.

--
Viktor.
-

terrygal...@fastest.cc

unread,
Aug 19, 2014, 12:08:34 AM8/19/14
to
Hi

On Mon, Aug 18, 2014, at 08:06 PM, Viktor Dukhovni wrote:
> > and is running
> >
> > ps ax | grep postfix
> > 11303 ? Ss 0:00 /usr/lib/postfix/master
>
> And this is unlikely to be the same Postfix whose config_directory
> is /usr/local/etc.

I appear to have a legacy mess on my hands.

Missed that completely :-/ Thanks for the catch!

Cleaning house before any more questions.

Terry

terrygal...@fastest.cc

unread,
Aug 19, 2014, 1:12:18 AM8/19/14
to
This is weird, my message keeps getting bounced :-/

This message was sent by a program, not by a human person.

Your submission to the postfix-users mailing list was rejected for
the following reason:

BOUNCE postfi...@postfix.org: Admin request of type /^\s*which\s+\S+\s*$/i at line 8


On Mon, Aug 18, 2014, at 10:10 PM, terrygal...@fastest.cc wrote:
> > On Mon, Aug 18, 2014, at 08:06 PM, Viktor Dukhovni wrote:
> OK, I've cleaned out any dregs not from 'my' postfix I was able to find.
>
> I've removed the distro's postfix, replacing it with exim (for now; the distro's dependencies get very unhappy without something installed).
>
> I've reinstalled my postfix.
>
> wh ich postfix
> /usr/local/sbin/postfix
>
> postconf \
> config_directory \
> setgid_group \
> command_directory \
> queue_directory
>
> config_directory = /usr/local/etc/postfix
> setgid_group = postdrop
> command_directory = /usr/local/sbin
> queue_directory = /var/spool/postfix
>
> ls -ld /usr/local/sbin/postdrop
> -rwxr-sr-x+ 1 root postdrop 257K Jul 10 17:09 /usr/local/sbin/postdrop*
>
> ls -ld /var/spool/postfix/maildrop
> drwx-wx--- 2 postfix postdrop 4.0K Aug 18 21:50 /var/spool/postfix/maildrop/
>
> whoami
> root
> systemctl stop postfix-custom
> postfix set-permissions
> postfix check
> systemctl start postfix-custom
>
>
> The right postfix -- my install -- is running
>
> ps ax | grep postfix
> 3507 ? Ss 0:00 /usr/local/libexec/postfix/master -w
>
> In postfix logs I see
>
> ...
> Aug 18 21:35:17 tgdesktop postfix/postdrop[3853]: warning: mail_queue_enter: create file maildrop/95804.3853: Permission denied
> Aug 18 21:35:27 tgdesktop postfix/postdrop[3853]: warning: mail_queue_enter: create file maildrop/95932.3853: Permission denied
> Aug 18 21:35:37 tgdesktop postfix/postdrop[3853]: warning: mail_queue_enter: create file maildrop/96092.3853: Permission denied
> Aug 18 21:35:47 tgdesktop postfix/postdrop[3853]: warning: mail_queue_enter: create file maildrop/96241.3853: Permission denied
>
> Which missing/wrong permission is making it complain?
>
> Terry

Wietse Venema

unread,
Aug 19, 2014, 7:11:51 AM8/19/14
to
terrygal...@fastest.cc:
> > The right postfix -- my install -- is running
> >
> > ps ax | grep postfix
> > 3507 ? Ss 0:00 /usr/local/libexec/postfix/master -w
> >
> > In postfix logs I see
> >
> > ...
> > Aug 18 21:35:17 tgdesktop postfix/postdrop[3853]: warning: mail_queue_enter: create file maildrop/95804.3853: Permission denied

You are running the daemons from the new Postfix installation, but
you are submitting mail through the *wrong* Postfix sendmail program.

Do:

# find / | egrep 'sendmail|postfix'

and report output.

Wietse

terrygal...@fastest.cc

unread,
Aug 19, 2014, 9:37:05 AM8/19/14
to
Hi

On Tue, Aug 19, 2014, at 04:11 AM, Wietse Venema wrote:
> You are running the daemons from the new Postfix installation, but
> you are submitting mail through the *wrong* Postfix sendmail program.
>
> Do:
>
> # find / | egrep 'sendmail|postfix'
>
> and report output.

find / | egrep "sendmail|postfix" | egrep -v "share/doc"
/usr/lib/sendmail
/usr/lib/perl5/site_perl/5.18.1/Mail/Mailer/sendmail.pm
/usr/local/etc/postfix
/usr/local/etc/postfix/LICENSE
/usr/local/etc/postfix/Makefile
/usr/local/etc/postfix/TLS_LICENSE
/usr/local/etc/postfix/access
/usr/local/etc/postfix/access.lmdb
/usr/local/etc/postfix/aliases
/usr/local/etc/postfix/bounce.cf.default
/usr/local/etc/postfix/canonical
/usr/local/etc/postfix/canonical.lmdb
/usr/local/etc/postfix/client_access
/usr/local/etc/postfix/client_access.lmdb
/usr/local/etc/postfix/generic
/usr/local/etc/postfix/generic.lmdb
/usr/local/etc/postfix/header_checks
/usr/local/etc/postfix/header_checks_outbound
/usr/local/etc/postfix/helo_access
/usr/local/etc/postfix/helo_access.lmdb
/usr/local/etc/postfix/main.cf
/usr/local/etc/postfix/main.cf.default
/usr/local/etc/postfix/makedefs.out
/usr/local/etc/postfix/master.cf
/usr/local/etc/postfix/postscreen_access.cidr
/usr/local/etc/postfix/relocated
/usr/local/etc/postfix/relocated.lmdb
/usr/local/etc/postfix/scripts
/usr/local/etc/postfix/smarthost_passwd
/usr/local/etc/postfix/smarthost_passwd.lmdb
/usr/local/etc/postfix/transport
/usr/local/etc/postfix/transport.lmdb
/usr/local/etc/postfix/virtual
/usr/local/etc/postfix/virtual.lmdb
/usr/local/etc/postfix/vmailbox
/usr/local/etc/postfix/vmailbox.lmdb
/usr/local/etc/postfix/scripts/clean_locks
/usr/local/etc/postfix/scripts/update_postmaps
/usr/local/etc/postfix/scripts/wait_qmgr
/usr/local/libexec/postfix
/usr/local/libexec/postfix/anvil
/usr/local/libexec/postfix/bounce
/usr/local/libexec/postfix/cleanup
/usr/local/libexec/postfix/discard
/usr/local/libexec/postfix/dnsblog
/usr/local/libexec/postfix/error
/usr/local/libexec/postfix/flush
/usr/local/libexec/postfix/lmtp
/usr/local/libexec/postfix/local
/usr/local/libexec/postfix/main.cf
/usr/local/libexec/postfix/master
/usr/local/libexec/postfix/master.cf
/usr/local/libexec/postfix/nqmgr
/usr/local/libexec/postfix/oqmgr
/usr/local/libexec/postfix/pickup
/usr/local/libexec/postfix/pipe
/usr/local/libexec/postfix/post-install
/usr/local/libexec/postfix/postfix-files
/usr/local/libexec/postfix/postfix-script
/usr/local/libexec/postfix/postfix-wrapper
/usr/local/libexec/postfix/postmulti-script
/usr/local/libexec/postfix/postscreen
/usr/local/libexec/postfix/proxymap
/usr/local/libexec/postfix/qmgr
/usr/local/libexec/postfix/qmqpd
/usr/local/libexec/postfix/scache
/usr/local/libexec/postfix/showq
/usr/local/libexec/postfix/smtp
/usr/local/libexec/postfix/smtpd
/usr/local/libexec/postfix/spawn
/usr/local/libexec/postfix/tlsmgr
/usr/local/libexec/postfix/tlsproxy
/usr/local/libexec/postfix/trivial-rewrite
/usr/local/libexec/postfix/verify
/usr/local/libexec/postfix/virtual
/usr/local/man/man1/postfix.1
/usr/local/man/man1/sendmail.1
/usr/local/man/man5/postfix-wrapper.5
/usr/local/sbin/postfix
/usr/local/sbin/sendmail
/usr/sbin/sendmail
/usr/share/bash-completion/completions/postfix
/usr/share/man/man8/sendmail.8.gz
/usr/share/zsh/functions/Completion/Unix/_postfix
/var/adm/postfix.configured
/var/lib/postfix
/var/lib/postfix/master.lock
/var/log/postfix
/var/log/postfix/mail
/var/log/postfix/mail.warn

ls -al `find / | egrep "sendmail" | egrep -v "share/doc"`
-r--r--r-- 1 root root 784 Jan 5 2014 /usr/lib/perl5/site_perl/5.18.1/Mail/Mailer/sendmail.pm
lrwxrwxrwx 1 root root 12 Aug 18 21:49 /usr/lib/sendmail -> ../sbin/exim*
-rw-r--r--+ 1 root root 17K Apr 6 2013 /usr/local/man/man1/sendmail.1
-rwxr-xr-x+ 1 root root 288K Aug 18 06:23 /usr/local/sbin/sendmail*
lrwxrwxrwx 1 root root 4 Aug 18 21:49 /usr/sbin/sendmail -> exim*
lrwxrwxrwx 1 root root 9 Aug 18 21:49 /usr/share/man/man8/sendmail.8.gz -> exim.8.gz

postconf -n | grep sendmail
sendmail_path = /usr/local/sbin/sendmail

which sendmail
/usr/local/sbin/sendmail
ls -al /usr/local/sbin/sendmail
-rwxr-xr-x+ 1 root root 288K Aug 19 06:23 /usr/local/sbin/sendmail*
ls -al /usr/local/src/postfix-2.11.1/bin/sendmail
-rwxrwxr-x+ 1 root root 288K Aug 19 06:22 /usr/local/bin/sendmail*
diff -s bin/sendmail /usr/local/sbin/sendmail
Files bin/sendmail and /usr/local/sbin/sendmail are identical


Terry

Viktor Dukhovni

unread,
Aug 19, 2014, 9:44:43 AM8/19/14
to
On Tue, Aug 19, 2014 at 06:37:05AM -0700, terrygal...@fastest.cc wrote:

> find / | egrep "sendmail|postfix" | egrep -v "share/doc"
> /usr/lib/sendmail

[ Legacy symlink for applications that find sendmail(1) in /usr/lib ]

> /usr/local/etc/...
> /usr/local/libexec/postfix
> /usr/local/man/...
> /usr/local/sbin/...

[ The real Postfix is now mostly in /usr/local ]

> /usr/sbin/sendmail

[ Symlink for applications that find sendmail(1) in /usr/sbin ]

> ls -al `find / | egrep "sendmail" | egrep -v "share/doc"`
> -r--r--r-- 1 root root 784 Jan 5 2014 /usr/lib/perl5/site_perl/5.18.1/Mail/Mailer/sendmail.pm
> lrwxrwxrwx 1 root root 12 Aug 18 21:49 /usr/lib/sendmail -> ../sbin/exim*
> -rw-r--r--+ 1 root root 17K Apr 6 2013 /usr/local/man/man1/sendmail.1
> -rwxr-xr-x+ 1 root root 288K Aug 18 06:23 /usr/local/sbin/sendmail*
> lrwxrwxrwx 1 root root 4 Aug 18 21:49 /usr/sbin/sendmail -> exim*
> lrwxrwxrwx 1 root root 9 Aug 18 21:49 /usr/share/man/man8/sendmail.8.gz -> exim.8.gz

Still a mess, since /usr/sbin/sendmail and /usr/lib/sendmail are Exim!

However at least you now have just one Postfix.

> which sendmail
> /usr/local/sbin/sendmail

Your path is not pertinent, many applications will now attempt to
submit email via Exim, and the init.d start scripts will now likely
launch Exim.

--
Viktor.

Wietse Venema

unread,
Aug 19, 2014, 10:07:07 AM8/19/14
to
terrygal...@fastest.cc:
> Hi
>
> On Tue, Aug 19, 2014, at 04:11 AM, Wietse Venema wrote:
> > You are running the daemons from the new Postfix installation, but
> > you are submitting mail through the *wrong* Postfix sendmail program.
> >
> > Do:
> >
> > # find / | egrep 'sendmail|postfix'
> >
> > and report output.

What is the output from:

ls -ld `postconf -h command_directory`/postdrop
ls -ld `postconf -h queue_directory`/maildrop

What is the output when you execute as root:

su -s /bin/sh nobody -c '`postconf -h command_directory`/postdrop </dev/null"

(the above assumes you are on a Linux system).

Wietse

terrygal...@fastest.cc

unread,
Aug 19, 2014, 10:12:07 AM8/19/14
to


On Tue, Aug 19, 2014, at 06:44 AM, Viktor Dukhovni wrote:
> On Tue, Aug 19, 2014 at 06:37:05AM -0700, terrygal...@fastest.cc wrote:
>
> > find / | egrep "sendmail|postfix" | egrep -v "share/doc"
> > /usr/lib/sendmail
>
> [ Legacy symlink for applications that find sendmail(1) in /usr/lib ]

Right. I'd uninstalled postfix, but had to install exim.

As I understand it, a distro-mailer needs to be installed -- apparently postfix, exim or sendmail will do. Otherwise pkg manager complains about unfulfilled dependencies, and other packages break. That pkg gets installed into system paths.

> > /usr/local/etc/...
> > /usr/local/libexec/postfix
> > /usr/local/man/...
> > /usr/local/sbin/...
>
> [ The real Postfix is now mostly in /usr/local ]

What's not included in "mostly"?

> > /usr/sbin/sendmail
>
> [ Symlink for applications that find sendmail(1) in /usr/sbin ]
>
> > ls -al `find / | egrep "sendmail" | egrep -v "share/doc"`
> > -r--r--r-- 1 root root 784 Jan 5 2014 /usr/lib/perl5/site_perl/5.18.1/Mail/Mailer/sendmail.pm
> > lrwxrwxrwx 1 root root 12 Aug 18 21:49 /usr/lib/sendmail -> ../sbin/exim*
> > -rw-r--r--+ 1 root root 17K Apr 6 2013 /usr/local/man/man1/sendmail.1
> > -rwxr-xr-x+ 1 root root 288K Aug 18 06:23 /usr/local/sbin/sendmail*
> > lrwxrwxrwx 1 root root 4 Aug 18 21:49 /usr/sbin/sendmail -> exim*
> > lrwxrwxrwx 1 root root 9 Aug 18 21:49 /usr/share/man/man8/sendmail.8.gz -> exim.8.gz
>
> Still a mess, since /usr/sbin/sendmail and /usr/lib/sendmail are Exim!
>
> However at least you now have just one Postfix.
>
> > which sendmail
> > /usr/local/sbin/sendmail
>
> Your path is not pertinent, many applications will now attempt to
> submit email via Exim, and the init.d start scripts will now likely
> launch Exim.

"My" postfix gets installed currently into /usr/local.

Isn't it possible to get the system to use only the postfix I want it to? Or is the only way to run postfix on a system to install it in system paths, clobbering what the distro installs?

I try to not 'get involved' with the distro's idea of what the mailer is/should do/etc as it's constantly a problem -- something changes, breaks, isn't updated, etc etc. Which is why I'm trying to use an uptodate, upstream postfix.

fyi, exim isn't running

ps ax | grep -i "exim"
(nothing)

Terry

terrygal...@fastest.cc

unread,
Aug 19, 2014, 10:12:55 AM8/19/14
to


On Tue, Aug 19, 2014, at 07:07 AM, Wietse Venema wrote:

ls -ld `postconf -h command_directory`/postdrop
-rwxr-sr-x+ 1 root postdrop 257K Aug 19 06:23 /usr/local/sbin/postdrop*

ls -ld `postconf -h queue_directory`/maildrop
drwx-wx--- 2 postfix postdrop 4.0K Aug 19 07:09 /var/spool/postfix/maildrop/

su -s /bin/sh nobody -c "`postconf -h command_directory`/postdrop </dev/null"
queue_id71680402FB[2197]

> (the above assumes you are on a Linux system).

I am.

Wijatmoko U. Prayitno

unread,
Aug 19, 2014, 10:21:13 AM8/19/14
to
On Tue, 19 Aug 2014 07:12:07 -0700
terrygal...@fastest.cc wrote:

> Right. I'd uninstalled postfix, but had to install
> exim.
>
> As I understand it, a distro-mailer needs to be
> installed -- apparently postfix, exim or sendmail will
> do. Otherwise pkg manager complains about unfulfilled
> dependencies, and other packages break.
>
exclude them into your whatever pkg-manager conf...

terrygal...@fastest.cc

unread,
Aug 19, 2014, 10:34:14 AM8/19/14
to


On Tue, Aug 19, 2014, at 07:21 AM, Wijatmoko U. Prayitno wrote:
> exclude them into your whatever pkg-manager conf...

Exclude what? THe packages that depend on & require /usr/sbin/sendmail?

It's even part of

http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/baselib-sendmail-1.html

Can't exclude all of 'lsb', can you?

Wietse Venema

unread,
Aug 19, 2014, 10:47:33 AM8/19/14
to
terrygal...@fastest.cc:
>
>
> On Tue, Aug 19, 2014, at 07:07 AM, Wietse Venema wrote:
>
> ls -ld `postconf -h command_directory`/postdrop
> -rwxr-sr-x+ 1 root postdrop 257K Aug 19 06:23 /usr/local/sbin/postdrop*
>
> ls -ld `postconf -h queue_directory`/maildrop
> drwx-wx--- 2 postfix postdrop 4.0K Aug 19 07:09 /var/spool/postfix/maildrop/
>
> su -s /bin/sh nobody -c "`postconf -h command_directory`/postdrop </dev/null"
> queue_id71680402FB[2197]

In that case, it should be possible to submit an email mesage (whether
it delivers properly depends on correct configuration in /usr/local/etc/postfix):

su -s /bin/sh nobody -c "/usr/local/sbin/sendmail -t" <<EOF
To: us...@example.com
Subject: test message

Hello world
EOF

(instead of us...@example.com specify some real email address).

Once this delivers mail as expected, you need to configure the
system to use the Postfix sendmail command instead of exim.

This should be some automated procedure, for example, see "man
alternatives", "man mailwrapper", etc.

The result will be, among other things, that:

/usr/sbin/sendmail -> /usr/local/sbin/sendmail
/usr/lib/sendmail -> /usr/local/sbin/sendmail

And perhaps some other configuration that depends on the details
of your specific distribution.

Wietse

Viktor Dukhovni

unread,
Aug 19, 2014, 10:48:49 AM8/19/14
to
On Tue, Aug 19, 2014 at 07:12:07AM -0700, terrygal...@fastest.cc wrote:

> > > find / | egrep "sendmail|postfix" | egrep -v "share/doc"
> > > /usr/lib/sendmail
> >
> > [ Legacy symlink for applications that find sendmail(1) in /usr/lib ]
>
> Right. I'd uninstalled postfix, but had to install exim.

This is not the right solution. On systems with package managers
that have managed dependencies on postfix or alternatives you need
to deploy a Postfix package that satisfies those dependencies.

In particular, if your system is RPM based, you need a build a
Postfix RPM that "provides" a virtual feature that satisfies the
various dependencies, and "conflicts" with the other alternatives,
potentially including the default vendor Postfix.

Or just rebuild the vendor Postfix RPM with a later version of the
source. It is unlikely that on a stable system the vendor will
ship a version superceding your build.

> As I understand it, a distro-mailer needs to be installed --
> apparently postfix, exim or sendmail will do. Otherwise pkg manager
> complains about unfulfilled dependencies, and other packages break.
> That pkg gets installed into system paths.

Thus you need to live with the "distro" postfix, or replace it
properly.

> > > /usr/local/etc/...
> > > /usr/local/libexec/postfix
> > > /usr/local/man/...
> > > /usr/local/sbin/...
> >
> > [ The real Postfix is now mostly in /usr/local ]
>
> What's not included in "mostly"?

It seems to all be there. Sorry if that was confusing.

> > > which sendmail
> > > /usr/local/sbin/sendmail
> >
> > Your path is not pertinent, many applications will now attempt to
> > submit email via Exim, and the init.d start scripts will now likely
> > launch Exim.
>
> "My" postfix gets installed currently into /usr/local.

Yes, but mail(1) and other software will still use /usr/sbin/sendmail.

> Isn't it possible to get the system to use only the postfix I
> want it to? Or is the only way to run postfix on a system to
> install it in system paths, clobbering what the distro installs?

On a system with a package manager, you can only replace packages
with packages that supercede them and satisfy the same dependents.

--
Viktor.

Wijatmoko U. Prayitno

unread,
Aug 19, 2014, 11:15:14 AM8/19/14
to
On Tue, 19 Aug 2014 07:34:14 -0700
terrygal...@fastest.cc wrote:

> Exclude what? THe packages that depend on &
> require /usr/sbin/sendmail?
>
what linux distro do you use? if redhat/centos/scientific
you can use CentALT repository which has latest postfix.

terrygal...@fastest.cc

unread,
Aug 19, 2014, 11:26:44 AM8/19/14
to
On Tue, Aug 19, 2014, at 07:47 AM, Wietse Venema wrote:
> In that case, it should be possible to submit an email mesage (whether
> it delivers properly depends on correct configuration in /usr/local/etc/postfix):

Thorugh this entire biz, I've been able to submit/deliver mail. Just the logs' permission complaints are what started this.

> Once this delivers mail as expected, you need to configure the
> system to use the Postfix sendmail command instead of exim.
>
> This should be some automated procedure, for example, see "man
> alternatives", "man mailwrapper", etc.
>
> The result will be, among other things, that:
>
> /usr/sbin/sendmail -> /usr/local/sbin/sendmail
> /usr/lib/sendmail -> /usr/local/sbin/sendmail
>
> And perhaps some other configuration that depends on the details
> of your specific distribution.

I'm sort-of there.

Get rid of the 'big' system mail stuff, and a couple of pkgs that require a sendmail equivalent

rpm -e --nodeps lsb google-chrome-stable postfix exim sendmail

Prevent re-install of the mail stuff

cat << EOF > /etc/zypp/locks


type: package
match_type: exact
solvable_name: sendmail
solvable_name: postfix
solvable_name: exim
EOF

Install one of the sendmail-requiring apps

zypper in --force google-chrome-stable

It installs a lightweight alternative, msmtp, into system paths

The following 5 NEW packages are going to be installed:
google-chrome-stable libgsasl7 lsb msmtp msmtp-mta

Which 'takes over' /usr/sbin/sendmail

ls -al /usr/sbin/sendmail
lrwxrwxrwx 1 root root 12 Aug 19 07:51 /usr/sbin/sendmail -> ../bin/msmtp*

There's no sendmail 'alternative' by default

update-alternatives --get-selections | egrep -i "mail|postfix|exim|smtp"
(nothing)

So create one, pointing to 'my' Postfix install

update-alternatives --install "/usr/sbin/sendmail" "sendmail" "/usr/local/sbin/sendmail" 1000

and force 'manual mode'

update-alternatives --set sendmail /usr/local/sbin/sendmail
update-alternatives --get-selections | egrep -i "mail|postfix|exim|smtp"
sendmail manual /usr/local/sbin/sendmail

Now

ls -al /usr/sbin/sendmail
lrwxrwxrwx 1 root root 26 Aug 19 08:02 /usr/sbin/sendmail -> /etc/alternatives/sendmail*
ls -al /etc/alternatives/sendmail
lrwxrwxrwx 1 root root 24 Aug 19 08:02 /etc/alternatives/sendmail -> /usr/local/sbin/sendmail*

Try to clobber it. Will it?

zypper in --force exim
...
The following NEW package is going to be installed:
exim

The following package is going to be REMOVED:
msmtp-mta
...

It half-does

ls -al /usr/sbin/sendmail
lrwxrwxrwx 1 root root 4 Aug 19 08:06 /usr/sbin/sendmail -> exim*
ls -al /etc/alternatives/sendmail
lrwxrwxrwx 1 root root 24 Aug 19 08:02 /etc/alternatives/sendmail -> /usr/local/sbin/sendmail*

The alternative is still set

update-alternatives --get-selections | egrep -i "mail|postfix|exim|smtp"
sendmail manual /usr/local/sbin/sendmail

What I don't know is do apps that 'use sendmail' look specifically for /usr/sbin/sendmail, or do they (first/only) look for and use the /etc/alternative -> /usr/local/sbin/sendmail ?

If the former, then either I need to figure out how to get the installer to NOT clobber the bin path when an alternative is defined/set, or simply reset the alternative on boot.

If the latter, I think I'd be OK ...

Terry

terrygal...@fastest.cc

unread,
Aug 19, 2014, 11:30:47 AM8/19/14
to
On Tue, Aug 19, 2014, at 08:15 AM, Wijatmoko U. Prayitno wrote:
> what linux distro do you use? if redhat/centos/scientific
> you can use CentALT repository which has latest postfix.

It's opensuse.

The point is I don't WANT to use the distro's postfix. Not the least of the reasons is that we've been told over and over in this community that to get support from this list, we need to use upstream postfix -- not the distro's.

Support from the distro on postfix usually just throws up their hands and sends us back to this list anyway. I need support & community, not excuses, so I'm trying very hard to stick with upstream.

Terry

Viktor Dukhovni

unread,
Aug 19, 2014, 11:36:16 AM8/19/14
to
On Tue, Aug 19, 2014 at 08:30:47AM -0700, terrygal...@fastest.cc wrote:

> On Tue, Aug 19, 2014, at 08:15 AM, Wijatmoko U. Prayitno wrote:
> > what linux distro do you use? if redhat/centos/scientific
> > you can use CentALT repository which has latest postfix.
>
> It's opensuse.
>
> The point is I don't WANT to use the distro's postfix. Not the
> least of the reasons is that we've been told over and over in this
> community that to get support from this list, we need to use upstream
> postfix -- not the distro's.

This is not the case. However, if the distro screws up, obviously you
need to resolve that with them.

> Support from the distro on postfix usually just throws up their
> hands and sends us back to this list anyway. I need support &
> community, not excuses, so I'm trying very hard to stick with
> upstream.

If you're not looking for specific newer features, you should
probably use the distro Postfix. In all probably any problems you
have will be related to figuring out how to apply Postfix to various
use-cases, rather than brain-damage in the distro's "enhancements"
to Postfix. The latter happens now and then, but is relatively
infrequent.

--
Viktor.

Wietse Venema

unread,
Aug 19, 2014, 11:38:43 AM8/19/14
to
terrygal...@fastest.cc:
> What I don't know is do apps that 'use sendmail' look specifically for /usr/sbin/sendmail, or do they (first/only) look for and use the /etc/alternative -> /usr/local/sbin/sendmail ?
>

It does not matter. In order to run Postfix it needs to be installed
as a proper package, so that the RPM manager knows that it exists.

The mailwrapper stuff will not prevent the package manager from
blowing Postfix away. Only the proper package manager info will.

Wietse

terrygal...@fastest.cc

unread,
Aug 19, 2014, 11:39:40 AM8/19/14
to


On Tue, Aug 19, 2014, at 07:48 AM, Viktor Dukhovni wrote:
> Yes, but mail(1) and other software will still use /usr/sbin/sendmail.

II think that's a key question. Do they use /usr/sbin/sendmail only & always?

Or, do they -- instead -- use /etc/alternatives/sendmail if it exists & is configured?

Terry

Viktor Dukhovni

unread,
Aug 19, 2014, 12:43:46 PM8/19/14
to
They use /usr/sbin/sendmail, on correctly configured systems, with "alternatives", you have:

/usr/sbin/sendmail -> /etc/alternatives/sendmail
/etc/alternatives/sendmail -> /usr/sbin/sendmail.postfix

and similar, e.g.

/usr/sbin/sendmail -> /etc/alternatives/sendmail
/etc/alternatives/sendmail -> /usr/local/sbin/sendmail

--
Viktor.

terrygal...@fastest.cc

unread,
Aug 19, 2014, 1:46:02 PM8/19/14
to
> They use /usr/sbin/sendmail, on correctly configured systems, with "alternatives", you have:
>
> /usr/sbin/sendmail -> /etc/alternatives/sendmail
> /etc/alternatives/sendmail -> /usr/sbin/sendmail.postfix
>
> and similar, e.g.
>
> /usr/sbin/sendmail -> /etc/alternatives/sendmail
> /etc/alternatives/sendmail -> /usr/local/sbin/sendmail

From above I have

ls -al /usr/sbin/sendmail
lrwxrwxrwx 1 root root 26 Aug 19 08:02 /usr/sbin/sendmail -> /etc/alternatives/sendmail*
ls -al /etc/alternatives/sendmail
lrwxrwxrwx 1 root root 24 Aug 19 08:02 /etc/alternatives/sendmail -> /usr/local/sbin/sendmail*

But that doesn't survive any system install that overwrites /usr/sbin/sendmail -- incl for example lsb, google-chrome, etc

OTOH a friend gave me this 'cheat'

cat /usr/src/packages/SPECS/sendmail-dummy.spec
-----------------
# spec file for package sendmail-dummy
Name: sendmail-dummy
Version: 1.0
Release: 1
License: none
Summary: sendmail-dummy
Group: Productivity/Networking/Email/Servers

Conflicts: sendmail
Conflicts: exim
Conflicts: postfix
Conflicts: msmtp
Conflicts: sendmail-tls
Provides: smtp_daemon
Provides: /usr/lib/sendmail
Provides: /usr/sbin/sendmail
Provides: /usr/bin/newaliases

Provides: /usr/
BuildArch: noarch

%description
sendmail-dummy

%prep
mkdir -p usr/sbin/
touch usr/sbin/sendmail

%build

%install
mkdir -p /usr/sbin /usr/lib/
for i in \
/usr/lib/sendmail \
/usr/sbin/sendmail \
/usr/bin/newaliases
do
ln -sf /usr/local/sbin/sendmail $i
done


%files

%changelog
-----------------


rpmbuild -ba /usr/src/packages/SPECS/sendmail-dummy.spec

cd /usr/src/packages/RPMS/noarch
zypper -v --no-refresh in --force sendmail-dummy-1.0-1.noarch.rpm

ls -al /usr/sbin/sendmail /usr/lib/sendmail /usr/bin/newaliases
lrwxrwxrwx 1 root root 24 Aug 19 10:19 /usr/bin/newaliases -> /usr/local/sbin/sendmail*
lrwxrwxrwx 1 root root 24 Aug 19 10:19 /usr/lib/sendmail -> /usr/local/sbin/sendmail*
lrwxrwxrwx 1 root root 24 Aug 19 10:19 /usr/sbin/sendmail -> /usr/local/sbin/sendmail*

rpm -qa | egrep "sendmail|exim|postfix|msmtp|smail"
sendmail-dummy-1.0-1.noarch


Which afaict
(1) 'properly' installs a pkg that provides a /usr/sbin/sendmail
(2) allows me to uninstall unnecessary mtas
(3) point at & use 'my' postfix install
(4) survives any sendmail-dependent pkg installs
(5) Doesn't require 'alternatives'
(6) frees me from distro-dependence, and keeps me on postfix upstream, using a simple local config/install

Testing now. So far submit/send works as expected, using 'my' postfix. And no more perms errors in my logs - yet.

Terry

0 new messages