@mail does not produce email on localhost

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
orbdrums
Forum Commoner
Posts: 82
Joined: Wed Sep 14, 2011 11:42 pm

@mail does not produce email on localhost

Post by orbdrums »

Although the @mail command produces email on my hosted site, it does not send mail from my localhost. Any suggestions about what and where to check if the mail doesn't send? I appreciate the help.
Thanks!
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: @mail does not produce email on localhost

Post by Celauran »

I'd start by removing the @ as all that does is suppress errors, which is rather unhelpful right now. What mail server do you have running? Have you checked its error logs?
orbdrums
Forum Commoner
Posts: 82
Joined: Wed Sep 14, 2011 11:42 pm

Re: @mail does not produce email on localhost

Post by orbdrums »

Thank you for the reply. I'm running postfix on OSX 10.6.8 Snow Leopard. It appears that when attempting to connect to any mail server, the operation times out. Here are the latest mail log entries:

Aug 23 15:06:54 x-Macbook postfix/qmgr[9567]: 0F43593ACEB: from=<test@x-Macbook.local>, size=712, nrcpt=1 (queue active)
Aug 23 15:07:54 x-Macbook postfix/smtp[9929]: connect to smtp.east.cox.net[68.1.17.3]:25: Operation timed out
Aug 23 15:07:54 x-Macbook postfix/smtp[9929]: 0F43593ACEB: to=<test@cox.net>, relay=none, delay=511, delays=450/0.28/60/0, dsn=4.4.1, status=deferred (connect to smtp.east.cox.net[68.1.17.3]:25: Operation timed out)

When I telnet to postfix port 25, it connects as expected.

If I'm connected to my ISP SMTP server, do I need to use postfix? Sorry if this sounds new but this is my first time attempting mail through my website.

Thanks.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: @mail does not produce email on localhost

Post by Celauran »

So your Postfix install is connecting to your ISP's SMTP server? Doesn't sound like a PHP problem at all, then. Try removing PHP from the equation, say by sending an email from Mail.app or whatever using your local Postfix install for sending, and see if the problem persists.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: @mail does not produce email on localhost

Post by Celauran »

I also noticed that you're trying to connect on port 25. What if you use 587 instead? (For the connection to your ISP's SMTP server, I mean)
orbdrums
Forum Commoner
Posts: 82
Joined: Wed Sep 14, 2011 11:42 pm

Re: @mail does not produce email on localhost

Post by orbdrums »

I'm not sure what happened to my last post but it must have landed in the bit bucket. Anyway, I can send mail from both my hosted (Network Solutions) SMTP and my ISP SMTP servers.
Here is the latest mail log entries when using "sendmail" in terminal:
Aug 23 16:29:42 x-Macbook postfix/master[12721]: fatal: open lock file pid/master.pid: unable to set exclusive lock: Resource temporarily unavailable
Aug 23 16:29:52 x-Macbook postfix/master[12728]: fatal: open lock file pid/master.pid: unable to set exclusive lock: Resource temporarily unavailable
Aug 23 16:30:02 x-Macbook postfix/master[12734]: fatal: open lock file pid/master.pid: unable to set exclusive lock: Resource temporarily unavailable
Aug 23 16:30:12 x-Macbook postfix/master[12745]: fatal: open lock file pid/master.pid: unable to set exclusive lock: Resource temporarily unavailable
Aug 23 16:30:22 x-Macbook postfix/master[12757]: fatal: open lock file pid/master.pid: unable to set exclusive lock: Resource temporarily unavailable
Aug 23 16:30:32 x-Macbook postfix/master[12766]: fatal: open lock file pid/master.pid: unable to set exclusive lock: Resource temporarily unavailable
Aug 23 16:30:42 x-Macbook postfix/master[12772]: fatal: open lock file pid/master.pid: unable to set exclusive lock: Resource temporarily unavailable

My queue has all the emails I've created with PHP, however it appears they're sitting there because of the problem listed in the mail log. I'll try searching for that error message.
Post Reply