SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have been using linux on and off for the past year. I know a little more than a newbie. And I am loving it.
I need some major help. I have setup a Slackware 10 box on my works intranet as a php, mysql development server.
apache and php are working fine. I know need to be able to use the php mail function. Any email generated form php need to be forwarded to our freeBSD mail server and it will deliver the mail.
I have tried googling for php and sendmail and no luck.
I have never setup sendmail before. I have set the sendmail_path = /usr/sbin/sendmail in my php.ini and restarted apache.
I also set the # "Smart" relay host (may be null) DS172.24.96.205 in my sendmail.cf and restarted sendmail. The mail has never gotten delivered.
The last line in my maillog is:
Feb 4 10:19:09 UnixServer sendmail[1763]: j148J9Ja001763: from=nobody, size=213, class=0, nrcpts=0, msgid=200502040819.j148J9Ja001763@UnixServer, relay=nobody@localhost
I have also removed the default sendmail install using pkgtool and reinstalled it using this tutorial. hgriggs.com/sendmail.html and that did not work.
I though this would be a simple thing to setup considering that it just needs to forward mail to a another server.
Can some one please tell me step by step how to setup sendmail. My boss is getting a little edgy about how long I have spent on this issue.
Please help.
Does the freeBSD mail server accept mail from your box?
If yes, then I guess the problem is that, if you use a web form to send mail via php, the user who tries to write in sendmail queue is "nobody" or whatever is the user under which runs your webserver (apache?). A quick fix is to change that user (in httpd.conf if you use apache) to the user thar runs sendmail (probably smmsp).
Take a look also at /var/log/mailog to see if you find what the problem is.
If you use the sendmail package that comes with Slackware the user/group that run sendmail is smmsp/smmsp. If not run:
Code:
ps aux|grep sendmail
to find out the sendmail user. Then find the group of that user from /etc/group.
Open your apache's httpd.conf and find the lines that define the user/group under which apache is running. It's something like:
Quote:
User nobody
Group nobody
Change the words nobody with the name of the user and group that runs sendmail and restart apache.
There is no need to change anything in your php.ini because php's mail function knows how to invoce sendmail to send emails.
I have changed the user and group in apache to smmsp still no change. The emails still do not get to me.
I have checked the maillog on the freeBSD box and the mail does not reach it.
This is the last few lines form my maillog on my Linux box
Quote:
Feb 4 10:19:09 UnixServer sendmail[1763]: j148J9Ja001763: from=nobody, size=213, class=0, nrcpts=0, msgid=<200502040819.j148J9Ja001763@UnixServer.sublime>, r
elay=nobody@localhost
Feb 7 09:07:56 UnixServer sm-mta[1475]: starting daemon (8.13.3): SMTP+queueing@00:25:00
Feb 7 09:07:57 UnixServer sm-msp-queue[1478]: starting daemon (8.13.3): queueing@00:25:00
Feb 7 09:36:01 UnixServer sendmail[1672]: j177a1Jq001672: from=smmsp, size=213, class=0, nrcpts=0, msgid=<200502070736.j177a1Jq001672@UnixServer.sublime>, re lay=smmsp@localhost
Should relay no be the bsd server or does that mean that smmsp is relaying through sendmail.
In my sendmail.cf file a have set Smart relay to:
Quote:
# "Smart" relay host (may be null)
DS172.24.96.205
Is this correct and can I use IP address instead of hostnames.
Is their a way I can manually test sendmail and make sendmail a open relay. I don't need to worry about security as it is a test server. It need to accept request form any internal address.
I have removed the default install of sendmail and installed form source. Should I rather install the default sendmail.
I think that smart relay host does not work with IP addresses. So use the freeBSD hostname in the DS definition, or if you cannot resolve the IP to hostname try this
No need to reinstall. Just use the sendmail-slackware.mc file that slackware uses to create the sendmail.cf and add in that file the IP in brackets. Mind that you may have to uncomment the line about smart host (i.e. remove "dnl" in the front and put it at the end of the line). Then recreate the sendmail.cf.
Take a look at usr/share/sendmail/cf/cf/README how to create such file. Always take a backup of your original /etc/mail/sendmail.cf before doing any changes.
Did you try to use system commands with php like system() or popen() instead of using
the built-in mail() function, that should work if it works at command line
More infos at www.php.net with the functions search field
You could also take the thing at a lower level and implement a personal mail() function which could open a tcp socket to talk with your freeBSD mail server
I finally got it working and it ended up being something very simple and something I overlooked.
Sendmail was working fine for the begining. All I needed to do with Sendmail was set the "Smart" relay host.
Then in my php.ini I needed to set my path to sendmail.
This is what I set it to and this did not work.
Quote:
; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = /usr/sbin/sendmail
In the comment it says that (default: "sendmail -t -i") . So I never supplied any arguments assuming it will use the default, but it started working when I add the arguments -t -i. So that means that it is not the default arguments but the recommended arguments.
So the correct Sendmail path is.
Quote:
; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = /usr/sbin/sendmail -t -i
What lead me to this conclusion was that in my maillog messages that where successful had 3 entries in the maillog and in the first entry it had nrcpts=1 (no. of recipients), and entries for mails generated using php/apache it had only 1 entry in the maillog and nrcpts=0. Which means that it was not sending the messages.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.