Magento: Fix PayPal order confirmation email not sent

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/paypal/Onepage.php.diff";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Links
http://screencastworld.com/2010/03/magento/magento-commerce-how-to-fix-order-confirmation-email-not-sent
http://inchoo.net/ecommerce/magento/debugging-paypal-ipn-in-magento/
http://sergiy.kyrylkov.name/blog/2010/05/payment-problems-in-magento-paypal-standard-with-ipn-after-upgrade-from-1-3-x-to-1-4-0-1/