Koozali.org: home of the SME Server

Unable to receive mail sent from a form on a webpage

Offline bosco555

  • *****
  • 152
  • +0/-0
Unable to receive mail sent from a form on a webpage
« 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

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Unable to receive mail sent from a form on a webpage
« Reply #1 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.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline bosco555

  • *****
  • 152
  • +0/-0
Re: Unable to receive mail sent from a form on a webpage
« Reply #2 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

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Unable to receive mail sent from a form on a webpage
« Reply #3 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
...

Offline faeky

  • *
  • 5
  • +0/-0
Re: Unable to receive mail sent from a form on a webpage
« Reply #4 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.
« Last Edit: November 10, 2011, 02:47:00 AM by faeky »

Offline sal1504

  • ****
  • 149
  • +0/-0
Re: Unable to receive mail sent from a form on a webpage
« Reply #5 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

Offline faeky

  • *
  • 5
  • +0/-0
Re: Unable to receive mail sent from a form on a webpage
« Reply #6 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.

Offline sal1504

  • ****
  • 149
  • +0/-0
Re: Unable to receive mail sent from a form on a webpage
« Reply #7 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

Offline bosco555

  • *****
  • 152
  • +0/-0
Re: Unable to receive mail sent from a form on a webpage
« Reply #8 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