Page 1 of 1
mail() function stopped working????
Posted: Fri Jan 16, 2004 9:11 am
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.
Posted: Fri Jan 16, 2004 9:15 am
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.
Posted: Fri Jan 16, 2004 9:17 am
by kettle_drum
Maybe sendmail didnt start up correctly when you restarted. Do a ps -aux to see if its running.
Posted: Fri Jan 16, 2004 9:39 am
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]
Posted: Fri Jan 16, 2004 9:44 am
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

Posted: Fri Jan 16, 2004 9:48 am
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.