uc_store_email_from adresse format

Project:Ubercart Contributions
Component:Code
Category:
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

I had problems with not receiving notifications from UC.

It appears this is a problem with address returned by uc_store_email_from().

uc_store_email_from returns an address in the format :

Shop name<email@shop.com>

Thus, the mail is transmitted by PHP to mail server with

MAIL FROM:<Shop name<email@shop.com>

This format is not compliant with RFC 2821 and messages are rejected by some servers.

I suggest to modify uc_store_email_from to only return a raw email address :

  $email_from = variable_get('uc_store_email', '');
  if (empty($email_from)) {
    $email_from = variable_get('site_mail', ini_get('sendmail_from'));
  }

  return $email_from;

Frederic

Version: 
rc
TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: uc_store_email_from adresse format

Nice catch - I know a few people have mentioned a similar problem, but that sort of thing is really hard to diagnose because, as you said, the messages are rejected only by "some servers". (Not mine apparently - I was unable to reproduce this!).

Bumping this so Ryan sees it... Smiling

<tr>.
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Wonderful. I'm glad I
Assigned to:TR» Ryan

Wonderful. Laughing out loud I'm glad I don't have to beat my head on the desk coming up with a solution. Thanks a lot for posting this up... will try to get it in on Monday.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Wonderful. I'm glad I

Ok, I committed a fix. I actually just commented out the code instead of removing it, as it would be great to revisit this in the future to figure out how to make it work for all servers (or at least give the option for folks to use it if possible).

affinity's picture
Offline
Joined: 08/22/2008
Juice: 39
Still not working?
Assigned to:Ryan» affinity

I checked the code on uc_store.module and it matches the code above, but I am still not receiving admin notifications. I have double checked all the settings, and included several different emails, but still no admin notifications. The customer notifications arrive okay, even to the same email address as the admin notifications.

I'm puzzled, any insights?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Still not working?
Assigned to:affinity» Ryan

What version of UC are you on?

affinity's picture
Offline
Joined: 08/22/2008
Juice: 39
Fixed...thanks
Assigned to:Ryan» affinity

I fixed the problem - I was using FCK Editor on the admin email address text area. Once I switched this off, the emails starting coming through.