Subject: CAcert Code Development list.
List archive
- From: Critical System Administrator Team <critical-admin AT cacert.org>
- To: Michael Tänzer <michael.taenzer AT cacert.org>
- Cc: cacert-devel AT lists.cacert.org, Benny Baumann <benbe AT cacert.org>, Martin Gummi <martin.gummi AT cacert.org>, Felix Dörre <felix AT dogcraft.de>
- Subject: Re: Patch request: Bug #1318
- Date: Fri, 05 Dec 2014 10:22:17 +0100
- Organization: CAcert
Hi Michael,
On 12/05/2014 01:15 AM, Michael Tänzer wrote:
> We have a fix for https://bugs.cacert.org/view.php?id=1318
> "E-Mail Probe does not consider mx priorities"
>
> The fix was reviewed by Benny Baumann (BenBE) and me (NEOatNHNG) and
> tested by Martin Gummi and Felix Dörre (felixd).
>
> Diff is attached. Please also run the locale makefile so that our
> translators see the new strings (if present) on
> https://translations.cacert.org and new translations get imported into
> the system.
>
> Changed files:
> /includes/general.php
The patch has been installed on the production server on December 5, 2014.
See also the attached log message that was sent out to the cacert-systemlog
mailing list.
Strings to be translated have been synchronized in two directions with the
translation server and the Apache2 webserver has been restarted to activate
any new available translations.
Regards,
-- wytze
--- Begin Message ---Fix for https://bugs.cacert.org/view.php?id=1318
- From: Wytze van der Raay <wytze AT cacert.org>
- To: cacert-systemlog AT lists.cacert.org
- Subject: Fwd: cvs.cacert.org checkin notification
- Date: Fri, 05 Dec 2014 10:10:47 +0100
- Organization: CAcert
"E-Mail Probe does not consider mx priorities"
In conjunction with the attached CVS changes a new tarball has been
made available incorporating all updates. The new tarball is available
through http://www.cacert.org/src-lic.php
-- end
--- Begin Message ---
- From: "root" <root AT cvs.cacert.org>
- To: critical-admin AT cacert.org
- Subject: cvs.cacert.org checkin notification
- Date: Fri, 5 Dec 2014 10:06:50 +0100 (CET)
uid=0(root) gid=0(root) groups=0(root)
general.php 1.105 1.106
Fri Dec 5 10:06:50 CET 2014
Update of /var/lib/cvs/cacert/includes
In directory webdb:/home/cacert/www/includes
Modified Files:
general.php
Log Message:
Fix for https://bugs.cacert.org/view.php?id=1318
"E-Mail Probe does not consider mx priorities"
===================================================================
RCS file: /var/lib/cvs/cacert/includes/general.php,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -r1.105 -r1.106
--- general.php 2014/12/05 09:05:04 1.105
+++ general.php 2014/12/05 09:06:50 1.106
@@ -538,20 +538,35 @@
if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\+\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/"
, $email))
{
list($username,$domain)=explode('@',$email,2);
- $dom = escapeshellarg($domain);
- $line = trim(shell_exec("dig +short MX $dom 2>&1"));
-#echo $email."-$dom-$line-\n";
-#echo shell_exec("dig +short mx heise.de 2>&1")."-<br>\n";
+ $mxhostrr = array();
+ $mxweight = array();
+ if( !getmxrr($domain, $mxhostrr, $mxweight) ) {
+ $mxhostrr = array($domain);
+ $mxweight = array(0);
+ } else if ( empty($mxhostrr) ) {
+ $mxhostrr = array($domain);
+ $mxweight = array(0);
+ }
+
+ $mxhostprio = array();
+ for($i = 0; $i < count($mxhostrr); $i++) {
+ $mx_host = trim($mxhostrr[$i], '.');
+ $mx_prio = $mxweight[$i];
+ if(empty($mxhostprio[$mx_prio])) {
+ $mxhostprio[$mx_prio] = array();
+ }
+ $mxhostprio[$mx_prio][] = $mx_host;
+ }
+
+ array_walk($mxhostprio, function(&$mx) {
shuffle($mx); } );
+ ksort($mxhostprio);
- $list = explode("\n", $line);
- foreach($list as $row) {
- if(!strstr($row, " ")) {
- continue;
+ $mxhosts = array();
+ foreach($mxhostprio as $mx_prio => $mxhostnames) {
+ foreach($mxhostnames as $mx_host) {
+ $mxhosts[] = $mx_host;
}
- list($pri, $mxhosts[]) = explode(" ",
trim($row), 2);
}
- $mxhosts[] = $domain;
- array_walk($mxhosts, function(&$mx) { $mx = trim($mx,
'.'); } );
foreach($mxhosts as $key => $domain)
{
--- End Message ---Attachment: smime.p7s
Description: S/MIME Cryptographic Signature
--- End Message ---
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
- Patch request: Bug #1318, Michael Tänzer, 12/05/2014
- Re: Patch request: Bug #1318, Critical System Administrator Team, 12/05/2014
Archive powered by MHonArc 2.6.18.