LinuxQuestions.org
Visit Jeremy's Blog.
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 06-28-2010, 01:04 PM   #1
sdiptanil
LQ Newbie
 
Registered: Jun 2010
Posts: 1

Rep: Reputation: 0
Unable to use sendmail utility in UNIX environment


Hi All,
This is in relation to the usage of sendmail utility in UNIX environment. Any help would be highly appreciated.
The issue is as follows :
In order to use the sendmail utility, I created a text file as xxx.txt with the following entries:
From:abc@abc.com
To:to@to.com
Subject:This is the subject

Then from the command line I ran the following command :
/usr/lib/sendmail -t -i << EOM
Then something like > came as a return where I wrote `cat xxx.txt`
Then again something as > appeared where I put EOM and then the command prompt retuned back. However, I failed to receive any mail.
Could anyone kindly correct me, if I am wrong somewhere ?
Thanks a lot in advance,
 
Old 06-28-2010, 01:18 PM   #2
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
This isn't really a problem with sendmail but with your understanding of the shell's heredoc syntax. you should probably read up a little on that.

A hint: any sendmail compatible MTA expects the WHOLE mail on stdin when called the way you do it. So you could do something like that:

Code:
# cat - | sendmail -t -i
From: foobar
To: test@example.com
Subject: lalala

This is the mail body.
[Ctrl-D]
#
When using heredoc to provide the input to sendmail, all this input has to be given LITERALLY before the end marker of the heredoc ... the ">" prompt indicates that the shell expects more input as the command is not complete yet.
 
  


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
How do I manipulate the Unix graphical environment? Hodson Linux - Newbie 9 12-17-2008 01:37 PM
Unix Like Environment Paris Heng Linux - Newbie 10 04-10-2008 06:56 AM
unix find utility shamgar03 Linux - Software 8 08-09-2007 05:06 PM
Free UNIX/Linux/OS X Networking Utility??? cmf5150 Linux - Networking 2 01-05-2004 03:22 PM
Unix environment under windows concoran Programming 7 10-29-2001 01:12 AM


All times are GMT -5. The time now is 02:43 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