View Full Version : mail() problems

10-13-2003, 09:45 AM
In moving my website and it's internal management scripts over to WestHost, I discovered on small, but severely annoying bug it seems.

mail('user@domain.com','test','testing, testing, 1, 2, 3..');

If user@domain.com is an offsite address, it works fine.. but, if it's a user@mydomain.com (domain hosted with WestHost), nothing happens.

Anyone else able to confirm this, or aware of a fix or alternative? I need this ability working as it provides the confirmation email messages for my user system.

- Joe

10-13-2003, 09:52 AM
Is the user@mydomain.com set up as an aliase or as an actual user account? I know with some other workarounds folks had to set up an actual user account.

10-13-2003, 09:56 AM
An actual account I set up. I've tested it on 3 different accounts now, as well as an alias to a local account thinking maybe I'd get a different result. Still, no luck as of yet.

10-13-2003, 10:02 AM
I also just noticed something else.. when using sendmail directly to send the message via PHP, I get the following error when sending to local addresses, whereas outside addresses send find this way as well.


From: Mail Delivery Subsystem <MAILER-DAEMON@fallen.ca>
Date: Mon Oct 13, 2003 11:58:19 AM Canada/Eastern
To: postmaster@fallen.ca
Subject: Returned mail: see transcript for details

The original message was received at Mon, 13 Oct 2003 09:58:19 -0600
from root@localhost

----- The following addresses had permanent fatal errors -----

----- Transcript of session follows -----
554 5.3.0 forward: no home
554 5.3.0 forward: no home
Reporting-MTA: dns; fallen.ca
Arrival-Date: Mon, 13 Oct 2003 09:58:19 -0600

Final-Recipient: RFC822; rjbeharriell@fallen.ca
Action: failed
Status: 5.0.0
Last-Attempt-Date: Mon, 13 Oct 2003 09:58:19 -0600

From: "Fallen Networks Int. media" <admin@fallen.ca>
Date: Mon Oct 13, 2003 11:58:19 AM Canada/Eastern
To: rjbeharriell@fallen.ca
Subject: Test Message

10-13-2003, 10:06 AM
I think it may be a "bug" There is a problem with mailing list managers like Mojo that when they send out if they get bounce back it comes into root@localhost which causes some problems. At this point I have not heard of any work arounds but I am not real familiar with this area. I have a feeling that it something WestHost is going to have to work on if it is in the capabilites of the new system. At one point a user got a response form a tech that there was no solution but I think it may have been a low level tech that might not have know the full abilities of the system.


10-13-2003, 03:00 PM

had a similar problem with formmail.pl, it wouldn't deliver to local addresses.
I ended up sending email to an address without an account or forward and it ends up in the catch-all address.

Not an ideal solution, but it works for now.

10-13-2003, 04:33 PM

So that means you have to have the catch-all activated on your account for that to work... right?

10-15-2003, 10:48 PM
Hi everyone... I have the same problem, I send mail issues to westhost and NEVER responds my mails, how I can fixed the problem??? please this is very important... =(

10-16-2003, 02:17 AM

I dunno... ;(

It just worked at that moment, I haven't had time to look into it yet and find out exactly what happened.

However, I have noticed that the local sendmail is unable to deliver mail to an alias, as it cannot find a mailbox for that user, and it doesn't seem to know anything about mail forwarding to handle aliases.
Let you know when I know more.

10-24-2003, 05:04 AM
I'm having this exact problem as well. I need to be able to send mail from the website to local accounts but it just ends up in /dead.letter and is not delivered.

Using a catch-all account doesn't seem like a good solution. I want to deliver the mail to the correct local account, not a "global" account...

Anyone found any good solution for this yet? Or should I bug the WestHost support about it? ;)

10-24-2003, 10:15 AM
OK, it seems like, on the two sites that I've had a problem, if I send the email to a POP account, it fails.
If I send the mail to an alias, then it works.

I don't unnerstand why it should be, but it seems to be the way it is.


10-25-2003, 03:40 AM
I tried using an email alias but that didn't work either...Are you using the alias to forward to a mail account outside your domain? I set it up to forward to a POP3 account in the same domain.

The error reported is:

554 5.3.0 forward: no home

I did some searching on Google on this problem and one person had this fixed by correcting the forward path. In sendmail.cf this is set to:


However, this path does not exist. Maybe this could have something to do with it? Any thoughts on this?

10-25-2003, 07:01 AM
Its true, my aliases forward to an off-site email account. It seems, from what I've seen, that neither Perl scripts, nor PHP scripts, can deliver mail locally using sendmail.

Guess that qualifies as a bug in the installation. I'll try and get around to finding out why sometime...
I've given up posting support requests for now.

The idea of setting the .forward file sounds good, let us know if it changes anything. On my installations some users do have a .forward file so I know that they do work as they should. I don't know if that will change anything in Perl/PHP mail functions.

10-26-2003, 10:37 AM
I tried fixing the ForwardPath and set it to an empty directory that I created, but it did not work.

It's a very strange problem because I can send to local POP3 accounts from the shell prompt by using sendmail directly. But it doesn't work using PHP...Very weird behavior indeed... :?

10-26-2003, 03:29 PM
Many tries, still no luck.

This is a rather disturbing problem as it pretty much cripples any PHP or CGI script that needs to access mail services, and in turn makes WestHost a *bad* choice for even the most basic web development for now.

I hope they come up with a solution for this soon, as many people need this functionality working, and without may be forced to seek services elsewhere.

10-27-2003, 11:48 AM
I think the forward: no home thing is related to the fact that aliases (and the POP3 accounts (usernames) you are using don't have a home directory assigned. I found this same problem when I was experimenting with some stuff a while back. I also found a solution: http://forums.westhost.com/phpBB2/viewtopic.php?p=6444#6444 However, what you need to consider is that these are really just warning messages and not fatal errors (even though it says "SYSERR"). If they come across with bounced mail, then you know that something else is the cause of that, not because the address/username has no home directory. Still, since you seem desparate you might like to try the solution I propose. Just be careful to read those warnings though...

10-28-2003, 12:39 AM
I've opened an official support request, lets see if there is any response on it.
And, as I'm writing this, the response has just come in from Ryan:
This is one of the quirks of the 2.0 system. To get a form to deliver mail to a local email address that email account needs to have a "home directory". Email accounts aren't created with a home directory by default but all you need to do to solve the problem is enable FTP for that user (which creates the home directory) and then disable it again if you don't want to give that user FTP access. You can enable/disable FTP in the Email/FTP Management section of Site Manager. Give that a try and your forms should be able to deliver locally now. If you have any other problems or questions just let us know.

Which is what I've tried and it works.
And that is basically what Fayez is suggesting in his link, although this way it is all done via the Site Manager.

Got the answer to my support request in a few hours. Just like the old days!

10-28-2003, 01:31 AM
Thank you FZ!

I tried your solution and it worked! Super! :D :D :D

Now I can even have different SpamAssasin configs for different mail accounts. Really nice! :)

10-28-2003, 03:12 AM

Great! I didn't realize that enabling FTP and then disabling it kept the home directory. I guess that makes my solution a little redundant ;) Anyway, glad to hear that you guys got it working.



I'm glad it worked :) You might want to use jalal's method from now on though, it's "safer".