Thursday, August 25, 2005

Zen Cart email woes with Postfix MTA

I've been working on setting up a Zen Cart shopping cart on my companies web server.

The installation was easy, however I've been having trouble with the formatting of the emails sent from the shopping cart to my test customer accounts and the emails sent to my admin email account.

The emails are supposed to show up as HTML emails, instead they show up as text with all the HTML code in the body of the email. If I change to Text only emails, the body of the email doesn't have any line breaks.

Here's a sample

Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit
Order Confirmation from My Store John Doe Thanks for shopping with us today! The following are the details of your order.
------------------------------------------------------ Order Number: 8 Date Ordered: Tuesday 23 August, 2005 Detailed Invoice: https://www.mystore.com/catalog/index.php?m...info&order_id=8 Please ship it -1 day air! Well, it's not here yet.
I couldn't find any love on the Zen Cart site, although I did get someone who responded with "I'm having the same problem".

I google'd around and came across this page on Php.net, and this particular entry:
php at richardneill dot org
12-Jul-2004 07:09
Postfix under Mandrake 10.0 also objects to \\r\\n. The result is that every email is double-spaced, and all attachments break. (it was OK in 9.1). My (short-term) fix is this:

$message = str_replace("\r",'',$message);

This discussion may be relevant:
http://www.phpdiscuss.com/article.php?id=60615&group=php.bugs
So, I started grep'n and found this file: $wwwroot/catalog/includes/classes/email.php

I made the following change to the sendmail portion of the code (the comments are the original code):

if (EMAIL_FRIENDLY_ERRORS=='true') {
//return @mail($to, $subject, preg_replace("#(?<!\r)\n#s","\r\n", $this->output), $headers_list);
return @mail($to, $subject, preg_replace("#(?<!\r)\n#s","\n", $this->output), $headers_list);
} else {
//return mail($to, $subject, preg_replace("#(?<!\r)\n#s","\r\n", $this->output), $headers_list);
return mail($to, $subject, preg_replace("#(?<!\r)\n#s","\n", $this->output), $headers_list);
}
Notice that I simply replaced "\r\n" with "\n".

Preliminary tests have shown that this change has fixed the problem with the HTML and Plain Text emails.

Wednesday, November 03, 2004

The day after

Wow, what a night.
I went home from work last night all bummed out. I'd heard reports from the exit polls in Ohio and Florida, and they didn't sound good for W.

Fast forward several hours, Bush ended up winning Florida by 300,000 or so votes, and Ohio by 120,000 or so votes. The exit polls had kerry winning those states by a landslide, so much for "exit polls".

My liberal neighbor had a ton of people over at her house for some sort of liberal weenie Kerry party. Fox News announce that Florida and Ohio went to Bush. I decided to go outside and listen to the screams of anguish from all the libs at the party, sure enough, they were bawling, breaking stuff, and just going crazy.

I had a good laugh, went back into the house, popped open a beer and celebrated a hard fought Bush victory.

Tuesday, November 02, 2004

Voting Day

Well, today's the day. Will we continue to stay the course or will we surrender our soverenty to u.n. ? If Kerry wins, you can bank on it. He's so consumed with appeasing the "global community", so get ready for 4 years of the world first, us second.

It's gonna be a tight race, I just hope we know who won by tomorrow, but I'm sure the lawyers are going to make sure that the official winner isn't known until next year.

I voted on Friday and had to wait in an hour long line. When I left, the line was as long as it was when I first arrived. Pretty impressive for a grocery store :-p

Saturday, October 30, 2004

Aggies vs the Bears

#16 A&M vs unranked Baylor

Aggies come into this game 6 - 1, 4 - 0 in the BigXII.
Baylor is something like 2 and 5 and 0 in the BigXII.

Gawd, this is aweful, it's like Baylor got a copy of our playbook. They are stopping everything we throw at them, and their offense is moving the ball pretty easy as well.

Reggie just threw his first interception for the year. That ends a 200 some odd passing streak without an INT.

Baylor also blocked a punt, they got 10 points off the blocked punt and INT.

Come'on Ag's.

Baylor just forced a fumble from Courtnie Lewis, that makes us -2 for the game. We were +17 (i think) coming into the game and Baylor was -16 coming into the game. WTF.

The Bears scored a TD off the Lewis fumble, that makes them +17 points on turnovers. This is unreal!

A&M 20 - Baylor 20

Whoop, on the next series, Schrader catches a 49 yard pass for a td.

A&M 27 - Baylor 20

Baylor runs the kickoff 59 yards to the Aggie 41. 4th and 4 with 3 minutes left, Baylor takes a timeout. They are going for it. Bell throws for a first. They've been throwing quick outs all game. You'd think we'd have picked one or two by now.

Baylor is now at the 10 yd line, they have our number today, that's for sure. 2nd and goal, Baylor scores a TD. Frack! BU calls a timeout to discuss going for 2 to take the lead. A field goal will tie it up. The field goal unit lines up. It's good. Tied up with 2:50 left in the game.

A&M 27 - Baylor 27 (this must really be pissing off the teams we've beat this season)

Baylor hasn't beaten A&M since 1985!

2:50 to go, Aggies at the 37 yd line. High snap and McNeal gets sacked. 3rd and 24. 23 yard pass, now it's 4th and 1 on the 46 yd line. 1:16 left and A&M calls a timeout.

Baylor gets the ball at their 27 yd line with 1:06 to go. They've used 2 timeouts already. 1rst down and they get 1 yd on the pass, clock stops at 1:00.
1rst down Baylor at the 42 yd line, he's in bounds so the clock should run, but the reciever is injured (yeah right) so the clock stops. 51 seconds to go. 1rst and 10 at the BU 42. Long pass, incomplete, Jaxson Appel covering Ziegler. A&M is in prevent with 6 db's, incomplete pass. 3rd down, incomplet pass. 4th down, they are considering going for it but decide to punt.

Aggies are playing safe punt, no return man. 4th and 15 with 20 seconds to go. Illegal procedure, 5 yard penalty backs up Baylor to 4th and 20, A&M accepts and goes for the block. Time runs out and we go to overtime.

Overtime against Baylor, unbelievable

A&M loses the coin toss. Ag's on offense first in OT.
1rst down, we run it with Keith Joseph, 2yd gain.
2nd down, pass to Murphy, 6 yd gain, now it's 3rd and 1.
Keith Joseph goes for 1 and gets a touch down, 16 yd td!

Aggies 34 - Baylor 27

Baylor thows a screen pass for no gain on 1rst.
2nd and 10 at the 25, they run it for 13.
Baylor, 1rst and 10 at the 12 yd line. Baylor TD to Zeigler on a pass.

Aggies 34 - Baylor 33
Baylor decides to go for 2 rather than risk a second OT.
All or nothing.
Bell passes, and Zeigler catches it, the 2 point conversion is successful.

Baylor wins it, 35 to 34.

For historical sake, today #5 FSU lost to unranked Maryland and #4 Miami lost to unranked North Carolina.

Friday, October 29, 2004

I hate painting!

So, you've put off those house chores for a couple months, a year, 2, 3, 4?
Well, when you get to the point where you have to complete those projects vs. when you could do a few at a time, you know the ones: the sagging gate, the crack in the wall, chipped paint, or all the smudges that the dogs noses leave on the windows, I'd recommend doing the projects as they come up.

Don't wait till you decide to put your house on the market and have to fix 4 years worth of wear and tear at one time.

Did I mention that painting sux?

The terrorist who would be campaigner

So, apparently Bin Laden has released a new DVD in which he issues a warning to the US voter that we should vote for the candidate that will not attempt to scewer his sorry @ss.

Sorry bub, but you and your ilk are gonna get "allah willing" 4 more years of the Bush doctrine.

Friday night in Austin

So, apparently Bin Laden has released a new DVD in which he issues a warning to the US voter that we should vote for the candidate that will not attempt to scewer his sorry @ss.

Sorry bub, but you and your ilk are gonna get "allah willing" 4 more years of the Bush doctrine.

Saturday, October 16, 2004

Aggies vs The Pokes

Ag's get the ball with less than a minute left in the half after a long OSU touchdown drive. OSU missed the extra point. 20 - 6 Ags.

A&M runs a couple plays, it's 3rd down with 13 seconds left and A&M is on the Pokes 30'ish. The Pokes call a timeout to stop the clock thinking that they might get the ball back with enough time to take a shot at the end zone before the half. BIG MISTAKE. Ag's on the next snap, Reggie runs the ball on a QB keeper, he makes 10 or so yards, but needs more for the first, the ball pops out and flies forward and into one of the Ag linemens hands. He runs it another 15 yards. 5 seconds left and A&M takes a timeout. The next play is a hailmary (you might of guessed), the pass goes 60 someodd yards, an Ag tips the ball on the two yard line, it pops up and is caught by another Ag in the endzone. Touchdown Aggies, WWWWWWHHHHHHOOOOOOPPPPPP! Hows that for taking the momentum out of OSU's sales going into half. I'm guessing thta they are wishing that they wouldn't have taken that timeout.

BTW, did I mention that OSU scheduled us as their HomeComing game? Iowa State did the same and we crushed them. We aren't the same 4 - 8 team we were last year. Let's see how this progresses.

God, A&M was up a ton, now its 36 to 20, 2 straight Pokes td's. Now they are on offense with 5:00 left.

This is murder, Donovan Woods is owning the defense right now.
Oh, 4th and 5 after the fullback dropped a perfect pass by Woods.
WHOOOPPP, Woods overthroughs his receiver and A&M takes over on downs.

Ag's have converted on one 4th and 1 during this clock killing drive. OSU is out of timeouts. 51 seconds left. It's 4th and 1 again. GRRRRRrr Keith Joseph doesn't make it. Turn over on downs. Holy crap, Aggies have 479 yards of total offense and +14 in turnovers.

Sack, but it gets called back because we actually had our 12th man on the field. Damn. Ok, another sack by Jason Jack. 13 seconds left. They are trying to snap it, clock runs out.

AGS win, #23 Ag's beat #15 OSU. Ag's are 5 - 1 and 3 - 0 in the Big XII. Whoop (btw that's better than t.u. :-) ) Supposedly, the last time we beat a ranked opponent on the road was Colorado in 1997. Reggie completed passes to 10 different receivers tonight. Last weeks win against ISU was the first road win in 8 games, now we have 2 in a row.

For some reason, Dave South (Aggie Radio Network) keeps saying that the Aggies are 2 - 0 in the Big XII, but we are really 3 - 0 (ISU, Kstate, OSU). Whoop.

Friday, October 15, 2004

Friday night lights

So, I screwed up the cardinal rule of "don't lure the solicitor to your front door" by turning on my front porch light. Frack, I hate them. Especially here in Austin. They are almost always some hippy / environmental wakko that wants you to sign one petition or another. This time I got him to leave by promising to check out the website. I can't wait to get out of this town...

I don't know how long this message thread on TexAgs.com will stay up, but it's friggin hillarious. It all started with an Ag poking fun at the OkState Cow Pokes by posting a link to some weirdo guy OSU guy who calls himself BikerFox.

http://texags.com/main/forum.reply.asp?topic_id=369147&forum_id=5

and here's a link to the source of the humor, this guy is friggin odd.
http://www.bikerfox.com/foxphotos2

Buahahahahahaha