Sendmail and PHP - configuring sendmail/PHP

Hi,

I'm trying to use mail() in a PHP script residing on my FreeBSD server; only it appears I have problems with Sendmail. It's not an error in my script; I know this for sure from close inspection and testing, i.e. my variable is set to true. I've had Sendmail working previously and was accessing my messages from the terminal. And currently:

$ mail
Code:
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/1cookie": 2 messages 1 new
    1 root@my.domain.or  Sun Nov  4 05:07  30/1138  "Nvi saved the file vi.5668mU6CyE"
>N  2 root@my.domain.or  Thu Dec 27 11:00  29/1115  "Nvi saved the file vi.5668mU6CyE"

I don't see any reason why it should suddenly stop, maybe you could show me how to access mailbox /etc/mail/fred say and read messages for this user? I really lack experience.

Code:
$ cd /var/mail
$ ls
1cookie	ftp	mysql	root	tqadmin	www

Are the above the mailboxes on my system?

My PHP/Server configuration goes like:

$ which sendmail
Code:
/usr/sbin/sendmail

/usr/local/etc/php.ini
Code:
sendmail_path = /usr/sbin/sendmail

As far as I know my user tables, hosts, and aliases are set up correctly. Here's a brief snapshot of my configuration:

/etc/mail/virtusertable
Code:
admin@mydomain.org	andy

/etc/mail/local-host-names
Code:
mydomain.org
localhost
admin.mydomain.org

/etc/mail/aliases
Code:
root: me
# NETWORK OPERATIONS MAILBOX NAMES
abuse:	root
# noc:		root
security:	root
admin:		root

And it isn't a firewall issue as I've opened the ports Sendmail is currently configured to listen on.

Further investigation:

$ service sendmail status
Code:
sendmail is not running.
sendmail_clientmqueue is running as pid 45547.

It would appear Sendmail is not running? I can't even start it:

Code:
# cd /etc/mail make start
# make start

Code:
Starting: sendmail554 5.3.5 /etc/mail/sendmail.cf: line 278: Unknown address family inet6 in Family=option
 sendmail-clientmqueue.

And finally but not exhaustive:

# service sendmail rcvar
Code:
# sendmail
#
sendmail_enable="YES"
#   (default: "")

# sendmail_clientmqueue
#
sendmail_enable="YES"
#   (default: "")
sendmail_msp_queue_enable="YES"
#   (default: "")

So the daemon is set to run by default.

I've got root access to my VM but little experience and even littler support.




Other stuff I've tried:

Code:
$ mail -v -s "Test email" [email]myemail@yahoo.com[/email] 
[enter]                                                              
This is a test email [enter]
. [enter]

The terminal returns:
Code:
EOT
myemail@yahoo.com... Connecting to [127.0.0.1] via relay...
myemail@yahoo.com... Deferred: Connection refused by [127.0.0.1]

I checked /var/log/maillog and I'm receiving lots of messages of this nature:
Code:
Apr 21 05:57:56 web sm-msp-queue[49019]: r3GF9iZe033456: to=root, ctladdr=root (0/0), delay=4+18:48:12, 
xdelay=00:00:00, mailer=relay, pri=28267819, relay=[127.0.0.1], dsn=4.0.0, 
stat=Deferred: Connection refused by [127.0.0.1]

Then:
Code:
# cd /etc/mail 
# make start
Starting: sendmail554 5.3.5 /etc/mail/sendmail.cf: line 278: Unknown address family inet6 in Family=option
 sendmail-clientmqueue.

Help
 
solved

It turns out the solution to this problem was:

Sendmail was not starting on my system because of an IPv6 option on line 278 of /etc/mail/sendmail.cf. So comment out that line.

That then left lots of
Code:
savemail: cannot save rejected email anywhere
messages when starting Sendmail; this was because of an alias in /etc/aliases pointing root's mail to user1, say. Solution: delete that line.

The product of all this is I am now able to send a test email out and it seems to be delivering to outside mail hosts.
 
Please, please do not edit the .cf files directly, they will be overwritten when you build the sendmail config as recommended, from the hostname.mc file. See /etc/mail/Makefile.
 
wblock@ said:
Please, please do not edit the .cf files directly, they will be overwritten when you build the sendmail config as recommended, from the hostname.mc file. See /etc/mail/Makefile.

Thanks

I'm trying to get Sendmail to accept mail from an external host myaccount@yahoo.com.

I would also like to have a couple of mailboxes on the server, admin and me say. Could you point me to a good tutorial. I'm reading the manual but not having much success. Upon trying to send mail from Yahoo to my server, Yahoo reports:
Code:
Sorry, we were unable to deliver your message to the following address.

<admin@mydomain.org>:
Remote host said: 550 5.1.1 <admin@mydomain.org>... User unknown [RCPT_TO]
 
Back
Top