Forum Discussion
st0n3_87491
Nimbostratus
Aug 13, 2009Persistence based on IMAP-User
Hi there,
as topic say I would like to have a persistence to a node based on his IMAP-Userlogin.
I managed to find out this using a stream Profile and wrote this iRule so far:
whe...
Nat_Thirasuttakorn
Employee
Aug 27, 2009you may try this...
this irule uses a lot of shortcut. it assumes that client just makes tcp connection and send capability command. For simplicity, the capability command is tripped off and is not forwarded to server.
when CLIENT_ACCEPTED {
TCP::respond "* BIG-IMAP ready\r\n"
set state "capability"
assume client will send capability as next command
TCP::collect
}
when CLIENT_DATA {
switch $state {
"capability" {
TCP::respond "* CAPABILITY IMAP4 IMAP4rev1 IDLE LITERAL+ LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE AUTH=NTLM\r\na0000 OK CAPABILITY completed.\r\n"
set state "login"
assume client will send login as next command
TCP::payload replace 0 [TCP::payload length] ""
TCP::collect
}
"login" {
find username and make load balancing decision here
log local0.alert "[TCP::payload]"
TCP::release
}
}
}
you may have to change capability message (the specific line below) to match your server. Dont forget to put \r\n (or CRLF) as necessary.
TCP::respond "* CAPABILITY .... "
Nat
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