Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Getting Email to workon localhost with XAMPP Mercury and OSC


matta

Recommended Posts

Posted

Hi Folks,

 

I've searched and searched, but can't find any definitive answers to how to set up email with OSC and Mercury Mail that comes with XAMPP (www.ApacheFriends.org).

 

Here's what I've done so far.

 

1) Install XAMPP (so easy!).

run Apache

run MySQL

run Mercury Mail

 

2) Configure several local users in Mercury:

1

2

3 ... etc.

Turn off Mercury HTTP server (so it doesn't collide with Apache. Didn't for me, but just in case)

 

3) Set up Thunderbird accounts for each user.

Use 2@localhost etc. as IMAP email address (Mercury automatically maps "localhost.com" to localhost.)

SMTP Server = Default localhost

 

4) Install virgin OSC 2.2 RC2a

Configuration > My Store shows:

Store Name OSC4

Store Owner Owner

E-Mail Address [email protected]

E-Mail From "Owner" <[email protected]>

Email type: SMTP

 

[An aside: Does anyone know why "Email From" even exists or where it's used? Seems you only need "Store Owner" and "Email Address" and you could build the redundant "Email From" value.]

 

Note: OSC will only recognize the common domain TLD's (com, net, org, etc) unless you edit both catalog\tld.txt and Mercury Configuration > Mercury Core Module Configuration > Local Domains.

Then you can use localhost.local or localhost.test or whatever in OSC and Thunderbird.

 

OK, now starts the strangeness.

 

1) I create a user in OSC and a confirmation email is sent, but fails in Mercury:

Wed 01, 18:22:04: Job MG00006B: sender address ' <[email protected]' is invalid
Wed 01, 18:22:05: Job MG00006B: Processing failed deliveries and generating notifications
Wed 01, 18:22:16: Job MG00006D: from <> (local)
  * Recipient <"Owner" <[email protected]>> unknown

 

Note that it stripped the trailing ">" from the sender address, and then bracketed the return address with extra set of "< >".

 

From Admin>Tools>Send Email I can send an email to a user but if fails in Mercury the same way.

 

2) I found what purported to be a fix in this thread. If I edit catalog\admin\includes\classes\email.php ~ line 495 and remove the "<" and ">" I get the exact same error.

 

3) If I change the "<" and ">" to "(" and ")", I still get errors.

 

4) If I delete Configuration>MyStore>"Email From", I still get errors when the confirmation email is sent. Except now the Tools>Send Email "From" field is blank. Emails are sent through now, but there's no return address at all (at least it's not corrupt).

 

5) If I manually type in a "From" address in the Tools>Send Email field (say [email protected]), it goes through.

 

6) If I try to enter the "accepted" format of Owner <[email protected]>, then it fails again:

Wed 01, 18:43:00: Job MG000085: sender address 'Owner <[email protected]' is invalid

 

It appears that the extra "< >" brackets are giving OSC and Mercury fits, but I can't find out where the extra set is inserted.

 

Can anyone help?

 

THANKS

Posted

Within Thunderbird, I can email between accounts all day long (4@localhost, 6@localhost, etc). It's just when OSC tries to email that it puts extra brackets around the address and trips up Mercury.

 

Just to be sure, I created 2 new accounts, [email protected] and [email protected]. I can easily send mail and reply to each other through Thunderbird.

 

I changed the store owner's email address to [email protected]. I then create a new OSC account for [email protected].

 

Again, the send fails with wacky bracketing:

Thu 02, 14:51:53: Job MG00000A: sender address ' <[email protected]' is invalid
Thu 02, 14:51:53: Job MG00000A: Processing failed deliveries and generating notifications
Thu 02, 14:52:04: Job MG00000C: from <> (local)
  * Recipient <"Owner" <[email protected]>> unknown

 

Any thoughts on where these brackets are getting inserted?

 

Thanks

Posted

Within Thunderbird, I can email between accounts all day long (4@localhost, 6@localhost, etc). It's just when OSC tries to email that it puts extra brackets around the address and trips up Mercury.

 

Just to be sure, I created 2 new accounts, [email protected] and [email protected]. I can easily send mail and reply to each other through Thunderbird.

 

I changed the store owner's email address to [email protected]. I then create a new OSC account for [email protected].

 

Again, the send fails with wacky bracketing:

Thu 02, 14:51:53: Job MG00000A: sender address ' <[email protected]' is invalid
Thu 02, 14:51:53: Job MG00000A: Processing failed deliveries and generating notifications
Thu 02, 14:52:04: Job MG00000C: from <> (local)
  * Recipient <"Owner" <[email protected]>> unknown

 

Any thoughts on where these brackets are getting inserted?

 

Thanks

No, but the next thing I would try is a FQDN

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Posted

I did some more testing by changing line ~495 of catalog\admin\includes\classes\email.php.

 

Original:

$from = (($from_name != '') ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr);

This produces: "Owner" <[email protected]>

Errors from Mercury:

Thu 02, 14:51:53: Job MG00000A: sender address ' <[email protected]' is invalid
  * Recipient <"Owner" <[email protected]>> unknown

 

Other tries and results:

1) // Only use address. Works

$from = (($from_name != '') ? $from_addr : $from_addr); 

Produces: [email protected]

 

2) // No quotes, no brackets. Sender address is invalid with name and space before address, same with reply to.

$from = (($from_name != '') ? $from_name . ' ' . $from_addr : $from_addr); 

Produces: Owner [email protected]

Errors from Mercury:

Thu 02, 16:04:41: Job MG000018: sender address 'Owner <[email protected]' is invalid
  * Recipient <Owner <[email protected]>> unknown

 

3) //No brackets. Works to send, but reply to is currupted by quotes.

$from = (($from_name != '') ? '"' . $from_name . '" ' . $from_addr  : $from_addr); 

Produces: "Owner" [email protected]

Errors from Mercury:

Thu 02, 16:08:32: Job MG000020: from  [email protected] (local)
  To: 6 (local) -OK
  * Recipient <""\"\"""@localhost.test> unknown
[/Code]

4) // Move brackets outboard of quotes. Same as original fail.[code]$from = (($from_name != '') ? '<"' . $from_name . '" ' . $from_addr . '>' : $from_addr); 

Produces: <"Owner" [email protected]>

Errors from Mercury:

Thu 02, 16:12:45: Job MG000024: sender address '< [email protected]' is invalid
  * Recipient <<"Owner" [email protected]>> unknown

 

So, it appears that OSC is parsing the $from string. If it finds quotes or brackets it attempts to properly divide up the string to make a valid Reply To string, but is getting corrupted. Anyone have an idea where this happens?

  • 4 months later...
Posted

Well, looks like this whole problem has gone away with OSC 2.3.1 and XAMPP 1.7.3 (from apachefriends.org). Everything works as expected.

Archived

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

×
×
  • Create New...