Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-28-2010, 12:04 PM   #1
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:
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, 12:18 PM   #2
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:

# cat - | sendmail -t -i
From: foobar
Subject: lalala

This is the mail body.
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.


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

All times are GMT -5. The time now is 06:03 PM.

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