LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-02-2014, 02:45 PM   #1
skoda
Member
 
Registered: Jun 2013
Posts: 111

Rep: Reputation: Disabled
Bash Mail subject issue


Hi folks

Code:
#!/bin/bash
subject="Access Log"
echo “test” | mail -s $subject  mymail@domain.com < /home/me/who.txt
now the problem is , above mail function sends a mail to mymail@domain.com correctly
and i get one more mail with "Mail delivery failed: returning message to sender" telling

"Unrouteable address"
Access@servername.com"
and
log@servername.com"

whats wrong?
 
Old 08-02-2014, 04:06 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
Your subject is being interpreted as two addresses ("Access" and "log"). Check that your version of the mail command actually accepts the -s parameter, and make sure a subject containing spaces is enclosed in double quotes.
 
Old 08-03-2014, 12:59 AM   #3
skoda
Member
 
Registered: Jun 2013
Posts: 111

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
Your subject is being interpreted as two addresses ("Access" and "log"). Check that your version of the mail command actually accepts the -s parameter, and make sure a subject containing spaces is enclosed in double quotes.
Thank you buddy, ill check.
 
  


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
[SOLVED] mail Subject getting truncated vinaytp Linux - Newbie 4 09-23-2010 11:26 AM
Rewriting mail subject with Formail Sheridan Linux - Server 3 02-29-2008 09:33 AM
How to make sendmail logs e-mail subject? batbayar Linux - Server 0 05-08-2007 01:30 AM
Sending mail with subject in Linux script 151803 Linux - General 5 01-25-2007 05:46 AM
Piping to mail and adding a subject line. Echo Kilo Linux - General 1 12-03-2005 12:24 PM


All times are GMT -5. The time now is 07:23 AM.

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