Faça a loja sendmail.cf ${cn_subject}
com parte do host removida em ${cn1_subject}
.
Isso torna o acabamento da implementação quase trivial.
WARNING: Ask for opinions at
news:comp.mail.sendmail
before deploying it in not test environment. It MAY work but sendmail makes avoiding "unexpected side effects" MUCH MORE painstaking than I am ready to "invest". I "dry tested" it with sendmail-8.15.2.
entrada de acesso:
TLS_Rcpt:example.com VERIFY:256+CN1:messagelabs.com
correção sendmail.mc para suportar a entrada acima
WARNING: remember about TAB (\t) between RHS and LHS in
R
lines.
It is more dirty implementation viasendmail.mc
only.
define('_LOCAL_TLS_RCPT_')dnl
LOCAL_RULESETS
SLocal_tls_rcpt
R$* $: $&{cn_subject}
R$-.$+ $@ $(macro {cn1_subject} $@ $2 $)
R$* $@ $(macro {cn1_subject} $@ $)
# Ruleset continued
STLS_req
R<CN1:$&{cn1_subject}> $* $| <$+> $@ $>"TLS_req" $1 $| <$2>
R<CN1:$+> $* $| <$-:$+> $#error $@ $4 $: $3 " CN-1 " $&{cn_subject} " does not match " $1
ROK $@ OK
divert(0)dnl
Explicação:
- Torne
Local_tls_rcpt
conjunto de regras armazenar${cn_subject}
com a parte "antes do primeiro ponto" removida em${cn1_subject}
- Adicione verificações de
${cn1_subject}
acionadas pelo prefixo CN1 em "parte extra" deTLS_req
rule-set
Exemplo de script para testá-lo
#!/bin/sh
# -C sendmail-test.cf -- use non standard cf file
# -d60.5 -- trace (access) map lookus
# -d21.12 -- trace R lines rewriting
sendmail -C sendmail-test.cf -bt -d60.5 <<END
.D{verify}OK
.D{cn_subject}mail31.messagelabs.com
.D{server_name}mail31.messagelabs.com
tls_rcpt [email protected]
END