Fortinet white logo
Fortinet white logo

CLI Reference

mailsetting relay-host-list

mailsetting relay-host-list

Use this command to, if needed, configure the FortiMail unit's built-in MTA or proxy to relay outgoing mail through one or more SMTP relays.

For more information, see the FortiMail Administration Guide.

Outgoing mail relay settings will be ignored if either:

Syntax

config mailsetting relay-host-list

edit <name_str>

set relay-type {host | ip-group | mx-lookup}

set host-name {<mta_ipv4> | <mta_fqdn>}

set host-port <port_int>

set ip-group-profile <profile_name>

set mx-lookup-domain-name <domain_str>

set use-smtps {enable | disable}

set auth-status {enable | disable}

set auth-type {auto | plain | login | digest-md5 | cram‑md5 | ntlm}

set auth-username <user_str>

set auth-password <password_str>

end

Variable

Description

Default

<name_str>

Enter a unique name for the entry.

auth-password <password_str>

Enter the password of the FortiMail unit’s user account on the mail relay.

This setting applies if auth-status {enable | disable} is enable

auth-status {enable | disable}

Enable this setting if the mail relay requires SMTP authentication (ESMTP AUTH command). Then also configure auth-username <user_str>, auth-password <password_str>, and auth-type {auto | plain | login | digest-md5 | cram‑md5 | ntlm}.

disable

auth-type {auto | plain | login | digest-md5 | cram‑md5 | ntlm}

Select the type of SMTP authentication, either:

  • auto: Automatically detect and use the most secure SMTP authentication type supported by the relay server.

  • plain: Unencrypted, scrambled password.

  • login: Unencrypted, scrambled password.

  • digest-md5: Encrypted hash of the password.

  • cram‑md5: Encrypted hash of the password, with hash replay prevention, combined with a challenge and response mechanism.

  • ntlm: NT LAN Manager protocols with a hashed password.

This setting applies if auth-status {enable | disable} is enable

auto

auth-username <user_str>

Enter the name of the FortiMail unit’s user account on the mail relay.

This setting applies if auth-status {enable | disable} is enable

host-name {<mta_ipv4> | <mta_fqdn>}

Enter the FQDN or IP address of the mail relay.

This setting applies only if relay-type {host | ip-group | mx-lookup} is host.

host-port <port_int>

Enter the listening port number on the mail relay.

25

ip-group-profile <profile_name>

Enter an IP address group profile.

This setting applies only if relay-type {host | ip-group | mx-lookup} is ip-group.

mx-lookup-domain-name <domain_str>

Enter a domain name to look up its mail relays in the DNS MX record.

This setting applies only if relay-type {host | ip-group | mx-lookup} is mx-lookup.

relay-type {host | ip-group | mx-lookup}

Select how you will define the mail relays.

  • host: Configure the FQDN or IP address of one mail relay in host-name {<mta_ipv4> | <mta_fqdn>}.

  • mx-lookup: Query the DNS server’s MX record of the domain name in mx-lookup-domain-name <domain_str> for the FQDN or IP address of the mail relays. If there are multiple MX records, each connection will randomly select one of the mail relays (also called DNS load balancing).

  • ip-group: Configure the IP addresses of the mail relays in an IP address group that you select in ip-group-profile <profile_name>. If there are multiple IP addresses, each connection will use the next mail relay in the group (round robin load balancing algorithm).

host

use-smtps {enable | disable}

Enable to initiate SSL- and TLS-secured connections to the mail relay if it supports SSL/TLS.

When disabled, SMTP connections from the FortiMail unit’s built-in MTA or proxy to the mail relay will occur as clear text, unencrypted.

This option must be enabled to initiate SMTPS connections.

disable

Related topics

profile ip-address-group

system mailserver

mailsetting proxy-smtp

domain

mailsetting relay-host-list

mailsetting relay-host-list

Use this command to, if needed, configure the FortiMail unit's built-in MTA or proxy to relay outgoing mail through one or more SMTP relays.

For more information, see the FortiMail Administration Guide.

Outgoing mail relay settings will be ignored if either:

Syntax

config mailsetting relay-host-list

edit <name_str>

set relay-type {host | ip-group | mx-lookup}

set host-name {<mta_ipv4> | <mta_fqdn>}

set host-port <port_int>

set ip-group-profile <profile_name>

set mx-lookup-domain-name <domain_str>

set use-smtps {enable | disable}

set auth-status {enable | disable}

set auth-type {auto | plain | login | digest-md5 | cram‑md5 | ntlm}

set auth-username <user_str>

set auth-password <password_str>

end

Variable

Description

Default

<name_str>

Enter a unique name for the entry.

auth-password <password_str>

Enter the password of the FortiMail unit’s user account on the mail relay.

This setting applies if auth-status {enable | disable} is enable

auth-status {enable | disable}

Enable this setting if the mail relay requires SMTP authentication (ESMTP AUTH command). Then also configure auth-username <user_str>, auth-password <password_str>, and auth-type {auto | plain | login | digest-md5 | cram‑md5 | ntlm}.

disable

auth-type {auto | plain | login | digest-md5 | cram‑md5 | ntlm}

Select the type of SMTP authentication, either:

  • auto: Automatically detect and use the most secure SMTP authentication type supported by the relay server.

  • plain: Unencrypted, scrambled password.

  • login: Unencrypted, scrambled password.

  • digest-md5: Encrypted hash of the password.

  • cram‑md5: Encrypted hash of the password, with hash replay prevention, combined with a challenge and response mechanism.

  • ntlm: NT LAN Manager protocols with a hashed password.

This setting applies if auth-status {enable | disable} is enable

auto

auth-username <user_str>

Enter the name of the FortiMail unit’s user account on the mail relay.

This setting applies if auth-status {enable | disable} is enable

host-name {<mta_ipv4> | <mta_fqdn>}

Enter the FQDN or IP address of the mail relay.

This setting applies only if relay-type {host | ip-group | mx-lookup} is host.

host-port <port_int>

Enter the listening port number on the mail relay.

25

ip-group-profile <profile_name>

Enter an IP address group profile.

This setting applies only if relay-type {host | ip-group | mx-lookup} is ip-group.

mx-lookup-domain-name <domain_str>

Enter a domain name to look up its mail relays in the DNS MX record.

This setting applies only if relay-type {host | ip-group | mx-lookup} is mx-lookup.

relay-type {host | ip-group | mx-lookup}

Select how you will define the mail relays.

  • host: Configure the FQDN or IP address of one mail relay in host-name {<mta_ipv4> | <mta_fqdn>}.

  • mx-lookup: Query the DNS server’s MX record of the domain name in mx-lookup-domain-name <domain_str> for the FQDN or IP address of the mail relays. If there are multiple MX records, each connection will randomly select one of the mail relays (also called DNS load balancing).

  • ip-group: Configure the IP addresses of the mail relays in an IP address group that you select in ip-group-profile <profile_name>. If there are multiple IP addresses, each connection will use the next mail relay in the group (round robin load balancing algorithm).

host

use-smtps {enable | disable}

Enable to initiate SSL- and TLS-secured connections to the mail relay if it supports SSL/TLS.

When disabled, SMTP connections from the FortiMail unit’s built-in MTA or proxy to the mail relay will occur as clear text, unencrypted.

This option must be enabled to initiate SMTPS connections.

disable

Related topics

profile ip-address-group

system mailserver

mailsetting proxy-smtp

domain