Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: bosco555 on November 02, 2011, 11:29:25 PM

Title: Unable to receive mail sent from a form on a webpage
Post by: bosco555 on November 02, 2011, 11:29:25 PM
Hi All,
I am having a lot of trouble receiving mail sent from a php form on web pages.  The form sends the data collected to say, user@domain.com who is a legitimate user on the SME box. 

Because the sender and the destination email addresses are the same, I think SME sees it as spam and drops it altogether..

I have tried with a yahoo account and it works fine.

The SME box is in server only mode with dansguardian and dspam contribs.  The rest is stock standard..

Any help would be appreciated

thanks
GB
Title: Re: Unable to receive mail sent from a form on a webpage
Post by: cactus on November 03, 2011, 06:53:43 AM
Because the sender and the destination email addresses are the same, I think SME sees it as spam and drops it altogether..
I doubt that is the reason. You should check the log files especially the files in /var/log/qpsmtpd/, this might gice you some clues. Perhaps dspam also logs something, but I am unfamiliar with that.

I am not sure what code or classes you are using to send mail. Are you properly handling errors in your code? I would think that if a message is not queued an error might be returned.
Title: Re: Unable to receive mail sent from a form on a webpage
Post by: bosco555 on November 03, 2011, 07:00:44 AM
Hi Cactus and thanks for the reply..

This is a client's machine, but will check the logs as soon as I can.
I use a WYSIWYG web site builder which has php form builder and functionality.  As the form data is sent successfully to my yahoo address, I can only deduce that there is something on the sme box..

Will check the logs and report back

thanks again

gb
Title: Re: Unable to receive mail sent from a form on a webpage
Post by: Jáder on November 03, 2011, 11:11:17 PM
My bet would be a malformed / incomplete header... without date is the most common problem.
Open the message sent to yahoo account and verify if it's complete as requested on RFC.

Jáder
Title: Re: Unable to receive mail sent from a form on a webpage
Post by: faeky on November 10, 2011, 02:42:38 AM
I had this problem too.  It turns out the sendmail program is configured a little differently now.

Add
Quote
sendmail_path                          = "/usr/sbin/sendmail -t -i"
to your php.ini custom template file, expand the template, reload httpd, and that should fix your problem.
Title: Re: Unable to receive mail sent from a form on a webpage
Post by: sal1504 on August 23, 2012, 02:34:49 AM
faeky

just saw your post and tried your solution. it did not work, but i probably messed up changing the php.ini. Could you give me the exact commands to change the php. I am also having issues sending email from a php script.

Sal
Title: Re: Unable to receive mail sent from a form on a webpage
Post by: faeky on August 23, 2012, 04:27:01 AM
faeky

just saw your post and tried your solution. it did not work, but i probably messed up changing the php.ini. Could you give me the exact commands to change the php. I am also having issues sending email from a php script.

Sal

do this
cp /etc/e-smith/templates/php.ini/80ModulesSettings02mailfunction /etc/e-smith/templates-custom/etc/php.ini
pico /etc/e-smith/templates-custom/etc/php.ini/80ModuleSettings02mailfunction

add the line
sendmail_path                          = "/usr/sbin/sendmail -t -i"

so that the files looks like
[mail function]
sendmail_path                          = "/usr/sbin/sendmail -t -i"
SMTP                                   = localhost
sendmail_from                          = me@localhost.com

run
/sbin/e-smith/expand-template /etc/php.ini
/etc/init.d/httpd reload

Try sending email from the form.  If it doesn't work you have a different issue.
Title: Re: Unable to receive mail sent from a form on a webpage
Post by: sal1504 on August 23, 2012, 05:27:28 AM
faeky

thanks for the quick response. i will give it a try in the morning. thanks again

sal
Title: Re: Unable to receive mail sent from a form on a webpage
Post by: bosco555 on August 30, 2012, 02:10:05 AM
Hi all,
just a quick correction if I may...
it should read:
cp /etc/e-smith/templates/etc/php.ini/80ModuleSettings02mailfunction /etc/e-smith/templates-custom/etc/php.ini/

the rest should be fine..

best to all
gb