Forum Discussion
X-Forwarded Rule for SMTP
Hi, did you ever get this script working? Does the source IP appear in the SMTP-header and can you see it with Wireshark like with an XFF? I just ran a test with the above script and I'm not seeing any changes in the SMTP header...
- Misty_SpillersJan 24, 2019
Nimbostratus
I never got it working. On my system it just hangs smtp. This is the script I ended up with but I don't really have a dev background, Just correct syntax/spelling and adjusted for have route domains on my system
when CLIENT_ACCEPTED { set caddr [getfield [IP::client_addr] % 1] log local0. "Client addr: $caddr" STREAM::expression {@^EHLO.*\r\n@@ @^HELO.*\r\n@@} STREAM::enable } when STREAM_MATCHED { set mstring [STREAM::match] log local0. "STREAM_MATCHED: string: $mstring" set replacement [string range $mstring 0 1] append replacement "LO $caddr\r\n" log local0. "STREAM_MATCHED: replacement string: $replacement" STREAM::replace "$mstring $replacement" event STREAM_MATCHED disable } - timvd_372046Jan 28, 2019
Nimbostratus
The above did not work when sending actual mails it breaks the flow. I have now used this code: https://devcentral.f5.com/questions/irule-for-smtp-passing-client-ip-addr-to-backend-mail-servers and now everything seems to work fine in my lab setup. Have not been able to test in a bigger environment to see the possible impact.
- Stefan_EngelApr 21, 2020
Cirrus
Hi, can you may post the code which worked for you? The link above doesnt work/anymore.
Thanks
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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