Forum Discussion
bman_12685
Jun 01, 2012Nimbostratus
smtp irule for access control
Hello,
I am trying to either preserve the source ip information so that existing smtp rules and greylists continue to work but ensure fault tolerance by placing smtp servers befind an f5 vip, I have a test pair of f5's and have tried the following
setup vip with irule posted below
when CLIENT_ACCEPTED {
if { [matchclass [IP::remote_addr] equals smtp_relay_allowed] } {
pool mail_pool
} else {
reject
}
}
the part that says "equals smtp_relay_allowed" is a data group list which has the ip ranges for some of my networks.
the behavior is that it is simply rejecting connections when the irule is in place if a telnet connection is issued to the lb, this would seem to be in line with the rule since it would connect to the lb and then since have the src ip of the lb reject the connection however is there a way to verify this? is this type of rule being used or is there a better way?
- hooleylistCirrostratusHi bman,
- hooleylistCirrostratusAre you saying that when you tested from a client IP in the smtp_relay_allowed data group, the connection was reset? Can you add a debug statement with the client IP?
when CLIENT_ACCEPTED { log local0. "[IP::client_addr]:[TCP::client_port]: Connection to [virtual name] [IP::local_addr]:[TCP::local_port]" if { not [matchclass [IP::remote_addr] equals smtp_relay_allowed] } { log local0. "[IP::client_addr]:[TCP::client_port]: Rejecting client IP" reject } }
- bman_12685Nimbostratusactually it looks like it may be working have to test more but for debugging i am doing this variation of it
- bman_12685Nimbostratusbasically I have a new rule set that implements a whitelist, a blacklist and a greylist however one part I am missing is the dnsrbl ability in milter-greylist that now I have to figure out any one have any ideas?
when RULE_INIT { set static::debug 1 } when CLIENT_ACCEPTED { if { [class match [IP::remote_addr] equals smtp_relay_allowed ] } { log local0. "Node IP address is: [IP::remote_addr] whitelisted as smtp_relay_allowed" snatpool smtp_mailpool } if { [class match [IP::remote_addr] equals smtp_spambot_reject] } { log local0. "Node IP address is: [IP::remote_addr] rejecting due to data group smtp_spambot_reject" reject } else { snatpool untrust_smtp_mailpool } }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects