LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-06-2008, 05:55 PM   #1
moob8
Member
 
Registered: Sep 2006
Distribution: slackware
Posts: 132

Rep: Reputation: 15
help making a sendmail command line


So I'm using various resources (the web, these forums, man pages, and the sendmail website) to construct a sendmail command line.

A sample email has been created for testing purposes. it consists of:
Code:
Date: Sat, 6 Dec 2008 14:58:15 -0500
From: ***********
To: test@testmail.info
Subject: komisoar
Message-ID: <20081206195815.GA3515@darkstar>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.4.2.3i

Sample text in body of the email, hey
In the above, I've replaced my correct actual email address with the *'s, obviously.

The sendmail command that I have crafted (so far) is:
Code:
cat test.txt | /usr/sbin/sendmail -t
The above command has actually been tried. It runs without error messages and returns to the prompt.

Waiting, checking mail and poking around the hard drive eventually revealed that the email was not sent to my ISP. It was instead interred in a place on my hard drive, in var/spool/mqueue. There were two text files with garbly names. One contained the message body. The other contained headers, including extra ones added by sendmail. Inspection of the headers revealed that sendmail had no knowledge of my isp's email server name. This, in retrospect, is reasonable. After all, I had not told sendmail this information.

So, there is only one bit of data needed to get my mail-sending working: there is a place, in the place is a file. In this file needs to be added a string. This string is the name of my ISP's smtp server. I know the name of my ISP's smtp server but I can't figure out how to let sendmail in on it.

I found the location of the configuration file for sendmail. It's contents were ... obtuse.

The man page makes no mention of specifying the smtp server. Google searching has many results, none which were helpful. In a similar fashion and with similar result, these forums were searched. The sendmail web site was ... beyond me.


This indicates on of two things.

One, sendmail doesn't actually do what I think it does and I'm barking up the wrong tree. I'm using a tool created for one purpose for a completely different purpose.

Two, sendmail has an easy and obvious way of specifying the smtp server, but I've overlooked it: read it right on the man page but, because of the particular phrasing, did not recognize it for what it was.

In the case of option two, how can I achieve the desired result, that is, to send mail from a command line?

Thank you in advance.

Last edited by moob8; 12-06-2008 at 05:58 PM.
 
Old 12-06-2008, 07:26 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by moob8 View Post
Inspection of the headers revealed that sendmail had no knowledge of my isp's email server name.
While I found your OP refreshing in terms of both research and style I prefer the actual error text instead. All Sendmail needs is to be able to resolve external addresses and it will figure out things. If you configured sendmail (or use a sane default /etc/mail/sendmail.cf), and you know your ISP's MTA resides at "smpt.do.main" try posting the output of running "echo "/mx do.main"|/usr/sbin/sendmail -bt" (or use "/usr/sbin/sendmail -bt -d" if you can't get enough of diagnostics). BTW, you don't really need headers like date and MUA, at least I wouldn't use a Message-ID one unless you generate it on the fly.
 
Old 12-08-2008, 08:40 PM   #3
moob8
Member
 
Registered: Sep 2006
Distribution: slackware
Posts: 132

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
While I found your OP refreshing in terms of both research and style I prefer the actual error text instead.
I didn't want to focus on the negative.

Quote:
All Sendmail needs is to be able to resolve external addresses and it will figure out things. If you configured sendmail (or use a sane default /etc/mail/sendmail.cf), and you know your ISP's MTA resides at "smpt.do.main" try posting the output of running "echo "/mx do.main"|/usr/sbin/sendmail -bt" (or use "/usr/sbin/sendmail -bt -d" if you can't get enough of diagnostics). BTW, you don't really need headers like date and MUA, at least I wouldn't use a Message-ID one unless you generate it on the fly.
Well, I thank you for your reply.

In the meantime (before I saw your reply), I found this link on the subject: http://www.screaming-penguin.com/node/4214

Following the directions, on the link, I somehow deleted the config file for sendmail. Taking this as a hint that I this program was too complicated for me, I fetched and compiled msmtp instead. Fail at one thing, try another.

Again, thank you for your reply, as it was knowledgeable and did not have the often-used "did you check google" line.
 
  


Reply

Tags
linux, sendmail, smtp



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
Sendmail from the command line Draithon Linux - Newbie 5 04-14-2011 03:57 AM
How is it done that making 2.6 kernel it doesn't display full command line? rsashok Linux - General 5 12-07-2006 01:30 PM
Making programs accessible from command line simsjr Linux - Software 5 04-27-2004 08:56 AM
making aliases via command line MACSRULE *BSD 1 04-07-2004 03:14 PM
command line sendmail jchristman Linux - Software 4 03-13-2003 05:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:35 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
Open Source Consulting | Domain Registration