Fortinet black logo

CLI Reference

smtptest

smtptest

Use this command to test SMTP connectivity to a specified host.

Syntax

execute smtptest {<fqdn_str> | <host_ipv4>}[:<port_int>] [domain <domain_str>]

Variable

Description

Default

{<fqdn_str> | <host_ipv4>}

Enter the IP address or fully qualified domain name (FQDN) of the SMTP server.

[:<port_int>]

If the SMTP server listens on a port number other than port 25, enter a colon (:) followed by the port number.

:25

[domain <domain_str>]

If you want to test the connection from an IP address in the protected domain’s IP pool, enter the name of the protected domain.

Example

This example tests the connection to an SMTP server at 192.168.1.10 on port 2525. For the outgoing connection, the FortiMail unit uses the source IP address 192.168.1.20 from the IP pool selected in the protected domain example.com.

execute smtptest 192.168.1.10:2525 domain example.com

The CLI displays the following:

(using 192.168.1.20 to connect)

Remote Output:

220 fortimail.example.com ESMTP Smtpd; Mon, 19 Jan 2009

13:27:35 -0500

Connection Status:

Connecting to remote host succeeded.

Related topics

telnettest

traceroute

ping

system dns

smtptest

Use this command to test SMTP connectivity to a specified host.

Syntax

execute smtptest {<fqdn_str> | <host_ipv4>}[:<port_int>] [domain <domain_str>]

Variable

Description

Default

{<fqdn_str> | <host_ipv4>}

Enter the IP address or fully qualified domain name (FQDN) of the SMTP server.

[:<port_int>]

If the SMTP server listens on a port number other than port 25, enter a colon (:) followed by the port number.

:25

[domain <domain_str>]

If you want to test the connection from an IP address in the protected domain’s IP pool, enter the name of the protected domain.

Example

This example tests the connection to an SMTP server at 192.168.1.10 on port 2525. For the outgoing connection, the FortiMail unit uses the source IP address 192.168.1.20 from the IP pool selected in the protected domain example.com.

execute smtptest 192.168.1.10:2525 domain example.com

The CLI displays the following:

(using 192.168.1.20 to connect)

Remote Output:

220 fortimail.example.com ESMTP Smtpd; Mon, 19 Jan 2009

13:27:35 -0500

Connection Status:

Connecting to remote host succeeded.

Related topics

telnettest

traceroute

ping

system dns