Open Relay testing based on recipient domain? Disable?

Mark Martinec Mark.Martinec+amavis at ijs.si
Fri Aug 5 17:08:36 CEST 2011


emailbuilder88,

> > $sql_select_policy =
> >   "SELECT 1 AS id FROM mydomains WHERE ('.' || domain_name) IN (%k)";
> 
> By the way, how does this match correctly?  If %k is something like
> "test at example.com, example.com, @example.com" (or whatever - maybe it's
> just not clear what %k is), then ".example.com" does not match.  I know I
> must be misunderstanding this.....
>   $sql_lookups_no_at_means_domain = 1;
> Woa, that's a cryptic setting name.  :-) 

The %k exands into:

when $sql_lookups_no_at_means_domain is 0:

        test at example.com
        test
        @example.com
        @.example.com
        @.com
        @.

or when $sql_lookups_no_at_means_domain is 1:

        test at example.com
        test@
        example.com
        .example.com
        .com
        .

As you can see, the .example.com (with a leading dot) is in the list,
so a  ('.' || domain_name)  would match.  (the || is a contacenation op,
same as a concat() function in MySQL).

  Mark


More information about the amavis-users mailing list