/usr/bin/mail ignores aliases in $HOME/.mailrc

Bug #1222181 reported by Daniel Barrett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mailutils (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

1. Put an alias in $HOME/.mailrc

alias foo <email address hidden>

2. Try to mail the alias:

$ echo hello | /usr/bin/mail -s testing foo

3. Read /var/log/mail.log and see "foo" bounce as an unknown user:

Sep 7 11:15:39 mycomputer postfix/local[9707]: EE038F6028B: to=<email address hidden>, relay=local, delay=0.1, delays=0.07/0/0/0.03, dsn=5.1.1, status=bounced (unknown user: "foo")

4. However, my other mail programs, such as Emacs VM, respect the aliases in $HOME/.mailrc.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1222181] [NEW] /usr/bin/mail ignores aliases in $HOME/.mailrc

Does the postfix documentation say it supports this?

Revision history for this message
Daniel Barrett (dbarrett-m) wrote :

Interesting question. Ubuntu definitely supported $HOME/.mailrc aliases in version 10.04 (with its installed postfix).

Also, the "mail" command has supported $HOME/.mailrc since the 1980s, even pre-Linux. It would be (IMHO) pretty unwise/unlikely to drop support for a config file that Linux scripts worldwide have depended on for decades. That would be like bash dropping support for $HOME/.bashrc.

Is /usr/bin/mail even part of postfix? It's not in any postfix package in 13.04 (see bug #1222179) but somehow gets installed.

Revision history for this message
Daniel Barrett (dbarrett-m) wrote :

After some investigation, it seems /usr/bin/mail is part of the mailutils package. So this alias expansion should be happening within /usr/bin/mail and not from postfix.

affects: postfix (Ubuntu) → mailutils (Ubuntu)
Revision history for this message
Daniel Barrett (dbarrett-m) wrote :

OK, I have figured out a workaround with the help of askubuntu.com:

  http://askubuntu.com/questions/342607/why-does-usr-bin-mail-ignore-aliases-in-home-mailrc

Ubuntu installs the "mailutils" package by default, which (inexplicably) does not support $HOME/.mailrc aliases.

The alternative package "bsd-mailx" does support .mailrc properly. Installing this package makes everything work.

  sudo apt-get install bsd-mailx

This replaces /usr/bin/mail (and /usr/bin/mailx) with their bsd-mailx implementations.

Revision history for this message
Daniel Barrett (dbarrett-m) wrote :

I am leaving the bug report in place in case this is still a bug in mailutils.

Revision history for this message
Ken Sharp (kennybobs) wrote :

It's not a bug if it's not supposed to work in the first place.

Changed in mailutils (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.