Sendmail in Mac OS X stops working (often)

I have this problem that keeps coming out every now and then. For a while my mailserver works without problems, than it stops working. My php.ini file is configured correctly, the sendmail lines are commented out. This time I also reinserted the line MAILSERVER=-YES- in /etc/hostconfig. I am still not able to send email with PHP.

Do you have any ideas why this is happening? I use MAMP, if this can be useful in finding a solution.

Well I don’t know exactly what you are trying to do here, but there is a known bug in OSX mail. I can’t remember much about it but I had problems for a LONG time and it kept my hosting company busy for a while trying to figure out what the h*** was wrong. Turned out it was a known bug in Mail all along. Fixing it just involved completely DELETING the account in Mail and re-creating it from scratch.

It could be the same thing. You never know.

I wasn’t trying to send mail through it via a script, it was just a mysterious problem.

I also repeatedly lose the connection to the server in Mail. Apparently this was down to settings that didn’t allow very frequent checking of incoming mail. It might be worth checking any relevant settings you have in apache (seeing as it’s your own server) just in case it’s cutting Mail off for sending emails too often.

I used to use my mac as a server, but nowadays I just use a hosting company. Everything got too complicated now we have several computers on wifi using one router. Used to be able to have a whole website on there. Probably still some way around the multiple-computer problem but I’m not that geeky.

EDIT: PS it seems very likely it’s something to do with Mail itself or Apache if your script is working sometimes and then stopping. Could be something else like a weird loop that kills it once in a while but eliminate the obvious before you assume your code is borked.

I thought tha this could be a bug… I think I could continue the development on a Linux machine for a while, unti I’m done working with email scripts…

that’s one possibility I suppose, and if it gets rid of the strange behaviour you will know it’s something to do with Mail.

On the other hand, it was a fairly simple bug to fix. It did take a lot of digging about in the apple forums to find it though - it’s quite obscure.
Asking in the Apple forums might help - especially if they have a dev forum. I expect they must, as there’s a whole apple dev community.

PS Mail still often loses its connection to my mail server, but it’s temporary. Like I said this has something to do with settings on the server which are supposed to be an anti-spam measure. It’s worth checking that’s not what’s happening here.

It’s a pity that this bug exists, because Mac OS is my favourite development platform, and having to lose time for things like these makes me move to Linux, even if temporarily.