LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-04-2004, 04:57 PM   #1
ubers0ldat
Member
 
Registered: Jul 2003
Posts: 33

Rep: Reputation: 15
General questions about fresh Slack install and Sendmai


I just installed slackware with apache/php/mysql proftpd and samba.

I got everythign working right, but my website uses my mail server.

I got SENDMAIL installed on my system already, but I don't know how to use it or configure it or anything. My PHP script which utilizes the Mail(); function appears to go off without a hitch, but the email never arrives!

Can someone give any links where i can learn about hwo sendmail works and such?

sendmail.org doens't offer much help.


Thanks a lot!

P.S.

How do i send an email from the command line?

Thanks.

Ubers0ldat
 
Old 04-04-2004, 06:59 PM   #2
artistikone
Member
 
Registered: Jul 2003
Distribution: slackware-current
Posts: 76

Rep: Reputation: 15
You'll want to first look in your maillog to see what's happening with the mail. it might be located in either /var/log/mailog, /var/log/syslog or /var/log/messages. Post it here if you don't understand them and I'll try and help ya out.

To send email via a command prompt, you would do it through telnet like so:

(Type what is in bold)

user@hostname:# telnet hostname 25
Trying 127.0.0.1...
Connected to hostname.
Escape character is '^]'.
220 hostname ESMTP Sendmail 8.12.8/8.12.8; Sun, 4 Apr 2004 16:48:08 -0700

HELO localhost
250 hostname Hello IDENT:0@localhost [127.0.0.1], pleased to meet you
MAIL from:<senders@emailaddress>
250 2.1.0 <senders@emailaddress>... Sender ok
RCPT to:<recipitents@emailaddress>
250 2.1.5 <recipitents@emailaddress>... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
SUBJECT: Test

Your message.
.

250 2.0.0 i34NoYG3017433 Message accepted for delivery
quit
221 2.0.0 hostname closing connection
Connection closed by foreign host.
 
Old 04-05-2004, 01:26 AM   #3
ubers0ldat
Member
 
Registered: Jul 2003
Posts: 33

Original Poster
Rep: Reputation: 15
Thanks for responding, what you showed me worked, i'm able to send mail to any recipient. However, isn't there a way to do this without using telnet?

using "nail" or the "mail" program?

Another thing, i made a php script which contains this:

<?PHP

mail("ubers0ldat@comcastDOTnet","RE:message","Hey");

?>

This little script should send an email to my address with subject "re:message" and body "hey"

However, the mail never arrives. Any other info you can give me?

Thanks.
 
Old 04-05-2004, 01:01 PM   #4
AutOPSY
Member
 
Registered: Mar 2004
Location: US
Distribution: Redhat 9 - Linux 2.6.3
Posts: 836

Rep: Reputation: 31
Sendmail is a mail transfer agent.

You may need to run mail, and sendmail to send the mail.
 
Old 01-22-2005, 11:47 AM   #5
pnellesen
Member
 
Registered: Oct 2004
Location: Missouri, USA
Distribution: Slackware 12.2, Xubuntu 9.10
Posts: 371

Rep: Reputation: 31
Quote:
Originally posted by artistikone
You'll want to first look in your maillog to see what's happening with the mail. it might be located in either /var/log/mailog, /var/log/syslog or /var/log/messages. Post it here if you don't understand them and I'll try and help ya out.
Ok, I'm having the same problem trying to send mail in PHP. Checked my "maillog" file, saw the following:

sendmail[1234]: <blah> relay=root@localhost
<more lines like that>
...Connection refused by [127.0.0.1]

So, is the connection being refused by Apache, or by sendmail? Not sure where to look for this one...

Thanks in advance
 
Old 01-22-2005, 01:00 PM   #6
artistikone
Member
 
Registered: Jul 2003
Distribution: slackware-current
Posts: 76

Rep: Reputation: 15
It looks like sendmail is running, but it's refusing conections. Double-check your sendmail config etc, make sure connections from localhost are allowed, should be by default. Also, try what I mentioned about, about telneting manually to make sure all is good with sendmail. If you can do it manually, then it's probably going to be a perms/user issue. For instance maybe you have apache running as apache:nobody, which may not have perms to use sendmail. As always, restart sendmail if you made/make any changes.

Sorry to be vague, but I haven't used sendmail in awhile heh.
 
Old 01-22-2005, 03:41 PM   #7
pnellesen
Member
 
Registered: Oct 2004
Location: Missouri, USA
Distribution: Slackware 12.2, Xubuntu 9.10
Posts: 371

Rep: Reputation: 31
Sigh..................

/etc/rc.d/rc.sendmail not executable. Set it. run "rc.sendmail restart". Telnet to port 25 - no problems...

Guess it helps if sendmail itself is running :P

Update - Problem solved (after MUCH digging and playing around)!

Added the "-f<email address user entered on form>" parameter to the PHP mail() command. Once I did this, the mail went through fine.

Again, thanks for the help.

Last edited by pnellesen; 01-23-2005 at 05:03 PM.
 
  


Reply



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
Slack 10 - No Sound After Fresh Install IamI Slackware 8 06-16-2005 08:30 PM
fresh slack 10.1 install (2.4.29) on a D915GEV MB coocoopuff Slackware 1 05-30-2005 12:41 PM
General Questions about Slack wh33t Slackware 8 02-01-2005 04:37 PM
no network after fresh Slack 9 install major.tom Slackware 4 08-04-2003 04:01 PM
some general slack questions before I switch stevenhasty Slackware 11 07-25-2003 01:05 AM

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

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