Erzeugt bei intern gerouteten E-Mails in etwa das Verhalten der Option „S/MIME sign outgoing mails with the following text in subject:“ (Outgoing) in Verbindung mit „Remove signature if S/MIME signature check succeeds“(Incoming).
Zeile |
Code |
|---|---|
01 |
# Begin: Custom commands for incoming e-mails BEFORE decryption |
02 |
log(1,'Begin: Custom commands for incoming e-mails BEFORE decryption'); |
|
|
03 |
# Begin: Tag internally routed e-mails, marked to be SIGNED |
04 |
log(1,'Begin: Tag internally routed e-mails, marked to be SIGNED'); |
|
|
05 |
if (from_managed_domain()) { |
06 |
log(1,'E-mail is from managed domain...'); |
07 |
if (!compareattr('connect_from', 'equal', '127.0.0.1')) { |
08 |
log(1,'...not form localhost...'); |
09 |
if (check_sender(false, false, true)) { |
10 |
log(1,'...but is not allowed to relay, dropping'); |
11 |
drop('554' '5.7.1 Relay access denied'); |
12 |
} else { |
13 |
log(1,'...and is allowed to relay, tag as SIGNED if requested'); |
14 |
$custom_tag_signed; |
15 |
} |
16 |
} else { |
17 |
log(1,'...but generated on localhost, going on in standard ruleset'); |
18 |
} |
19 |
} |
|
|
20 |
log(1,'End: Tag internally routed e-mails, marked to be SIGNED'); |
21 |
# End: Tag all internally routed e-mails as SIGNED |
|
|
22 |
log(1,'End: Custom commands for incoming e-mails BEFORE decryption'); |
23 |
# End: Custom commands for incoming e-mails BEFORE decryption |
Das in oben genannten Code verwendete Macro $custom_sign für das Signieren, muss bei dieser Variante zusätzlich unter Custom macros and commands for all e-mails BEFORE processing wie folgt definiert werden:
Zeile |
Code |
|---|---|
01 |
# Begin: Custom macros and commands for all e-mails BEFORE processing |
02 |
log(1,'Begin: Custom macros and commands for all e-mails BEFORE processing'); |
|
|
03 |
custom_tag_signed = { |
04 |
if (compare('x-smsign','equal','yes')) { |
05 |
log(1,'Signing requested by Add-In, tag as SIGNED'); |
06 |
rmheader('x-smenc'); |
07 |
tagsubject('[signed OK]'); |
08 |
} |
|
|
09 |
if (compare('subject','substitute','@SIGNTEXT@')) { |
10 |
log(1,'Signing requested by subject-tag, tag as SIGNED'); |
11 |
tagsubject('[signed OK]'); |
12 |
} |
13 |
}; |
|
|
14 |
log(1,'End: Custom macros and commands for all e-mails BEFORE processing'); |
15 |
# End: Custom macros and commands for all e-mails BEFORE processing |