Bug 541550 - "mail -s" is totally broken
Summary: "mail -s" is totally broken
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: mailx
Version: rawhide
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-26 09:59 UTC by Need Real Name
Modified: 2009-11-29 09:52 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-26 15:26:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2009-11-26 09:59:06 UTC
'mail' does not recognize/accept the "-s" switch.
Specifically, it still prompst for the "Subject" line (which it shouldn't with the -s switch) and then it gets a permissions error when the mail is submitted. This behavior obviously did not happen in previous versions.
This breaks a lot of automated scripts that pipe data onto mail and then use the -s flag to set the subject.
----------------------------------------------------------------

$ mail `whoami` -s test
Subject: test2
test3
.
EOT
WARNING: RunAsUser for MSP ignored, check group ids (egid=501, want=51)
can not chdir(/var/spool/clientmqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.

--------------------------------------------------------------------

$ls -ald /bin/mail /usr/bin/*sendmail*  /var/spool/clientmqueue
lrwxrwxrwx. 1 root  root      5 Nov 19 14:15 /bin/mail -> mailx*
lrwxrwxrwx. 1 root  root     25 Nov 19 14:40 /usr/bin/mailq.sendmail -> ../sbin/sendmail.sendmail*
lrwxrwxrwx. 1 root  root     25 Nov 19 14:40 /usr/bin/newaliases.sendmail -> ../sbin/sendmail.sendmail*
-rwxr-xr-x. 1 root  root  73348 Sep 16 14:55 /usr/bin/rmail.sendmail*
drwxrwx---. 2 smmsp smmsp  4096 Nov 26 04:52 /var/spool/clientmqueue/

Comment 1 Dmitry Butskoy 2009-11-26 15:26:50 UTC
Since the Fedora-10, we use the same version of mailx-12.4 as for rawhide too.

> $ mail `whoami` -s test

According to the POSIX standards, you should use options *before* the arguments. not after. IOW, try:

$ mail -s test `whoami`


Perhaps the previous implementation of mailx supported such a syntax, but the current one not. Please, fix your scripts. The "options messed up with arguments" case could affect not "mailx"'s new implementation only, the other commands might be affected in the future as well...

> WARNING: RunAsUser for...

Can't reproduce.


If you have a patch which adds a needed compatibility with the previous mailx implementation, please, send it upstream: http://heirloom.sourceforge.net/mailx.html

Comment 2 Need Real Name 2009-11-29 09:52:28 UTC
OK. Good to know that it works if you put options first (and I will change my scripts to reflect that).

But just for the record, at least up until Fedora 8, 'mail' also worked with the name before the options.

In any case problem solved.


Note You need to log in before you can comment on or make changes to this bug.