Mailing List Archive

Regarding handling suspened email accounts
Hello,

I have the following router setting or validating suspened accounts and
the perl validation is working fine.

suspendedcheck:
# check if sending user is suspened
driver = redirect
domains = +local_domains : $primary_hostname
condition =${if eq
{${perl{is_suspended}{$domain_data}{$local_part}}}{yes}{no}}
allow_fail
allow_defer
allow_freeze
data = :fail: Suspended account
no_more

But the problem is this email is still sending to transport and delivering
to the inbox. Do it suppoes to simply fail ?


Regards
Sherin A
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Regarding handling suspened email accounts [ In reply to ]
Am 16.09.21 um 11:37 schrieb Sherin A via Exim-users:
> Hello,
>
> I have the following router setting or validating suspened accounts and
> the perl validation is working fine.
>
> suspendedcheck:
> # check if sending user is suspened
> driver = redirect
> domains = +local_domains : $primary_hostname
> condition =${if eq
> {${perl{is_suspended}{$domain_data}{$local_part}}}{yes}{no}}
> allow_fail
> allow_defer
> allow_freeze
> data = :fail: Suspended account
> no_more
>
> But the problem is this email is still sending to transport and delivering
> to the inbox. Do it suppoes to simply fail ?
>
>

First thought: it's not processed at all.

Do a debug run and check, if it's really used:

exim -d externaldomaintest@mydomain.com < /tmp/mail.fail

use the suspended address, fake a mail to that address and watch the
routers list to be processed. You can see, if the condition you created
really ->yields<- a "true" .

Best regards,
Marius

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Regarding handling suspened email accounts [ In reply to ]
On 16/09/2021 12:18, Cyborg via Exim-users wrote:
> Do a debug run and check, if it's really used:
>
> exim -d externaldomaintest@mydomain.com < /tmp/mail.fail
>
> use the suspended address, fake a mail to that address and watch the routers list to be processed. You can see, if the condition you created really ->yields<- a "true" .

Consider adding a -N to that line, too.
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Regarding handling suspened email accounts [ In reply to ]
Hello Marius,

 You saved the day , removing {no} from the condition fixed the issue.
Thank you Marius and Jermy

On 16/09/21 5:52 pm, Cyborg wrote:
> Am 16.09.21 um 13:53 schrieb Sherin A:
>> Hello Marius,
>>
>>  Thank you for your help,  The debug log is as follows, I added
>> Exim::log_write("Recipient account is suspened : $user"); inside the
>> perl script , may be this is causing the condition failure ?
>>
>>
>> --------> suspendedcheck router <--------
>> local_part=dreamcatcher domain=u.eenos.com
>> checking domains
>> search_open: lsearch "/etc/localdomains"
>>   cached open
>> search_find: file="/etc/localdomains"
>>   key="u.eenos.com" partial=-1 affix=NULL starflags=0 opts=NULL
>> LRU list:
>>   6/etc/localdomains
>>   End
>> internal_search_find: file="/etc/localdomains"
>>   type=lsearch key="u.eenos.com" opts=NULL
>> cached data used for lookup of u.eenos.com
>>   in /etc/localdomains
>> lookup failed
>> u.eenos.com in "lsearch;/etc/localdomains"? no (end of list)
>> u.eenos.com in "+local_domains : u.dom.com"? yes (matched "u.dom.com")
>> checking "condition" "${if
>> eq{${perl{is_suspended}{$domain_data}{$local_part}}}{yes}{no}}"...
>> Starting Perl interpreter
>> LOG: MAIN
>>   Recipient account is suspened : dreamcatcher
>> local-accept-delivery forking for logfile-open
>> local-accept-delivery forked for logfile-open: 614018
>> postfork: logfile-open
>> suspendedcheck router skipped: condition failure
>>
>
> EQ(S1,S2) compares String 1 with String 2 .. you build this:
> ${if
> eq{
> ${perl{is_suspended}{$domain_data}{$local_part}}
> }{yes}{no}
> }
>
> EQ{String1}{String2}{no}
>
> A wonder, it does not yield a syntax error from exim. Remove the
> "{no}" and it could work.
>
>
> best regards,
> Marius
>
--
Regards
Sherin A

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/