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

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Ron White
Date:  
CC: 'exim users'
Sujet: Re: [exim] Redirect Router: forced to fail, with a custom error message?
On Tue, 2010-04-27 at 16:04 +0100, John Burnham wrote:
> >
> > 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

My sincere thanks to you both (Chris & John).

I did not understand that ACL's control what happen at SMTP Time and
routers/transports only come into effect after the message has been
accepted. I guess {if I had gone on with the SMTP conversation} the
router would have bounced the message(?) which is not what I intended.

It did not help that I had 'accept' at the end of the ACL when this
should have been dropping as I'd not tested for relay {blush - I was
half using a honeypot configuration I whipped up last week}.

I've got it now! ACL=SMTP TIME. I don't need to use a router to do this
- the ACL 'deny recipients' is just what I need.

Again gentlemen, thank you sincerely for your help.

Ron