Vladimir_Shishk
May 19, 2021Altocumulus
Routing problem for connect() in iRule
Good day.
I have an iRule script which must send email via connect command through corporate Exchange server:
set conn [connect -timeout 3000 -idle 30 -status conn_status -myaddr 127.1.1.254 $mailserv]
set data "HELO\r\nMAIL FROM: $mailfrom\r\nRCPT TO: $email\r\nDATA\r\nSUBJECT: S3 rate limit exceeded 3000 bytes/s\r\nMIME-Version: 1.0;\r\nContent-Type: text/html;charset=iso-8859-1;\r\n\r\n\r\nRate limit exceeded for $mycookie\r\n\r\n.\r\nQUIT\r\n"
set send_info [send -timeout 3000 -status send_status $conn $data]
I can connect to 25 port of Exhange server in corresponding partition:
# telnet x.y.z.25 25 -b 127.1.1.254
Trying x.y.z.25...
Connected to x.y.z.25.
Escape character is '^]'.
220 ZZZZ Microsoft ESMTP MAIL Service ready at Wed, 19 May 2021 16:10:42 +0300
^C^]
But in LTM log I got the errors:
<CLIENT_CLOSED> - Connection failed for x.y.z.25:25 [Routing problem] (line 2) invoked from within "connect -timeout 3000 -idle 30 -status conn_status -myaddr 127.1.1.254"
What should I do to fix the problem?
Thank you.
Hi Vladimir,
Have you checked if the TMOS interfaces have access to the mailserver IP using TMOS routes? (Under "Network - Routes" in the GUI)
As the "telnet" command is run from the management side, it may use either the management interface or a TMOS interface for outbound traffic, whereas the iRules will only use TMOS interfaces for communication.
Here is more details on the (sometimes tricky) management routing; https://support.f5.com/csp/article/K13284
Hope this helps.