I'd like to propose we add one additional dynamic global variable to be determined in config.inc.php along with $base_path and $base_url. Currently, $base_url returns the relative path, which is wonderful. However, at times, I need know the absolute URL of the site, including if it is an SSL request, or coming in on a different port. In those cases I propose a method like this...
$site_url = (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on')? "http://" : "https://" ;
$site_url .= $_SERVER['HTTP_HOST'];
$site_url .= ($_SERVER['SERVER_PORT']==80 || isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS'])=='on')? "":":".$_SERVER['SERVER_PORT'];
$site_url .= "/";
I can then use this to easily fix the [+surl+] bug in the emails.
In addition, I'm going to add one additional parameter to the mail() call to prevent user's spam detection systems from rejecting the MODx emails as spam (since the return-path on shared servers is often different from the $emailsender set in the site configuration) -->
The -f switch tells sendmail to set the return-path to the specified address.
Any concerns or alternate ideas?