-   Linux - Newbie (
-   -   mail command (

hashbangbinbash 04-08-2008 11:14 AM

mail command
Hello again,

I'm trying to use the mail command, but although the command, the arguments and the email I give in the terminal are accepted without complaint, the mails don't actually arrive at the given email address. What and where might I check the setting of the mailx command, to make sure it's using the right.... stuff, to send mail.

Or, if my desktop can connect to the internet (it can) should mailx then just magicaly work somehow?

hashbangbinbash 04-08-2008 11:17 AM

Any suggestions at all, welcome.

3rods 04-08-2008 11:20 AM

This one?

I always use sendEmail to send emails from the command line. It's a handy perl program. Just untar and use. I like it because you can set the SMTP server and user specifically to test access. Plus, it's nice for automating scripts. Like sending email through another mail server to let you know your mail server is broke.

hashbangbinbash 04-08-2008 11:43 AM
, yup, that's command I'm having a problem with, I used


apt-get install mailx
On my Debian desktop to install it, and then I type


echo "My test" | mail -s "My test mail" < /home/file.xls
To test it, sending an attachment as well because that's kind of the point of why I want to use this command. I think the syntax is okay... but no email actually turns up.

Will check the sendEmail command.

hashbangbinbash 04-10-2008 06:08 AM

Returning to the question about the "mail" command, I don't understand why it doesn't work... the only refference I can find to configuration of the command relates to mail.rc, there's nothing about giving it pop/smtp settings anywhere.... but lots of examples where it's used with actual email addresses, not just the account names of other users on the same machine.

Does anyone know anything about this command at all?

3rods 04-10-2008 07:33 AM

If your using maildir (as opposed to mbox) than the mail command won't recognize that you have mail unless you let the mail command know that mail is delivered in the maildir format. I never really figured out how to get the mail command to read maildirs, so I can't help you there. (maybe PINE or ELM can do this?)

mbox vs maildir

Maybe this will help:

hashbangbinbash 04-10-2008 07:58 AM

Thanks 3rods! Although at this stage (for what I'm trying to do) it's more about why "mail" doesn't send.

3rods 04-10-2008 08:32 AM


Originally Posted by hashbangbinbash (Post 3116796)
Thanks 3rods! Although at this stage (for what I'm trying to do) it's more about why "mail" doesn't send.

Maybe you like mbox format (waves jedi mind trick hand).

It would allow mail (or mailx) to read mail from the command line.

There's nothing that says you have to use maildir over mbox. (Well, there is actually, maildir is a better format - less prone to corruption and faster retrival.)

Rather than trying to retrofit something, you could just stick with the mbox format.

Just a thought.

hlenderk 05-19-2008 09:57 PM

Has this been solved? I am having the same problem using fc6.
In xterm I send a message like this:

$ mail -s "test"     
hello will it go
Cc:  <I hit enter>

...then I do any command or hit return and get this message:

You have new mail in /var/spool/mail/hlenderk
When I check the message is about a failed send. Highlights are:

  ----- The following addresses had permanent fatal errors -----
    (reason: 554 Service unavailable; Client host [] blocked using c; 1081496407)

  ----- Transcript of session follows -----
... while talking to
>>> DATA
<<< 554 Service unavailable; Client host [] blocked using combined.n; 1081496407
554 5.0.0 Service unavailable
<<< 554 Error: no valid recipients the bottom it shows the mail did go as typed:

Date: Mon, 19 May 2008 21:57:36 -0400
From: Howard <myusername@localhost.localdomain>
Message-Id: <200805200157.m4K1va3r005072@localhost.localdomain>
Subject: test

hello will it go


Is this because I need to send authorization to smtp?
(seems like I should, like I do for regular email through thunderbird)
I see nothing in 'man mail' on how to configure this.
Thanks Howard

All times are GMT -5. The time now is 01:11 AM.