0

I'm trying to use mail to send mail. I want change the "From" field and the -a flag should let me do this. However, it seems like my version of mail doesn't support -a. WHen I try to use it, I get this:

[me@host ~]$ mail -a
mail: invalid option -- a
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
            [-- sendmail-options ...]
       mail [-iInNv] -f [name]
       mail [-iInNv] [-u user]

That looks like an older set of options than the man page I found online: http://unixhelp.ed.ac.uk/CGI/man-cgi?mail

How can I update mail? I tried doing sudo yum update mail but it said there is nothing to update. I am running on Centos 5.2. Is a newer version not available?

1 Answers1

0

Why do you assume its older?

According to the link you provided, the -a flag requires a parameter - so 'mail -a' would not be valid even with that version of mail.

I expect you'll find that this option is feature peculiar to the mail command shipping with (some versions of) BSD.

You might want to have a look at mutt (which allows you to specify the from address as an env var) and is available on Centos/Redhat. But do bear in mind that only trusted users can manipulate the from address when invoking mail locally rather than via SMTP.

symcbean
  • 21,009
  • 1
  • 31
  • 52