SCIENTIFIC-LINUX-USERS Archives

October 2005

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Tue, 18 Oct 2005 09:27:50 -0500
Content-Type:
TEXT/PLAIN
Parts/Attachments:
TEXT/PLAIN (79 lines)
I've used it directly without any problems.  The command is

	sendmail <msgfile

If you want to have mail headers for the recipient, you need to construct 
them in msgfile like so:

    To: soandso
    Subject: some subject

    start message here

and use the command

	sendmail -t <msgfile

You don't need sendmail running but you will need sendmail.cf correctly 
configured.  If you are sending directly to a mail server, the stock 
sendmail.cf will work out of the box.  If you need to go through a relay, 
then sendmail.cf will have to be set up correctly with the correct relay.  
On a Redhat system, you actually do the config via sendmail.mc, then run 
m4 to produce the sendmail.cf file.

Having said all this, the easier way is to use the /bin/mail program if you
want to send mail from the shell or a shell script.

If you are trying to send via PHP/httpd and are using the -f flag, that is,
to set the From: line, you need to allow this.  Only root is allowed to
change the From: field.  Sending mail via PHP/httpd means that the user
apache is sending the mail.  But, there is a file is /etc/mail where you can
list the "trusted users", that is, users who are allowed to set the From
field.  I forget what the name of the file is, but you can look it up in the
sendmail.cf documentation.

Hope this helps!

Ken


On Mon, 17 Oct 2005, Randy Merritt wrote:

> Has anyone used /usr/bin/sendmail to send an email
> over the Internet using a shell window and a simple
> mail message?  [this started with attempting to use
> PHP's mail function]  Using sendmail with only -t and
> entering a simple email msg in a shell window fails
> with a Connection timeout message in /var/log/maillog.
> 
> The MTA listed in maillog is pingable and names a
> Yahoo address.  My From: address is my (SL) login and
> my To: address is my (valid) Yahoo email address;
> 'Subject: foo' and body a few 'x's.
> 
> The SMTP relay is my ISP's well-known SMTP MTA
> address.  I've added an 'auth' FEATURE for this MTA in
> sendmail.cf to no avail.
> 
> What seems odd is that this same simple email msg sent
> to my Yahoo address with Thunderbird goes out just
> fine.  But the same send attempt with sendmail fails. 
> In a Thunderbird test the sendmail daemon was even
> shutdown.
> 
> I've tried some variations from documentation at
> www.sendmail.org but so far no luck.  In the interest
> in saving some time if anyone has already solved this
> I'd appreciate some insight.
> 
> TIA,
> Randy Merritt
> 
> 
> 
> 		
> __________________________________ 
> Start your day with Yahoo! - Make it your home page! 
> http://www.yahoo.com/r/hs
> 

ATOM RSS1 RSS2