LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2008, 12:14 PM   #1
hashbangbinbash
Member
 
Registered: Mar 2008
Posts: 106

Rep: Reputation: 16
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?

Last edited by hashbangbinbash; 04-08-2008 at 12:16 PM.
 
Old 04-08-2008, 12:17 PM   #2
hashbangbinbash
Member
 
Registered: Mar 2008
Posts: 106

Original Poster
Rep: Reputation: 16
Any suggestions at all, welcome.
 
Old 04-08-2008, 12:20 PM   #3
3rods
Member
 
Registered: Mar 2008
Posts: 70

Rep: Reputation: 16
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/
 
Old 04-08-2008, 12:43 PM   #4
hashbangbinbash
Member
 
Registered: Mar 2008
Posts: 106

Original Poster
Rep: Reputation: 16
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.

Last edited by hashbangbinbash; 04-08-2008 at 12:52 PM.
 
Old 04-10-2008, 07:08 AM   #5
hashbangbinbash
Member
 
Registered: Mar 2008
Posts: 106

Original Poster
Rep: Reputation: 16
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?
 
Old 04-10-2008, 08:33 AM   #6
3rods
Member
 
Registered: Mar 2008
Posts: 70

Rep: Reputation: 16
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
 
Old 04-10-2008, 08:58 AM   #7
hashbangbinbash
Member
 
Registered: Mar 2008
Posts: 106

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

Last edited by hashbangbinbash; 04-10-2008 at 09:02 AM.
 
Old 04-10-2008, 09:32 AM   #8
3rods
Member
 
Registered: Mar 2008
Posts: 70

Rep: Reputation: 16
Quote:
Originally Posted by hashbangbinbash View Post
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.
 
Old 05-19-2008, 10:57 PM   #9
hlenderk
LQ Newbie
 
Registered: Apr 2005
Posts: 7

Rep: Reputation: 0
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

Last edited by hlenderk; 05-19-2008 at 11:00 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 07:37 AM
Unable to send mail using mail command faruque.ahmed Linux - Software 1 02-03-2007 11:29 AM
mail settings in linux mail command cad Linux - General 1 01-27-2007 05:23 AM
Cannot send mail with mail() command in PHP 4.3.4, Apache 2.0.48, Mandrake Linux 10 arcanum Linux - General 3 06-27-2004 07:06 PM
Using the 'mail' command to mail a file Crashed_Again Linux - Software 2 08-08-2003 06:19 AM


All times are GMT -5. The time now is 08:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration