LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 01-25-2005, 08:20 PM   #1
nasht
LQ Newbie
 
Registered: Apr 2004
Location: Los Angeles
Distribution: Fedora Core 4
Posts: 29

Rep: Reputation: 15
Question sendmail


Hi,

I'm a linux newbie (a week old).
I installed Mandrake 10.1.
I selected the packages Apache httpd with php. More precisely, i think they call it ADVX.org on Mandrake.

The web server seems to work fine when I type localhost .
I also tested to write some simple php scripts, worked fine...
Then I tried my mail() function on php, but it didn't work.
After a little research, I found out that I needed "sendmail" on my system.
I used the Package Installer to find and install the package "sendmail".
It now appears on the list of services (on the Mandrake Control Center), but even though it is set to run "On boot", the status is always on "stopped".
When I try to manually click on the START button, the button itself stays down, as if I was still clicking on it, and nothing happens...
I keep clicking on OK, OK, OK... after a long while, it seems to work. The status is "running".
I set my php.ini line to state : sendmail_path = /usr/sbin/sendmail
I now go back on localhost, with my mail() function.
The loading seems to take forever. After a very long time, the mail() still fails.

Can someone help?

Thank You,

Nathan
 
Old 01-26-2005, 11:11 AM   #2
pnellesen
Member
 
Registered: Oct 2004
Location: Missouri, USA
Distribution: Slackware 12.2, Xubuntu 9.10
Posts: 371

Rep: Reputation: 31
1) Can you telnet to port 25: "telnet localhost 25"?
2) If so, can you send email manually from the telnet prompt? (There's at least one thread in the forum describing how to do that, but if you can't find it let me know.)

3) Are you trying to email from your machine through your ISP out to the internet? If so, your ISP may be blocking port 25 from client computers - you may have to edit the sendmail configuration file to relay to your ISP's SMTP server..

I just went through this exact thing last weekend, but I finally was able to do it, so hang in there
 
Old 01-26-2005, 07:20 PM   #3
nasht
LQ Newbie
 
Registered: Apr 2004
Location: Los Angeles
Distribution: Fedora Core 4
Posts: 29

Original Poster
Rep: Reputation: 15
Hi,
As you sent me this answer, I decided to try again, and here is what happened this time:

I booted my computer, and went on the Mandrake control center> services.
Now, SENDMAIL was RUNNING, but HTTPD was NOT RUNNING. I don't get that...
So, I clicked START on httpd.
Then I tried again to load my php page with my mail() function.
It took forever to load, like maybe 2 or 3 minutes [edit: I just tested, more precisely exactly 61 seconds] , and then it actually SENT the email!

Some might say that my problem is solved, but... I don't think it's right that it takes so long, something must be wrong. And also it's not right that it doesn't always work.

Now about what you said.
I typed : telnet localhost 25
I recieved:
220 localhost ESMTP Sendmail 8.13.1/8.13.1; // and today's date

Now, you asked me to try to send an email via the telnet. So I looked up on the net, and found some command lines:
MAIL
> Polite people say helo first // LOL I liked that one.
HELO localhost
> blabla 127.0.0.1 please to meet you
MAIL FROM:nathan@nathanhazout.com
>...sender ok
RCPT TO:nathan.linux@gmail.com
> bla bla... recipient ok.
DATA
test
.
> blabla.... message accepted for delivery

and... I recieved the message!

I hope it's ok that I give all the details like that... i want to make sure i don't miss anything

So, analyze?

Thanks!

Last edited by nasht; 01-26-2005 at 07:59 PM.
 
Old 01-26-2005, 08:01 PM   #4
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
I had a problem with sendmail taking close to three minutes to work, and solved it by changing my /etc/hosts file to read

127.0.0.1 localhost.localdomain.bodhisattva localhost

(The name I gave my machine is "bodhisattva.")

That provides a phony, but workable, "fully qualified domain name" for my machine, and after that sendmail loaded and worked instantly.

If you're running some kind of network you might have to do it a bit differently, but that's quite likely where the problem with the delay lies.
 
Old 01-26-2005, 08:37 PM   #5
nasht
LQ Newbie
 
Registered: Apr 2004
Location: Los Angeles
Distribution: Fedora Core 4
Posts: 29

Original Poster
Rep: Reputation: 15
wow kind of cool advice, thanks

Now the time to run my mail() is down to within 1 to 6 seconds. Do you think it's enough?

When you said (The name I gave my machine is "bodhisattva."), does that mean I can write anything here, or do I have to look somewhere in my system for the name of my machine?

well, I was about to ask "what about this httpd that doesn't start at boot?"
But right now I booted twice and it worked fine...
I don't really know what's going on anymore
 
Old 01-26-2005, 09:10 PM   #6
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
You can name your machine just like a child, anything within reason.

I don't even know what httpd is, so glad it works OK after all.

You're not the only one that doesn't know what's going on, if it's any comfort.

Glad your mail's speedy now!
 
Old 01-26-2005, 09:22 PM   #7
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
Another thing, if you want the name change to be permanent, go into

/etc/rc.d/rc.sysinit

(as root) and go down to the line that says HOSTNAME=[probably localhost]

and insert the name you chose after the equals sign in place of the name that's there.

Those two files should be all you have to change.
 
Old 01-27-2005, 12:21 AM   #8
RomanG
Member
 
Registered: Jan 2005
Location: Russia, Kazan
Distribution: Mandrake 10.2, RedHat sometimes..
Posts: 110

Rep: Reputation: 15
Quote:
Originally posted by jonr
Another thing, if you want the name change to be permanent, go into
/etc/rc.d/rc.sysinit
(as root) and go down to the line that says HOSTNAME=[probably localhost]
and insert the name you chose after the equals sign in place of the name that's there.
Those two files should be all you have to change.
What two files? One is /etc/rc.d/rc.sysinit and what is another?
For changing my hostname I added HOSTNAME=host.domain.ru to file /etc/sysconfig/network
It works.
 
Old 01-27-2005, 12:08 PM   #9
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
Quote:
Originally posted by RomanG
What two files? One is /etc/rc.d/rc.sysinit and what is another?
The other file is /etc/hosts referred to earlier in the thread.
 
Old 01-27-2005, 12:46 PM   #10
RomanG
Member
 
Registered: Jan 2005
Location: Russia, Kazan
Distribution: Mandrake 10.2, RedHat sometimes..
Posts: 110

Rep: Reputation: 15
Quote:
Originally posted by jonr
The other file is /etc/hosts referred to earlier in the thread.
I don't have this file (link) by default in my Mandrake 10.1.
What solution is more correctly? With '/etc/rc.d/rc.sysinit' and '/etc/hosts'
or '/etc/sysconfig/network' ?
 
Old 01-27-2005, 12:58 PM   #11
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
The solution that works for me with Mandrake 9.2 and now Mandrake 10.1 is to set the name I want in /etc/hosts and /etc/rc.d/rc.sysinit in the way I described in the thread...

I only run a single machine; if a network is involved, the solution may have to be different. But this works for a single machine.

Sendmail wants to see a "fully qualified domain name" and becomes confused when it doesn't. Setting up /etc/hosts as described above provides a name that appears to sendmail to be what it wants. Then it works rapidly.
 
Old 01-27-2005, 02:53 PM   #12
barrythai
Member
 
Registered: Dec 2004
Location: thailand
Distribution: suse9.3, Mandrake10.1
Posts: 381

Rep: Reputation: 30
Mandrake comes with postfix and not sendmail. It is already configured for you if you had included it in your install.

I use Postfix on 10.0 and 10.1 and is easier than sendmail to set up maybe you are having a conflict.

You should load webmin from the rpm packages and run that to set up postfix. If you want to change to to sendmail webmin
will configure that to. Mandrake must have had a reason to change to Postfix from the tradional Redhat offering of Sendmail,
still with Fedora 3 I notice. Maybe, someone can enlighten me?


 
  


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
Sendmail ignores my sendmail smarthost entry Paul_assheton Linux - General 1 03-17-2009 08:55 AM
FC4 and Sendmail - Cannot create sendmail.pem Balderayne Linux - Security 2 11-09-2005 03:55 PM
php+ sendmail no good - python + sendmail ok nephish Linux - Networking 1 10-07-2005 02:19 PM
Sendmail - RunAsUser=sendmail:mail/What files to i have to change ForumKid Linux - Security 45 01-18-2002 12:47 PM
sendmail (dont just ignore it 'cause its got sendmail in the subject :P) GnomeKing Linux - Networking 1 11-12-2001 10:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

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