Bug 41012

Summary: /etc/periodic/daily/440.status-mailq assumes sendmail
Product: Base System Reporter: Matthias Buelow <mkb>
Component: binAssignee: Brian Somers <brian>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.6-STABLE   
Hardware: Any   
OS: Any   

Description Matthias Buelow 2002-07-26 18:00:03 UTC
The 440.status-mailq daily periodic script seems to assume sendmail
is being used as the mta.
I've got postfix running (from ports) and /usr/bin/mailq is routed
via mailer.conf to the postfix "sendmail" binary, which doesn't
support the following (quoted from script):

...
                    rc=$(case "$daily_status_mailq_shorten" in
                        [Yy][Ee][Ss])
                            mailq -Ac |
                                perl -ne  'print if /^\s+\S+@/' |
...

which prints:


Mail in submit queue:
mailq: illegal option -- A
mailq: fatal: usage: mailq [options]

Fix: 

Make the system scripts not assume that sendmail is being used.
Comment 1 Peter Pentchev 2002-07-29 08:29:48 UTC
On Fri, Jul 26, 2002 at 06:52:37PM +0200, Matthias Buelow wrote:
> 
> >Number:         41012
> >Category:       bin
> >Synopsis:       /etc/periodic/daily/440.status-mailq assumes sendmail
> >Originator:     Matthias Buelow
> >Release:        FreeBSD 4.6-STABLE i386
> >Organization:
> >Environment:
> System: FreeBSD reiher.informatik.uni-wuerzburg.de 4.6-STABLE FreeBSD 4.6-STABLE #0: Sun Jul 7 02:24:38 CEST 2002 mkb@reiher.informatik.uni-wuerzburg.de:/usr/src/sys/compile/REIHER i386
> 
> >Description:
> 
> The 440.status-mailq daily periodic script seems to assume sendmail
> is being used as the mta.
> I've got postfix running (from ports) and /usr/bin/mailq is routed
> via mailer.conf to the postfix "sendmail" binary, which doesn't
> support the following (quoted from script):
> 
> ...
>                     rc=$(case "$daily_status_mailq_shorten" in
>                         [Yy][Ee][Ss])
>                             mailq -Ac |
>                                 perl -ne  'print if /^\s+\S+@/' |
[snip]
> Make the system scripts not assume that sendmail is being used.

I believe that it would not be feasible, if at all possible, for the
system periodic scripts to support the correct syntax for various
mailers' commands.  An easy workaround would be for you to set
'daily_status_mailq_enable="NO"' in your /etc/periodic.conf file (it
might not yet exist, you may have to create it), then copy the system
script to a different location and either use it as a local daily script
(as indicated by the daily_local variable in the periodic.conf file), or
create a different local daily script which invokes that.

You can find a list of all the variables used to control periodic(8)'s
behavior in the /etc/defaults/periodic.conf file; just as with
/etc/defaults/rc.conf, you are *not* supposed to modify that file
directly, rather redefine all variables that you wish to override in the
/etc/periodic.conf file.

G'luck,
Peter

-- 
Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This sentence claims to be an Epimenides paradox, but it is lying.
Comment 2 Kim Scarborough 2002-08-13 17:56:08 UTC
> I believe that it would not be feasible, if at all possible, for the
> system periodic scripts to support the correct syntax for various
> mailers' commands.

Perhaps not, but surely something like this could be added to
/etc/defaults/periodic.conf:

daily_submit_queuerun_flags=-Ac

Then admins could override it without having to turn it off completely.
Comment 3 Gregory Neil Shapiro freebsd_committer freebsd_triage 2003-02-08 19:04:54 UTC
Responsible Changed
From-To: freebsd-bugs->brian

Give to the periodic script maintainer.  However, I will comment that I 
believe the solution given by Peter Pentchev is the correct solution. 
I don't think Kim Scarborough's solution will be useful as removing 
those -Ac flags would just duplicate the mailq command done for the 
normal mail queue in that script (before the client mqueue mailq). 
That would just result in the same mailq output being shown twice.
Comment 4 Brian Somers freebsd_committer freebsd_triage 2004-06-29 14:09:04 UTC
State Changed
From-To: open->closed

I agree with the suggestions in this PR that it's unfeasible to try to 
support more than one mailer.  As sendmail is the system supported mailer, 
the daily scripts use that.  If another mailer is used instead, then the 
user should really implement their own periodic scripts. 

In fact, I'd suggest that installing such a port should also install 
periodic scripts for use with FreeBSD - an interesting exercise for 
the probably already overworked port maintainers!!!