mail() function stopped working????

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bg
Forum Contributor
Posts: 157
Joined: Fri Sep 12, 2003 11:01 am

mail() function stopped working????

Post by bg »

I run a freebsd server w/ apache 2. It hosts many websites with php scripts using the mail() function. Just recently and unexpectidly, the mail() function in those scripts has stopped working. I had not made any changes to the server since it was working. I restarted it and had the same problem. If anyone knows what the problem may be, please help. No errors are produced.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Check the mail log (usually /var/log/mail.log) as you send an email from PHP. If it doesn't get as far as the mail log then it's probably a PHP problem, if it does then it's a sendmail/whatever problem and the log should shed some light on it.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Maybe sendmail didnt start up correctly when you restarted. Do a ps -aux to see if its running.
bg
Forum Contributor
Posts: 157
Joined: Fri Sep 12, 2003 11:01 am

Post by bg »

Awsome, you guys are moving me in the right direction. I checked the mail log and came up with this:
Jan 16 00:00:01 bsdweb sendmail[2565]: i0G601BX002565: low on space (SMTP-DAEMON needs 296 bytes + 100 blocks in /var/spool/clientmqueue), max avail:
Jan 16 00:00:01 bsdweb sendmail[2565]: i0G601BX002565: from=root, size=775, class=0, nrcpts=1, msgid=<200401160600.i0G601BX002565@bsdweb.pcllca.net>,
Jan 16 00:00:01 bsdweb sendmail[2565]: i0G601BY002565: low on space (SMTP-DAEMON needs 0 bytes + 100 blocks in /var/spool/clientmqueue), max avail: 0
etc, etc. So anyway, ive ran out of memory somewhere... I tried deleting all files in the directory but still get the same error. I checked the free space on that mount--257998 kB / Free -1136 kB. I dont know why its so little... help would be appreciated
[/quote]
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Looks like /var is filling/filled up to me, what does a 'df -h' show on /var ?
Might just be as simple as needing to remove some junk, or some user having huge amounts of email :o
bg
Forum Contributor
Posts: 157
Joined: Fri Sep 12, 2003 11:01 am

Post by bg »

well, found out my problem. I had a cron job that was running every minute producing bad emails... in the var/email dir there was a file for root that grew to over 200mb. Anyway, thanks for the help.
Post Reply