Technical Forum
Ask questions. Discover Answers.
Showing results for 
Search instead for 
Did you mean: 

Email address domain change using irule


Can any one provide inputs that how to write an iRule for the email domain change. No changes required on the sender name.


Sender email address:

To be changed:

Can this be supported using an iRule.



@user_1701 Is this for emails originating from the F5 or originating from some other device which has traffic traverse the F5 as its gateway to the internet?

@Paulius - Its is orginating from some other device. F5 VIP is used for them to load balance the traffic between mail servers.

This sounds like an issue that the F5 should not be used for... a) train users or fix client systems to use the correct email or b) put in rewrite login at email server you are load balancing to.


@user_1701 I am in agreenment with @whisperer that the F5 should not be used for this purpose. This overcomplicates the configuration and when troubleshooting occurs in the future this will most likely be overlooked and cause even further delays when something needs to be fixed as soon as possible. Just because the F5 can do it doesn't mean it should do it. So the source device isn't something that you control or that it is even a mail server? You really need to speak with the end user that wants this adjustment and have them explain why the source device cannot be corrected to show the correct souce email.

@whisperer @Paulius - Yes. Thats right. Currently thers is an ongoing migration for changing it permanently on the mail server. Until it's completed we need interim solution in F5 to get the domain changed.

It would be best to tell the business or application team that this is not supported 😉 Force them to migrate faster, and I am serious.

- There is an option to rewrite domain from F5 generated emails:
- However, you are hosting an SMTP Virtual Server and flowing this traffic through the F5 BIG-IP to load balanced backend email servers, right?
-- The SMTP service profile is limited in options, mostly focusing on security and protocol enforcement.
-- Any attempt to change the domain text in traffic email, would require implementing an SMTP proxy via iRules ( or stream profiles ( If you are using encrypted SMTP, then this becomes even more interesting.

This is not trivial, it would be kludgy, and would be a royal PITA to troubleshoot. I would suggest F5 professional services here for CYA in case of any outages due to untested or difficult to test code from this community site. If anyone else knows of an EASY button here, please chime in as I would be intersted.... I think the EASY button would be a) pay for professional services (and the business doesnt like to spend more money, so the migration will be faster, lol) or b) simply tell them you cannot implement this easily without a business risk.