X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FUserMailer.php;h=c9db90f85b21b24c408b007e7583dbc7b95cb5b6;hb=a439b58fcf1dd94386969ba558ec93cb31bdef53;hp=d73f6b403aa2ecee7d30a1cf06e98db9e6a93373;hpb=9e98c1911ec72662daf23ffb55c25fc9fd515912;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/UserMailer.php b/includes/UserMailer.php index d73f6b403a..c9db90f85b 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -239,7 +239,17 @@ class UserMailer { # -- hashar 20120218 $headers['From'] = $from->toString(); - $headers['Return-Path'] = $from->address; + $returnPath = $from->address; + $extraParams = $wgAdditionalMailParams; + + // Hook to generate custom VERP address for 'Return-Path' + wfRunHooks( 'UserMailerChangeReturnPath', array( $to, &$returnPath ) ); + # Add the envelope sender address using the -f command line option when PHP mail() is used. + # Will default to the $from->address when the UserMailerChangeReturnPath hook fails and the + # generated VERP address when the hook runs effectively. + $extraParams .= ' -f ' . $returnPath; + + $headers['Return-Path'] = $returnPath; if ( $replyto ) { $headers['Reply-To'] = $replyto->toString(); @@ -371,7 +381,7 @@ class UserMailer { self::quotedPrintable( $subject ), $body, $headers, - $wgAdditionalMailParams + $extraParams ); } }