niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Apps » Exim
Rejecting connections based on IP range.
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Evil Ernie
*nix forums beginner


Joined: 09 Jun 2006
Posts: 3

PostPosted: Thu Jul 20, 2006 8:54 pm    Post subject: Rejecting connections based on IP range. Reply with quote

I'm trying to reject certain connections based upon the IP range they're in.
I have this in my SMTP Mail ACL:

#====================================================================#
# DENY problem RANGES #
#====================================================================#
deny
message = Call email admin xxx xxx-xxxx \
- Error_local_rejection
hosts = ${if exists \

{/etc/exim4/_databases/_special_reject_R.rtf}\

{/etc/exim4/_databases/_special_reject_R.rtf}{}}
delay = 30s
logwrite = Special_rejection $sender_host_address

The file that it references is a regular file with 105 entries such as:
63.145.183.0/24
63.145.188.0/24
63.218.48.0/24

Most of the time it works fine. But I'm still seeing email being delivered
despite the range being listed there. I'm running Exim 4.5 on Debian Sarge
but I've written the exim4.conf file myself so it has none of the default
Debian entries.

Is there a more efficent method of comparing IP's to ranges or is there some
other problem/solution?

TIA
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Back to top
Tony Finch
*nix forums Guru


Joined: 22 Mar 2002
Posts: 1222

PostPosted: Thu Jul 20, 2006 10:54 pm    Post subject: Re: Rejecting connections based on IP range. Reply with quote

On Thu, 20 Jul 2006, Evil Ernie wrote:

Quote:
I'm trying to reject certain connections based upon the IP range they're in.

Most of the time it works fine. But I'm still seeing email being delivered
despite the range being listed there.

Do you have any accept clauses before the deny clause?

Quote:
Is there a more efficent method of comparing IP's to ranges or is there some
other problem/solution?

You can use the net24- prefix on a search type keyword (e.g. net24-dbm is
mentioned in the spec) if all your ranges are the same size. It gets
painful if they have variables sizes.

Tony.
--
<fanf@exim.org> <dot@dotat.at> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Back to top
Evil Ernie
*nix forums beginner


Joined: 09 Jun 2006
Posts: 3

PostPosted: Fri Jul 21, 2006 2:24 am    Post subject: Re: Rejecting connections based on IP range. Reply with quote

On 7/20/06, Tony Finch <dot@dotat.at> wrote:
Quote:


Do you have any accept clauses before the deny clause?


None that would apply to those addresses. Just the regular "accept
everything to postmaster" but that doesn't apply to these messages.

You can use the net24- prefix on a search type keyword (e.g. net24-dbm is
Quote:
mentioned in the spec) if all your ranges are the same size. It gets
painful if they have variables sizes.


Thanks! I was hoping there might be a way to get them all in one, but I can
have the broken up it that's how is goes.

PS: great email address.
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 8:56 pm | All times are GMT
navigation Forum index » Apps » Exim
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Add BCC Based on Email Subject adoner Postfix 0 Tue Mar 18, 2008 6:12 pm
No new posts Rejecting non-existant users Matthias Exim 0 Fri Jul 21, 2006 12:00 pm
No new posts Home based Internet research Jobs honey PHP 0 Fri Jul 21, 2006 11:29 am
No new posts Bug#379087: ITP: libcomplearn -- data-compression based i... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 7:40 am
No new posts porting linux2.6 on ARM922T based board noor.fatma@gmail.com embedded 0 Fri Jul 21, 2006 6:23 am

Credit Card | Verizon Ringtones | Mortgage Calculator | Current Accounts | Payday Loan
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1727s ][ Queries: 16 (0.0943s) ][ GZIP on - Debug on ]