Forum Discussion
Thomas_Schaefer
Nimbostratus
Apr 23, 2009Make a Dummy SMTP server in an iRule?
I have a need to create a dummy SMTP server in an iRule. My thought was to use the SMTP proxy iRule and instead of forward the messages on to the SMTP server to discard them.
I am trying to do thi...
Thomas_Schaefer
Nimbostratus
Apr 24, 2009Thanks! That worked with just some minor modifications. My client tries to send EHLO and expects that response. All I did was reject the EHLO with a 500 error and it sends back the HELO command. I also had to respond to QUIT with a 221. Here is the updated code:
switch -glob [string toupper [TCP::payload]] {
DATA* {
set respond "354 Start mail input; end with .\r\n"
set data 1
}
EHLO* {
set respond "500 Syntax error, command unrecognized\r\n"
}
QUIT* {
set respond "221 Bye\r\n"
}
default {
set respond "250 Ok\r\n"
}
}
Also, Can you tell me what the second TCP::collect is doing in the client_data event. My guess is that is how to make sure we never try to send the data to anything beyond, but it seemed like the whole thing would hang with that.
I tested this with no server and I ever removed the pool from my virtual server. Thanks again for the help.
Tom Schaefer
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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