I want to know if my server establishes a connection to a remote server or if the remote server tries to reach my server. I tried to read the output of lsof
and obtain this information:
lsof -i TCP:25
USER FD TYPE DEVICE SIZE/OFF NODE NAME
master 2657 root 12u IPv4 8086 0t0 TCP *:smtp (LISTEN)
smtpd 12950 postfix 6u IPv4 8086 0t0 TCP *:smtp (LISTEN)
smtpd 12950 postfix 9u IPv4 35762406 0t0 TCP hostname:smtp->spe.cif.ic.IP:55277 (ESTABLISHED)
smtp 13007 postfix 13u IPv4 35762309 0t0 TCP hostname:34434->fake.VVVVV.fr:smtp (ESTABLISHED)
smtpd 14188 postfix 6u IPv4 8086 0t0 TCP *:smtp (LISTEN)
smtpd 14188 postfix 9u IPv4 35748921 0t0 TCP hostname:smtp->XX.XX.XX.XX:55912 (ESTABLISHED)
smtpd 14897 postfix 6u IPv4 8086 0t0 TCP *:smtp (LISTEN)
I'd like to know if this information means that my server tries to connect to spe.cif.ic.IP
or if it's the other way around.
Is the sign ->
relevant, or I should use a different command?