Registrar Barrier DNS List
From Computer Tyme Support Wiki
(Difference between revisions)
m (→DNS Lookup to Separate the domain part of a hostname) |
(→Exim Configuration) |
||
| Line 12: | Line 12: | ||
If you are running [http://www.exim.org Exim] you can use this as follows: | If you are running [http://www.exim.org Exim] you can use this as follows: | ||
| - | # Separates the domain part of a hostname - ftp.perkel.com returns perkel.com | + | # This example calls rb_resolve as an ACL subroutine. |
| + | |||
| + | warn set acl_c_rb_query = $sender_host_name | ||
| + | acl = rb_resolve | ||
| + | set acl_c_sender_host_domain = $acl_c_rb_result | ||
| + | |||
| + | rb_resolve: | ||
| + | |||
| + | # Separates the domain part of a hostname - ftp.perkel.com returns perkel.com | ||
# DNS lookup returns 127.0.0.1 for single level domains | # DNS lookup returns 127.0.0.1 for single level domains | ||
# DNS lookup returns 127.0.0.2 for two level domains | # DNS lookup returns 127.0.0.2 for two level domains | ||
# DNS lookup returns 127.0.0.3 for three level domains | # DNS lookup returns 127.0.0.3 for three level domains | ||
| - | warn | + | warn set acl_c_rb_result = |
| - | + | set acl_c_rb_query = ${lc:$acl_c_rb_query} | |
| - | + | ||
| - | + | accept condition = ${if eq{$acl_c_rb_query}{}} | |
| - | + | ||
| - | + | ||
| - | + | accept !dnslists = rb.junkemailfilter.com/$acl_c_rb_query | |
| - | + | ||
| - | + | ||
| - | warn condition = ${if eq{$ | + | warn condition = ${if eq{$dnslist_value}{127.0.0.1}} |
| - | + | set acl_c_rb_result = ${sg{$acl_c_rb_query}{\N^(.*\.)?(.*\..*)$\N}{\$2}} | |
| - | + | ||
| + | warn condition = ${if eq{$dnslist_value}{127.0.0.2}} | ||
| + | set acl_c_rb_result = ${sg{$acl_c_rb_query}{\N^(.*\.)?(.*\..*\..*)$\N}{\$2}} | ||
| + | |||
| + | warn condition = ${if eq{$dnslist_value}{127.0.0.3}} | ||
| + | set acl_c_rb_result = ${sg{$acl_c_rb_query}{\N^(.*\.)?(.*\..*\..*\..*)$\N}{\$2}} | ||
| + | |||
| + | accept | ||
Revision as of 13:02, 26 May 2008
DNS Lookup to Separate the domain part of a hostname
This DNS lookup helps you find the main domain part of a hostname. Sometimes it is called two level TLDs and three level TLDs. Lookups are accomplished through DNS calls as follows:
dig perkel.com.rb.junkemailfilter.com - returns 127.0.0.1 dig perkel.co.uk.rb.junkemailfilter.com - returns 127.0.0.2
This is a service of Junk Email Filter dot com. One of many technologies used in advanced email filtering.
Exim Configuration
If you are running Exim you can use this as follows:
- This example calls rb_resolve as an ACL subroutine.
warn set acl_c_rb_query = $sender_host_name
acl = rb_resolve set acl_c_sender_host_domain = $acl_c_rb_result
rb_resolve:
# Separates the domain part of a hostname - ftp.perkel.com returns perkel.com # DNS lookup returns 127.0.0.1 for single level domains # DNS lookup returns 127.0.0.2 for two level domains # DNS lookup returns 127.0.0.3 for three level domains warn set acl_c_rb_result =
set acl_c_rb_query = ${lc:$acl_c_rb_query}
accept condition = ${if eq{$acl_c_rb_query}{}}
accept !dnslists = rb.junkemailfilter.com/$acl_c_rb_query
warn condition = ${if eq{$dnslist_value}{127.0.0.1}}
set acl_c_rb_result = ${sg{$acl_c_rb_query}{\N^(.*\.)?(.*\..*)$\N}{\$2}}
warn condition = ${if eq{$dnslist_value}{127.0.0.2}}
set acl_c_rb_result = ${sg{$acl_c_rb_query}{\N^(.*\.)?(.*\..*\..*)$\N}{\$2}}
warn condition = ${if eq{$dnslist_value}{127.0.0.3}}
set acl_c_rb_result = ${sg{$acl_c_rb_query}{\N^(.*\.)?(.*\..*\..*\..*)$\N}{\$2}}
accept