Forum Discussion
jpavel
Jan 10, 2012Nimbostratus
iRule based on SMTP receiver domain
Hello iRule experts,
unfortunately I am an irule beginner and therefore I need some help.
One of our customers would like to direct traffic based on the SMTP receiver domain.
...
Colin_Walker_12
Jan 10, 2012Historic F5 Account
Unfortunately, given the way that SMTP works, there isn't a simple way to go about what you're looking for. The recipient is not sent in the first communication, rather it takes multiple responses from the server for the client to actually send the data you're looking to route based on. This means that you have to impersonate the server within the iRule, and replay all necessary requests from the client to the server once you've selected a server. This, as you can imagine, gets complex.
The iRule that nitass posted the link to is doing pretty much exactly what you're looking for, routing based on domain. It is complex though, you're right, and would need thorough testing to ensure it didn't cause problems in your environment. If you were looking to route on something exceedingly simple like an HTTP host or the like, that would be a no brainer. Unfortunately given the intricacies of SMTP there is only so much simplification that we can offer.
Hopefully that helps explain the situation, at least, even if it doesn't offer you a simpler solution.
Colin
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