LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mail command (https://www.linuxquestions.org/questions/linux-newbie-8/mail-command-633948/)

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?

http://linux.about.com/od/commands/l/blcmdl1_Mail.htm

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.

http://caspian.dotconf.net/menu/Software/SendEmail/

hashbangbinbash 04-08-2008 11:43 AM

http://linux.about.com/od/commands/l/blcmdl1_Mail.htm
, yup, that's command I'm having a problem with, I used

Code:

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

Code:

echo "My test" | mail -s "My test mail" hashbang@binbash.net < /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

http://www.linux-mail.info/mbox-mail...orage-formats/


Maybe this will help:

http://ubuntuforums.org/archive/index.php/t-528433.html

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

Quote:

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:
Code:


$ mail -s "test" myemail@myisp.net     
hello will it go
Cc:  <I hit enter>

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

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

  ----- The following addresses had permanent fatal errors -----
<myemail@myisp.net>
    (reason: 554 Service unavailable; Client host [66.84.115.73] blocked using c
ombined.njabl.org; 1081496407)

  ----- Transcript of session follows -----
... while talking to mail-in.bcpl.net.:
>>> DATA
<<< 554 Service unavailable; Client host [66.84.115.73] blocked using combined.n
jabl.org; 1081496407
554 5.0.0 Service unavailable
<<< 554 Error: no valid recipients

...at the bottom it shows the mail did go as typed:
Code:

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

hello will it go

--m4K1vd2h005075.1211248659/localhost.localdomain--

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.