Solved

sendmail error

Posted on 2006-11-05
8
432 Views
Last Modified: 2010-03-18
hi;

when i want to run sendmail it gives en error like "sendmail: fatal: unable to switch to qmail home directory". so i cant send mail from php using mail function. my system is suse 10.0. and running postfix 2.5.5. what is the problem ?

thanks.
0
Comment
Question by:kenanerdey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 26

Expert Comment

by:jar3817
ID: 17880433
If you're already running postfix, why do you need sendmail? You can just edit your /usr/local/lib/php.ini file to use postfix for sending mail rather than sendmail from php.
0
 

Author Comment

by:kenanerdey
ID: 17881622
i found the problem. as i am running apache as root, when i used /usr/sbin/sendmail it didn't give error. so i changed php.ini with new path.  
by the way sendmail is the mail client of postfix (postfix's sendmail wrapper)
0
 
LVL 26

Expert Comment

by:jar3817
ID: 17881948
DON'T RUN APACHE AS ROOT.

If your webserver is compromised (by fault of an exploit in apache or php or any other module related to apache) and apache is running as root, you will have handed your server (and all it's data) over to the attacker on a silver platter.  As if you losing control of your server wasn't bad enough, it would probably end up pumping out spam which affects everyone else. Do us all a favor and don't run apache (or any other public facing service) as root.

As for your original question, the "sendmail: fatal: unable to switch to qmail home directory" sounds like a permission problem. Once you figure out which directory this message is referring to, you can make it read/writable by the non-root user apache is running as (apache,nobody,daemon, whatever).
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

Author Comment

by:kenanerdey
ID: 17887536
do i have to do special to run it as user ( parameter or something) or just logon as user then run it ?
0
 
LVL 26

Expert Comment

by:jar3817
ID: 17889114
In your httpd.conf you have to have lines like this:

User  username
Group groupname

Instead of using hte names, you can use the uid and gid. If you don't have an apache user/group, you can use "nobody", that user and group should already exist on your system.
0
 

Author Comment

by:kenanerdey
ID: 17890481
yes it's working as wwwrun. but when i do ps -ef i see a httpd process run as root. but there are other httpd process run as wwwrun.
i tried something. i wrote a php script taking a parameter and include it. when i run it as ...exam.php?t=/etc/passwd  it showed me passwd file. but it can only be read by root. so this is a problem. ideas ?
0
 
LVL 26

Accepted Solution

by:
jar3817 earned 125 total points
ID: 17890781
/etc/passwd is usually world readable, that's how the system does uid to username translations. The same is true for /etc/group.  The actual passwords are usually kept in a file called /etc/shadow which should be only readable (400) for root:root. Be careful with scripts like that, a lot of damage can be done by leaving them laying around.
0
 

Author Comment

by:kenanerdey
ID: 17895961
you are right. i thought it's only readable by root. you have the points.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question