Forum Discussion
kraigk_52257
Apr 23, 2011Nimbostratus
SMTP STARTTLS iRule
I need help with getting a STARTTLS iRule working for SMTP on our 1600's. We are on version 10.2.1. And to be clear it is working but there are a few tweaks I can't figure out. The main issue is ...
asharicz_6648
Jun 08, 2011Nimbostratus
Well for crying out loud it looks like the "quick reply" works, so here it is:
when CLIENT_ACCEPTED {
set ehlo 0
SSL::disable
}
when SERVER_CONNECTED {
TCP::collect
}
when CLIENT_DATA {
set lcpayload [string tolower [TCP::payload]]
if { not ( $lcpayload contains "\r\n" ) } {
return
}
if { $lcpayload starts_with "ehlo" } {
set ehlo 1
serverside { TCP::collect }
TCP::release
TCP::collect
}
if { $lcpayload starts_with "starttls" } {
TCP::respond "220 Ready to start TLS\r\n"
TCP::payload replace 0 [TCP::payload length] ""
TCP::release
SSL::enable
} else {
TCP::release
}
}
when SERVER_DATA {
if { $ehlo == 1 and not([string tolower [TCP::payload]] contains "starttls") } {
TCP::payload replace 0 0 "250-STARTTLS\r\n"
}
TCP::release
clientside { 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