Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC emails to gmail accounts are lost


inra311

Recommended Posts

Generally sending emails from OSC 2.3.4 BS Edge (e.g. order confirmations, or from the send email option in the admin, from tell a friend,..) works fine here with most receivers. However, it seems that it does not work  when the receiver has a gmail account (verified for two customers at least but problems with certain other mail providers might be possible, too)

.

There is no error message (at least nothing that  I can see, the shop is on a shared host) , no bounced mail, OSC says it was sent but it never arrives, neither in the customer's mail folder nor in his spam folder. Just diappearing.

 

I have tried both sendmail and SMTP which did not change anything. Emails sent from Thunderbird with the shop email address arrive without any problems! I also tried to change the shop email address but this did not help.

 

 

I have no idea why this is.

 

 

Would you rather think this .

 

..  is because I am on some blacklist at google (I am not aware of being hacked or that spam was sent from my shop)

 

..  is a problem with mails being not authenticated.

 

..has to do with this hint from some old thread found here: 'its problem with your server as you need to setup the spf records in DNS'

 

???

 

In case of the second option, is there any easy to install addon that enables SMTP with authentication? I tried what was suggested somewhere: copying in two class files from a php mailer, and adding  some code in the two email.php files of OSC but I could not get it running.

 

Thanks for any help

 

 

Link to comment
Share on other sites

@@inra311  Ingo, I don't know if this got sorted out in EDGE or not but have a look at this thread.

 

http://www.oscommerce.com/forums/topic/397929-email-return-path/

Link to comment
Share on other sites

Thanks for your answer, Dan.

 

When I examine a mail from my shop that was successfully sent to myself, I see:

X-Envelope-From: <postmasterxxxxxx@[member=Post].webmailer.de>X-Envelope-To: <XXX receiver's email addressXXX>X-Delivery-Time: xxxX-UID: xxxReturn-Path: <postmasterxxxxx@[member=Post].webmailerXXX>Authentication-Results: xxxto.com 1;	spf=none		smtp.mailfrom="postmasterxxxxx@[member=Post].webmailerXXX";	dkim=none;	domainkeys=none;	dkim-adsp=none		header.from="[email protected]"

Seems like the return path does not match the from email, right?

 

So you suggest that some ISP reject emails where these do not match?

 

Sounds logical... ehem, where do I specify the return path for OSC mails??

Link to comment
Share on other sites

Well, I find:

 

Under catalog/includes/functions/general.php file find the function tep_mail and scroll down until you find the line that reads:

$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);

and change it to read

$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject,'Return-Path: <' . $from_email_address . '>');

Do the same thing in the catalog/admin/includes/functions/general.php file.

 

 

 

 

Will try this...

Link to comment
Share on other sites

I implemented the return path but this does not change anything: the return path in the email still says postmasterxxxxxx... instead of [email protected]

 

In the email sent via the shop email account from Thunderbird, the one that arrives at the gmail account, return path and from email are identical!

 

I guess this might in fact be the culprit but no idea how to force it to the right return path??

Link to comment
Share on other sites

You'll need to pin down the php page where the email is being generated....you should see something like this...

 

// $mimemessage = new email(array('X-Mailer: osCommerce System Mailer'));

 

which will need to be changed as follows.

$mimemessage = new email(array('X-Mailer: osCommerce System Mailer','Return-Path: <' . STORE_OWNER_EMAIL_ADDRESS . '>'));

 

Did you see anything like that?

 

Dan

Link to comment
Share on other sites

I finally got it resolved:

 

I first found this in the history of the addon from the thread you linked to:

 

problem involves servers with safe_mode = on and not using 5th field in mail() function

1) server must have safe_mode = OFF in order to use 5th parameter in mail()
2) open /class/email.php

FIND:

return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));

REPLACE WITH:

$params = "-f$from_addr";
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers), $params);

 

Safe mode is ON on my shared host, I tried to disable it with a php.ini but this did not work. I then found that safe mode is deprecated and might be ignored by PHP meanwhile, so I tried the code change anyway.

 

This had the effect that in fact the return path was the same as the from address (however, only with sendmail, not with SMTP). I then sent a mail to the test customer that I created with my son's gmail address, and for the first time the mail did not simply disappear but bounced! From the error message I then found that the email address had in fact a mistake (oh stupid me!!!, my sons's name with his birthday but it must be without the month... I looked at this a dozen times before... how stupid)

 

I did not hear from my 'real' customer with gmail who complained that he did not receive my OSC emails. Possibly he in fact has an issue, or it is in his spam folder, or something.

 

I can conclude now:

 

- I never got bounced mails in case of mistakes as the return path is not set in OSC. This can (and should!?) be fixed.

- Safe mode on the server is not required for this fix.

- it only works with sendmail in OSC, not with SMTP (but I guess there is a quick and similar fix for SMTP)

 

Thank you very much for your help. Your advise to look at the return path was the right hint. I must say that it makes me feel much safer to know that now I get a bounced mail and do not have to wonder if a customer gets my mails or not.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...