[exim] Redirect Router: forced to fail, with a custom error …

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Ron White
Ημερομηνία:  
Προς: exim users
Αντικείμενο: [exim] Redirect Router: forced to fail, with a custom error message?
Reading through the docs:
http://exim.org/exim-html-4.50/doc/html/spec_22.html#CHAP22
I was really interested to read this:

The incoming address can be redirected in several different ways:... It
can be forced to fail, with a custom error message.

This would be really handy for 'noreply' and 'goneaway' type users so I
thought I'd give it a try. I can get it to match OK with this router:
#RARE CASE ROUTER - USER IS NOT ALLOWED INBOUND MAIL
reject_noreply:
driver          = redirect
data            = noreply@???,:fail: Gone away, no forwarding
address
allow_fail      = true


My objective would be to give a 550 'Gone away, no forwarding address'
with a connection drop at this point.
However, I'm not sure I'm on the right track because I get a 250
Accepted after the rcpt to for the address:

>>> processing "drop"
>>> check condition = ${if > {$rcpt_count}{3}}
>>>                 = 
>>> drop: condition test failed
>>> processing "drop"
>>> check !verify = recipient/callout=15s,no_cache

>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> routing noreply@???
>>> example.local in "example.local"? yes (matched "example.local")
>>> example.local in "! +hosted_domains"? no (matched "!

+hosted_domains")
>>> example.local in "example.local"? yes (matched "example.local")
>>> example.local in "+hosted_domains"? yes (matched "+hosted_domains")
>>> calling reject_noreply router
>>> reject_noreply router forced address failure
>>> ----------- end verify ------------
>>> check !condition = ${lookup mysql{SELECT 1 FROM mailusers WHERE

usertype=0 AND active=1 AND email='${quote_mysql:$local_part}@
${quote_mysql:$domain}';}}
>>>                  = 1
>>> drop: condition test failed
>>> processing "accept"
>>> accept: condition test succeeded

250 Accepted

This could be a simple misunderstanding on my part of how things work,
or a obvious typo/failed to grasp the point type issue.
If anyone has any input, suggestions or corrections I'd be pleased to
received them.

Filling it out: I have a couple of conditions in the RCPT_TO acl that
check against popular DNSBL's, bad (EH|HE)LO, too many recipients plus
one to check certain recipients are not callout verified - they look
like this:

drop    condition = ${if > {$rcpt_count}{3}}
        delay = 15s
        message   = Too many recipients bye....
drop    !verify   = recipient/callout=15s,no_cache
        !condition = ${lookup mysql{MYSQL_LRECIPIENTS}}
        message   = REJECTED - Remote Recipient Verify Failed
        log_message = relay recipient verification failed
        domains   = +hosted_domains
accept


The relevant routers look like this:

mysql_localbox:
driver          = accept
domains         = +hosted_domains
condition       = ${lookup mysql{MYSQL_LOCAL}}
#local_part_suffix      = +*
#local_part_suffix_optional
transport               = local_mysql_delivery



#RARE CASE ROUTER - USER IS NOT ALLOWED INBOUND MAIL
reject_noreply:
driver          = redirect
data            = noreply@???,:fail: Gone away, no forwarding
address
allow_fail      = true


#relay to IP or HOSTNAME
relay_to_ip_or_host:
driver          = manualroute
route_data      = ${lookup mysql{MYSQL_RTHOIP}}
transport = relay_smtp
host_find_failed = defer


relay_to_mx:
driver          = manualroute
route_data      = ${lookup mysql{MYSQL_RTMX}}
transport = relay_smtp
host_find_failed = defer
no_more
# TRANSPORTS
.....