Forum Discussion
Richard__Harlan
Nov 15, 2005Historic F5 Account
SMTP Sensitivity Tag
What we are looking at doing is make LB desision based on the SMTP Sensitivity Tag. If the Tag is marked Confidential then we will send the client to PGP mail gateways, other wise the BigIp will send ...
Richard__Harlan
Nov 17, 2005Historic F5 Account
Ok I have writen the First part of my irule to load balance based on STMP Sensitivity. Right now the Rule is trying to act like a STMP server. Below is the RULE is there a simpler way of doing this? Also the varable ::tcpdata how will it act when this is rule is rule mutiple times at the same time?
I will add the LD logic and the server connection latter, still testing the SMTP gateway part first. As a side tought I was thinking we could use this STMP rule as a honypot for SPAM and log information about the source and use it to build better spam filters. Thanks
when RULE_INIT {
set ::tcpdata ""
}
when CLIENT_ACCEPTED {
set ::tcpdata ""
TCP::respond "220 fdpnmailgw2.mailgws.com SMTP Relay Service ready\n\r"
TCP::collect
}
when CLIENT_DATA {
if { $::tcpdata starts_with "EHLO"} {
TCP::respond "250-fdpnmailgw2.thehouseofspam.com Hello\r\n"
TCP::respond "250-DSN\r\n"
TCP::respond "250 SIZE 52428800\r\n"
set servername $::tcpdata
set ::tcpdata ""
log "Servername = $servername"
}
if { $::tcpdata contains "MAIL FROM:" }{
TCP::respond "250 OK\r\n"
set mailfrom $::tcpdata
set ::tcpdata ""
set rec "1"
log "Mail from = $mailfrom"
}
if { $::tcpdata contains "RCPT TO:" } {
if Rec = 1 this is the mail to line
if { $rec == "1" } {
set mailto $::tcpdata
set rec "2"
set ::tcpdata ""
log "mail to: $mailto"
if rec = 2 this is the CC line
} elseif { $rec == "2" } {
set mailcc $::tcpdata
set rec "3"
set ::tcpdata ""
log "mail cc: $mailcc"
if mail =3 this is the BCC line
} elseif { $rec == "3" } {
set mailbcc $::tcpdata
set rec "4"
set ::tcpdata ""
log "mail bcc: $mailbcc"
}
TCP::respond "250 OK\r\n"
}
if { $::tcpdata == "DATA" } {
TCP::respond "354 Start mail input; end with .\r\n"
set ::tcpdata ""
log "ready for DATA"
}
if { $::tcpdata == ".\r\n" } {
set data $::tcpdata
TCP::respond "250 OK - Data received"
set ::tcpdata ""
log "data = $data"
}
if { $::tcpdata == "QUIT" } {
TCP::respond "221 fdpnmailgw2.thehouseofspam.com Service closing connection"
set ::tcpdata ""
}
if { [TCP::payload] == "\r\n" } {
} else {
set temp_payload [TCP::payload]
set ::tcpdata $::tcpdata$temp_payload
}
TCP::release
TCP::collect
}
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