The encrypt_domain_smime() command encrypts emails by means of S/MIMEdomain encryption.
This command encrypts the entire outgoing email using S/MIME domain encryption. The only exceptions are email headers, as these are required for email transport, among other things.
If public S/MIME domain keys (certificates) for encryption are not available for all recipients of the email domain (see Manual S/MIME domain certificates or Domain Certificates Managed S/MIME domain certificates), two groups are formed.
Structure of the command
encrypt_domain_smime(['cipher[;pAdd-Ing]']);
Return value
positive |
for the group of recipients for whom encryption was possible |
negative |
For the group of recipients for whom encryption was not possible |
Parameters
cipher (optional)
This parameter enforces encryption with the specified encryption algorithm (see Mail Processing Ruleset generator Encryption Outgoing e-mails Use default cipher for S/MIME encryption).
Possible values
•des3
•aes128
•aes192
•aes256
The default setting is des3
pAdd-Ing (optional)
This parameter enforces the use of the selected padding procedure (see Mail Processing Ruleset generator Encryption Outgoing e-mails Prefer RSA-OAEP for S/MIME encryption).
Possible values
•pkcs
•oaep
The default setting is pkcs
Example 1
Line |
Code |
|---|---|
01 |
if (encrypt_domain_smime()) { |
02 |
log(1,'mail successfully S/MIME domain encrypted'); |
03 |
} else { |
04 |
log(1,'mail could not be S/MIME domain encrypted'); |
05 |
} |
Explanation
In this example, an attempt is made to encrypt an email using the communication partner's S/MIME domain certificate (line 01). Success or failure of the action is logged (lines 02 and 04).