Re: [exim] ACL and conditions

Góra strony
Delete this message
Reply to this message
Autor: Wakko Warner
Data:  
Dla: Justin Koivisto
CC: exim-users
Temat: Re: [exim] ACL and conditions
> >2) Put in a router that checks that domains = that domain and the
> > $message_size is > than the maximum. Use the redirect driver with
> > allow_fail = true and redirect to: :fail: $domain cannot accept email
> > larger than xx in size
>
> I tried to create a router like this:
>
> koivi_large:
> domains = koivi.com
> driver = redirect
> allow_fail = true
> condition = ${if and {{eq{$domain}{koivi.com}}
> {>{$message_size}{KOIVI_MSG_LIMIT}} } {true} }
> data = :fail: Koivi.com email too big message.


It should be like this:
koivi_large:
    driver = redirect
    domains = koivi.com
    condition = ${if >{$message_size}{KOIVI_MSG_LIMIT}{yes}{no}}
    allow_fail
    data = :fail: Koivi.com email too big message (KOIVI_MSG_LIMIT)


MAKE SURE you have the KOIVI_MSG_LIMIT in there. That way you'll know from
the logs if it didn't expand or what.

> Now, in my exim4/mainlog, I get the following:
>
> rejected RCPT <justin@???>: Koivi.com email too big message.
>
> However, the bounced message from the sending server says:
>
> ... while talking to mail.koivi.com.:
> >>>>>> DATA
> <<< 550 unknown user
> 550 5.1.1 <justin@???>... User unknown
> <<< 503 valid RCPT command must precede DATA
>
> I was hoping that the message I defined would be there... How do I do that?


Exim did not show the 5.1.1 message. You might want to try using the -bt
and/or the -bv options of exim to test the address (Don't do this on the
daemon)

> I also tried sending to a different domain, and found this:
>
> rejected RCPT <justin@???>: Koivi.com email too big message.


Guess what, you might still have an ACL in there somewhere that's doing
this. Since you didn't post your exim.conf (without comments. use:
grep "^[^#]" /etc/exim/exim.conf
Or wherever your exim.conf is)

> I'm guessing this means I need to put this router *before* my virtual
> domain alias one. Because of that, I will need to check the doamin's
> alias file as well.


If the message is too big, it shouldn't really matter. It can possibly come
first (or after spam/virus routers if any).

Now, I notice that your email address is the domain that you're trying to do
this with. Do you host this domain or does someone else host it and you
don't want oversized messages to be delivered?

If you are doing this because you know the domain won't accept an email this
large, it might be best if you put the domain and max size limit in an
lsearch/db file or sql database (depending on your configuration). This can
scale better than having to add a router for every domain.

> Is there a way I can (in a router) write custom lines to the log or
> other file? That way, I can take a look at what data I am working with
> when I am having problems. I think if I was able to do that, I'd be able
> to get this on my own... Is there a type of "programmer's reference"
> somewhere that I can use to check syntax, what is available for writing
> conditions in acl, router, etc.?


I don't think so. I know there's debug_print that I have on my routers on
the server at work. That way -bt shows what routers are hit.

> Once I get past this stage of asking newbie questions, I hope to be able
> to contribute back to the list!


I was a newbie once apon a time as well. =)

--
Lab tests show that use of micro$oft causes cancer in lab animals