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

Top Page
Delete this message
Reply to this message
Author: John Burnham
Date:  
To: 'exim users'
Subject: Re: [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.


Now, if do it with a router - those run after the email has been accepted and a fail there will generate a bounce email.

> However, I'm not sure I'm on the right track because I get a 250
> Accepted after the rcpt to for the address:
> <snip>
> This could be a simple misunderstanding on my part of how things work,
> or a obvious typo/failed to grasp the point type issue.


A minor misunderstanding on exactly when things are run, I would say. Routers are run after the SMTP conversation has completed and the email is trying to be delivered.
If you want to have things happen at SMTP time, you probably want to put this in an ACL that runs at SMTP time.

> If anyone has any input, suggestions or corrections I'd be pleased to
> received them.
>

I'd put something into your ACLs - probably the RCPT one. Something like:

deny recipients = /etc/exim/badrecipients
     message = Gone away, no forwarding address


If you actually want the SMTP connection to drop then substitute drop for deny in the above.
This would allow you to have a list of recipients (one per line) in a file called /etc/exim/badrecipients - this would allow you to update the list without having to restart Exim.
Does that clarify things for you ? Please don't hesitate to question anything you didn't find clear.

J