silver78
Oct 16, 2019Nimbostratus
add IP client for SMTP in v13.1: stream::replace not working
HI
I try to add the client IP source in the SMTP stream by using this code but it seems the Stream::replace does not work.
Could you help please ?
output:
220 server1 Frontend
ehlo
250-server Hello 10.1.2.3
250-SIZE
250 XRDST
desired output
220 server1 Frontend
ehlo
250-server Hello Client addr: 4.5.6.7
250-SIZE
250 XRDST
code
when STREAM_MATCHED {
set server [string tolower [STREAM::match]]
if {$server contains "10.1.2.3"} {
STREAM::replace "10.1.2.3/Client_IP\:[IP::client_addr]"
STREAM::disable
log local0. "Client addr: IP::client_addr]"
}
}