Re: [exim] Issue with message generated when calling ab acl …

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Todd Lyons
Fecha:  
A: soumya tr
Cc: exim-users@exim.org
Asunto: Re: [exim] Issue with message generated when calling ab acl from another acl
On Thu, Jan 2, 2014 at 11:00 PM, soumya tr <soumya.324@???> wrote:
> Hi,
>
> I have set acl_not_smtp = acl_not_smtp_custom .


I don't understand this part. Below you have two ACLs which are named
"acl_not_smtp" and "acl_not_smtp_custom". Above you say you are
setting one equal to the other. Can you explain more? If you are
obfuscating, please don't do that. It makes it very hard for anybody
to follow.

> With in acl_not_smtp_custom, I have added some custom rules, and at the end
> have called the default acl_not_smtp. Within acl_not_smtp, there are
> conditions to check and reject if mail is caught as spam by spamassassin.
>
> --------------------------------------
> acl_not_smtp_custom:
>
> ...
> ...
>    warn
>      set acl_m_accepted = no
>      acl = acl_not_smtp
>      set acl_m_accepted = yes

>
>    accept
>      condition = ${acl_m_accepted}

>
> acl_not_smtp:
> ...
> ...
>     # BEGIN INSERT outgoing_spam_scan
> warn
>         condition   = ${if <= {$message_size}{200K}{${if forall{<,
> $recipients}{match_domain{${domain:$item}}{+local_domains}}{0}{1}}}{0}}
>         condition   = ${if eq{$originator_uid}{0}{0}{1}}
>         set acl_c_outgoing_spam_scan = 1

>
> deny    message     = This message was classified as SPAM and may not be
> delivered
>         condition   = ${if eq{$acl_c_outgoing_spam_scan}{1}{1}{0}}
>         spam        = cpaneleximscanner/defer_ok
>         log_message = "SpamAssassin as cpaneleximscanner detected OUTGOING
> not smtp message as spam ($spam_score)"

>
> warn
>         log_message = "SpamAssassin as cpaneleximscanner detected OUTGOING
> not smtp message as NOT spam ($spam_score)"
>         condition   = ${if eq{$acl_c_outgoing_spam_scan}{1}{1}{0}}
>         add_header = X-OutGoing-Spam-Status: No, score=$spam_score
> --------------------------------------

>
> The rejection is working fine. But the problem is, its not giving the
> required message. Ideally it should through the message "SpamAssassin as
> cpaneleximscanner detected OUTGOING not smtp message as spam ($spam_score)"
>
> ------------------
> 2014-01-03 06:26:52 1VyyDX-004CET-Ix F=<user@hostname> rejected by non-SMTP
> ACL: "SpamAssassin as cpaneleximscanner detected OUTGOING not smtp message
> as spam (1000.8)"
> ------------------
>
> The above error is generated when acl_not_smtp is used, but it doesnt
> generate the required error, when tha acl is called from
> acl_not_smtp_custom.
>
> But instead it throws:
>
> ------------------
> 2014-01-03 06:57:11 1Vyygs-001KmD-FK F=<user@hostnamet> rejected by
> non-SMTP ACL:
> NULL
>
> ------------------
>
> How can I have the error message to be correctly shown, when calling an acl
> from within another acl.


You may have found a bug with the logging of calling a sub-acl. The
way you are using it, paired with the description in the exim docs
says that if your sub-acl returns deny, then it returns a "false"
condition to the calling ACL. The way *I* read that, it means that
the rejection is happening in your acl_not_smtp ACL because the accept
verb fails (the acl_m_accepted is "no").

I see two solutions:
1) Pass the reject message you want it to log back out to the calling
ACL by setting a variable in the sub-acl, such as
$acl_m_spam_reject_text or something.
2) Construct the message in the calling ACL instead of the sub-acl
(i.e. assume that the sub-acl detected a spam and have the
message/log_message actions in the calling ACL).

...Todd
--
The total budget at all receivers for solving senders' problems is $0.
If you want them to accept your mail and manage it the way you want,
send it the way the spec says to. --John Levine