PDA

View Full Version : Sendmail not sending?



fielder
12-18-2006, 09:24 AM
I'm trying to set up a simple script to process a form for a classmate with an account here.

I've used the same script on several different hosting servers with no problem. The form and script seem to be working flawlessly, but no mail is delivered. I tested the exact same script on other hosting accounts and it works fine, so it's not the script. I don't get any errors, unless I mess something up on purpose.

All seems to be working properly, just no mail. There's no need to activate Sendmail or something like that, right?

HELP!

p.s., also I get an error when I try to use.... "use CGI::Carp qw(warningsToBrowser fatalsToBrowser);"

wildjokerdesign
12-18-2006, 12:38 PM
Check for a deadletter file in your account root directory. Is the mail there? Did you set up the user that you are trying to send to via your Site Manager? Check in the scripts configuration files for paths to sendmail.
WH Paths (http://members.westhost.com/software-paths.html)

fielder
12-19-2006, 07:25 AM
I didn't find a deadletter file anywhere.

Not sure what you mean about setting up the recipient in Site Manager.

Do I need to update to the newer version of perl? Do I need FastCGI installed? I've never encountered these problems with other hosting servers.

wildjokerdesign
12-19-2006, 07:39 AM
It is hard to know what you may need without knowing what the script is. Where did the script come from or is it something you coded? FastCGI should not be a requirement to get something to work.

When I asked about setting up the reciepient in Site Manager I ment did you log in and create an Email/FTP account for them.

Do you know what version of perl the other hosting company was running?

wildjokerdesign
12-19-2006, 08:16 AM
I just realized I did not answer your question about CGI::Carp (http://search.cpan.org/dist/CGI.pm/CGI/Carp.pm). I don't think that module is installed by default on the VPS but you can add modules manually. You do need to install the GNU Compiler Collection (http://members.westhost.com/sm_sa_development_gnu.html) that is available in Site Applications under Developement. If you have never installed a module this page (http://www.cpan.org/modules/INSTALL.html) may help.

fielder
12-19-2006, 12:57 PM
My script is pretty simple, almost identical to the first one linked on this page: http://scripts.cgi101.com/

I even substituted the script with the one I just linked, removing "Carp". Everything appears to be working normal, I get my thank you page and all, just no delivery of the email. I can even link the same form to the exact same script at an external host and it works perfectly (with email delivery).

Is there something in that script that won't work for this host server?

I've used it on sites hosted at GoDaddy, Startlogic, and Gate. All using Perl 5.6.

Thanks for your help, but I'm about to give up and just suggest an alternate host for my friend, or maybe just link to one of my cgi folders on a different host.

jalal
12-19-2006, 02:03 PM
The important question was whether you have setup the account through Site Manager or not. Put another way, is it a real email account with a home directory or is it an alias or what...?
The fact that you used another script and get the same result indicates that you have something not correct with your email setup.

fielder
12-19-2006, 02:51 PM
I'm testing the script by sending the results to an email address which is completely unrelated to the account itself.

Is there something that needs to be set up in Site Manager to allow sendmail to send data? I don't have anything set up in the email accounts. Do I need to activate sendmail in some way?

I can receive mail no problem, even with the same script on other hosting servers. I've tried different email addresses also with the same result.

wildjokerdesign
12-19-2006, 03:48 PM
I'm testing the script by sending the results to an email address which is completely unrelated to the account itself.

Then I doubt it has anything to do with the script. :) Well almost. More then likely the email account you are sending the results to is somehow marking it as spam and sending it to a junk folder or something.

Also it is still possible that your paths are not set right. You never answered if you had checked your paths to Sendmail. Looking at the script you refreneced there if you left them as they have them you should be ok but not sure if you had changed them for other accounts.

I would suggest not useing the script. It is not very secure. There is the FormMail that WH offers or the alternatives at NMS Project (http://nms-cgi.sourceforge.net/).

wildjokerdesign
12-19-2006, 03:50 PM
Is there something that needs to be set up in Site Manager to allow sendmail to send data? I don't have anything set up in the email accounts. Do I need to activate sendmail in some way?
No there is nothing that needs to be activated. All you would need to do is create an Email/FTP account if you wanted to recieve mail for some user.

rolling
12-19-2006, 06:43 PM
The script you linked to prints various lines to a file and then pipes this through sendmail.

If you want to troubleshoot then I recommend that you create a sample message file and submit this using sendmail. For example cat msg.txt | /usr/lib/sendmail -t

Also, you can modify the LogLevel in /etc/mail/sendmail.cf (temporarily - it will be overwritten if Westhost rebuild it as they sometimes do) and then check /var/log/maillog for any errors that sendmail is logging. As a convention, LogLevels less than 10 are considered useful, although LogLevel=15 will log ALL incoming and outgoing SMTP commands. If you want to find out how Sendmail works, download the operator's manual (PDF) (http://www.sendmail.org/doc/sendmail-current/doc/op/op.pdf)

fielder
12-21-2006, 11:23 AM
My paths are correct.

I've tried several things...even using the WH formmail script & app. Same thing happens, I get the confirmation screen but no email delivered anywhere.

I checked the maillog and this is all that's there:
Dec 18 21:57:00 myhost.com sendmail[9754]: starting daemon (8.11.6): SMTP

Also, no errors related in the error log.


If you want to troubleshoot then I recommend that you create a sample message file and submit this using sendmail. For example cat msg.txt | /usr/lib/sendmail -t

How exactly do I do this? Through a program like putty? I've just been using ftp and site manager to this point.

I want this to work, but I'm not crazy about reading 100+ pages about how sendmail works. It should just work.

wildjokerdesign
12-21-2006, 12:17 PM
Ok if the same thing is happening with the provided WestHost FormMail then it must be something to do with the email account you are trying to send the message to. You might want to try a different email account to send the data to. Creat an email/ftp account via your SiteManager and try sending to that account.

grizzly
04-13-2007, 10:55 PM
fielder,

Did you ever get this resolved? I have the same problem. I modified my script to write to a file and then I try the 'cat' suggested above and everything works fine. I wonder if it is a permissions or path problem?

Don't scripts run as 'nobody'?

Grizzly

wildjokerdesign
04-14-2007, 09:27 AM
Don't scripts run as 'nobody'?

No not on a WH VPS. They normally run as your main user for your account.

unata
04-25-2007, 11:40 AM
Same thing here, tried to use 2 PHP formmail scripts - nothing ever gets sent. Also tried 3 different email addresses on this server and will try a different server today.

rolling
04-26-2007, 04:29 PM
I checked the maillog and this is all that's there:
Dec 18 21:57:00 myhost.com sendmail[9754]: starting daemon (8.11.6): SMTP

Also, no errors related in the error log.
Then I suspect that your script is not calling sendmail for some reason. Check that it uses the full path when calling sendmail.




If you want to troubleshoot then I recommend that you create a sample message file and submit this using sendmail. For example cat msg.txt | /usr/lib/sendmail -t

How exactly do I do this?
Save the following as msg.txt on your server. Replace the obvious stuff!

From: "Myself" <me@mydomain.com>
To: "My Test account" <me@AnotherDomain.com>
Subject: Testing Sendmail
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

This is a test for sendmail
and then use PuTTY to connect to your server. Change to the directory where you saved the file and do the cat msg.txt | /usr/lib/sendmail -t bit.


Same thing here So many possibilities.... Are you sure your scripts are running? Which scripts, where have you saved them, what URL are you using to access them? Have you configured the scripts correctly? etc. etc. Give us a bit more to go on, or try LiveHelp (http://members.westhost.com/contactus.html)