forked from extern/egroupware
W.I.P. smime support:
- Make sure recipients addresses are not in RFC822 format
This commit is contained in:
parent
1a63b5681d
commit
df998bab26
@ -7171,4 +7171,21 @@ class Mail
|
|||||||
error_log(__METHOD__.' ('.__LINE__.') '.' NOT DONE YET!' . ' hookValue = '. $_hookValues);
|
error_log(__METHOD__.' ('.__LINE__.') '.' NOT DONE YET!' . ' hookValue = '. $_hookValues);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function gets array of email addresses in RFC822 format
|
||||||
|
* and tries to normalize the addresses into only email addresses.
|
||||||
|
*
|
||||||
|
* @param array $_addresses Addresses
|
||||||
|
*/
|
||||||
|
static function stripRFC822Addresses ($_addresses)
|
||||||
|
{
|
||||||
|
$matches = array();
|
||||||
|
foreach ($_addresses as &$address)
|
||||||
|
{
|
||||||
|
preg_match("/<([^\'\" <>]+)>$/", $address, $matches);
|
||||||
|
if ($matches[1]) $address = $matches[1];
|
||||||
|
}
|
||||||
|
return $_addresses;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2964,7 +2964,7 @@ class mail_compose
|
|||||||
$smime_success = $this->_encrypt(
|
$smime_success = $this->_encrypt(
|
||||||
$mail,
|
$mail,
|
||||||
$_formData['smime_encrypt'] == 'on'? Mail\Smime::TYPE_SIGN_ENCRYPT: Mail\Smime::TYPE_SIGN,
|
$_formData['smime_encrypt'] == 'on'? Mail\Smime::TYPE_SIGN_ENCRYPT: Mail\Smime::TYPE_SIGN,
|
||||||
$_formData['to'],
|
Mail::stripRFC822Addresses($_formData['to']),
|
||||||
$identity['ident_email'],
|
$identity['ident_email'],
|
||||||
$_formData['smime_passphrase']
|
$_formData['smime_passphrase']
|
||||||
);
|
);
|
||||||
@ -2980,7 +2980,7 @@ class mail_compose
|
|||||||
$smime_success = $this->_encrypt(
|
$smime_success = $this->_encrypt(
|
||||||
$mail,
|
$mail,
|
||||||
Mail\Smime::TYPE_ENCRYPT,
|
Mail\Smime::TYPE_ENCRYPT,
|
||||||
$_formData['to'],
|
Mail::stripRFC822Addresses($_formData['to']),
|
||||||
$identity['ident_email']
|
$identity['ident_email']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user