profile session
Use this command to create session profiles.
While, like antispam profiles, session profiles protect against spam, session profiles focus on the connection and envelope portion of the SMTP session, rather than the message header, body, or attachments.
Similar to access control rules or delivery rules, session profiles control aspects of sessions in an SMTP connection.
Syntax
config profile session
edit <profile_name>
set conn-rate-number <connections_int>
set number-of-messages <limit_int>
set number-of-recipients <limit_int>
set conn-concurrent <connections_int>
set conn-idle-timeout <timeout_int>
set conn-hidden {enable | disable}
set conn-blocklisted {enable | disable}
set sender-reputation-status {enable | disable}
set sender-reputation-throttle-score <threshold_int>
set sender-reputation-throttle-number <rate_int>
set sender-reputation-throttle-percentage <percentage_int>
set sender-reputation-tempfail-score <threshold_int>
set sender-reputation-reject-score <threshold_int>
set fortiguard-ip-check-mode {as-profile | as-profile-no-auth | client-connect | disable}
set endpoint-reputation {enable | disable}
set endpoint-reputation-action {reject | monitor}
set endpoint-reputation-blocklist-trigger <trigger_int>
set endpoint-reputation-blocklist-duration <duration_int>
set spf-validation {enable | disable | bypass}
set dkim-validation {enable | disable}
set dkim-signing {enable | disable}
set dkim-signing-authenticated-only {enable | disable}
set domain-key-validation {enable | disable}
set bypass-bounce-verification {enable | disable}
set sender-verification {enable | disable}
set sender-verification-profile <profile_name>
set session-action <content-action_profile>
set session-action-msg-type {accepted | all}
set session-helo-char-validation {enable | disable}
set session-helo-rewrite-clientip {enable | disable}
set session-helo-rewrite-custom {enable | disable}
set session-helo-rewrite-custom-string <helo_str>
set session-disallow-encrypted {enable | disable}
set block-encrypted {enable | disable}
set session-allow-pipelining {yes | no}
set splice-status {enable | disable}
set splice-threshold <threshold_int>
set splice-unit {seconds | kilobytes}
set session-command-checking {enable | disable}
set eom-ack {enable | disable}
set session-helo-domain-check {enable | disable}
set session-sender-domain-check {enable | disable}
set session-recipient-domain-check {enable | disable}
set session-reject-empty-domain {enable | disable}
set session-prevent-open-relay {enable | disable}
set session-3way-check {enable | disable}
set limit-recipient <limit_int>
set limit-max-message-size <limit_int>
set limit-max-header-size <limit_int>
set error-penalty-threshold <threshold_int>
set error-penalty-initial <penalty-initial_int>
set error-penalty-increment <penalty-increment_int>
set error-drop-after <errors_int>
set remove-received-headers {enable | disable}
set remove-headers {enable | disable}
config header-removal-list
edit <header-key_str>
next
set remove-current-headers {enable | disable}
set sender-safelist-status {enable | disable}
config sender-safelist
edit <safe-sender-address_str>
next
end
set sender-blocklist-status {enable | disable}
config sender-blocklist
edit <block-sender-address_str>
next
end
set recipient-safelist-status {enable | disable}
config recipient-safelist
edit <safe-recipient-address_str>
next
end
set recipient-blocklist-status {enable | disable}
config recipient-blocklist
edit <block-recipient-address_str>
next
end
set email-queue {default | incoming | no-preference | outgoing}
set sender-rewrite-map <profile_name>
set recipient-rewrite-map <profile_name>
set access-control <profile_name>
set bounce-rule <dsn-profile_name>
next
end
|
Variable |
Description |
Default |
||||||||
|
Enter a blocklisted recipient email address. This setting applies only if |
|
|||||||||
|
Select which delivery status notification (DSN) profile, if any, to use if email delivery is delayed. This setting is available only if |
|
|||||||||
|
Enter a blocklisted sender email address. This setting applies only if |
|
|||||||||
|
Enter a message header name (key) such as Multiple similar headers can be matched by using a regular expression pattern (see FortiMail regular expression syntax, except character classes that use a colon such as .^$*+?{}[]\\|()
Otherwise FortiMail compares with a simple literal match. This setting applies only if |
|
|||||||||
|
Enter the name of the session profile. |
|
|||||||||
|
Enter a safelisted recipient email address. This setting applies only if |
|
|||||||||
|
Enter a safelisted sender email address. This setting applies only if |
|
|||||||||
|
Enter an access control profile to be used in a session profile. This feature is only available as part of the MTA advanced control feature. See mta-adv-ctrl-status {enable | disable} |
|
|||||||||
|
Enable to block PGP and S/MIME encrypted messages.
|
disable |
|||||||||
|
Enable to omit verification of bounce address tags on incoming bounce messages. Alternatively, you can enable For information on enabling bounce address tagging and verification (BATV), see antispam bounce-verification.
|
disable |
|||||||||
|
Enable to prevent clients from connecting to SMTP servers that have been blocklisted in antispam profiles or, if it is enabled, by This setting applies only in transparent mode and if you have enabled |
disable |
|||||||||
|
Enter the maximum number of concurrent connections per SMTP client IP address. Additional connections are rejected. Valid range is 0 to 4294967295. To disable the limit, enter |
2 |
|||||||||
|
Select either:
See also information about the proxies and transparency of the FortiMail built-in MTA. This setting applies if the FortiMail system is operating in transparent mode.
|
disable |
|||||||||
|
Enter the number of seconds a client may be idle before the FortiMail system drops the connection. Valid range is 5 to 1200. |
30 |
|||||||||
|
Enter the maximum number of concurrent connections per SMTP client IP address during each interval. Additional connections are rejected. Valid range is 0 to 4294967295. To disable the limit, enter
|
1200 |
|||||||||
|
Enable to sign outgoing email with a DKIM signature only if the sender is authenticated. This setting is available only if |
disable |
|||||||||
|
Enable to sign outgoing email with a DKIM signature. Also configure This setting requires that you first generate a domain key pair and publish the public key in the DNS record for the domain name of the protected domain. If you do not publish the public key, destination SMTP servers will not be able to validate your DKIM signature. See also details on generating domain key pairs on FortiMail and publishing the public key and |
disable |
|||||||||
|
Enable to, if a DKIM signature is present, query the DNS server that hosts the DNS record for the sender’s domain name to retrieve its public key to decrypt and verify the DKIM signature. An invalid signature increases the client sender reputation score and affect the deep header scan. A valid signature decreases the client sender reputation score. If the sender domain DNS record does not include DKIM information or the message is not signed, the FortiMail unit omits the DKIM signature validation. |
disable |
|||||||||
|
Enable to validate the DomainKeys signature. DomainKeys is a predecessor of DKIM and works in the same way. Because some domains still use DomainKeys validation, it is provided for backward compatibility. |
disable |
|||||||||
|
email-addr-rewrite-options |
Specify which elements of the sender and recipient addresses to rewrite. For more details, see the session profile section in the FortiMail Administration Guide. |
|
||||||||
|
Select which email queue to use for matching sessions. This feature is only available as part of the MTA advanced control feature. See mta-adv-ctrl-status {enable | disable} |
no-preference |
|||||||||
|
Select either:
This setting applies if |
reject |
|||||||||
|
Enter the number of minutes that This setting applies if |
0 |
|||||||||
|
Enter the MSISDN reputation score that will trigger the FortiMail system to add the MSISDN or subscriber ID to the automatic endpoint reputation blocklist. Scores are increated by various factors such as failing sender validation. Spam detections older than the interval window are not included in the score. The interval of time configured in This setting applies if |
5 |
|||||||||
|
Enable to accept, monitor, or reject email based upon endpoint reputation scores. Your RADIUS server must provide mappings between dynamic IP addresses and MSISDNs/subscriber IDs to the FortiMail system. This setting is designed for use with SMTP clients with dynamic IP addresses. For static IP addresses, instead use
|
disable |
|||||||||
|
Enable to acknowledge the end of message ( If the FortiMail system does not complete antispam scanning within 4 minutes, it returns SMTP reply code |
disable |
|||||||||
|
Enter the maximum number of errors that the FortiMail system accepts before dropping the connection. Valid range is 0 to 4294967295. To disable the limit, enter |
5 |
|||||||||
|
Enter the number of seconds by which to increase the delay for each error after Delays continue to increase until the connection completes or reaches |
1 |
|||||||||
|
Enter the delay in seconds for the first error after |
1 |
|||||||||
|
Enter the number of errors permitted before the FortiMail system starts to penalize the client with delays. Valid range is 0 to 4294967295. To disable the limit, enter |
1 |
|||||||||
|
fortiguard-ip-check-mode {as-profile | as-profile-no-auth | client-connect | disable} |
Select when during the SMTP connection to perform the FortiGuard IP reputation check and which settings to use, either:
When a FortiGuard IP reputation check occurs, the FortiMail system asks if the public IP address of the SMTP client is blocklisted. If the SMTP client IP address is a private one (and therefore may not be globally unique), then the first public IP address in the This setting applies only if |
as-profile |
||||||||
|
Enter the limit of email messages per session to prevent mass mailing. Valid range is 0 to 4294967295. To disable the limit, enter |
10 |
|||||||||
|
Enter the limit of SMTP greetings. Valid range is 0 to 4294967295. To disable the limit, enter Restricting the number of SMTP greetings allowed per session makes it more difficult for spammers to probe the email server for vulnerabilities (more attempts results in a greater number of terminated connections, which must then be re-initiated). |
3 |
|||||||||
|
Enter the size limit in kilobytes (KB) of the message headers. Valid range is 1 to 102400. |
32 |
|||||||||
|
Enter the size limit in kilobytes (KB) of the message. Valid range is 1 to 302700.
|
10240 |
|||||||||
|
Enter the limit of Some spammers use SMTP |
10 |
|||||||||
|
Enter the limit of recipients to prevent mass mailing. Valid range is 0 to 4294967295. To disable the limit, enter |
500 |
|||||||||
|
Enter the limit of Some spammers use SMTP |
20 |
|||||||||
|
Enter a mail routing profile to be used in a session profile. |
|
|||||||||
|
Enter the maximum number of email messages (determined by the number of senders in the SMTP envelope (
|
0 |
|||||||||
|
Enter the maximum number of recipients (determined by the SMTP envelope (
|
0 |
|||||||||
|
Enable to check the recipient addresses in the SMTP envelope ( |
disable |
|||||||||
|
Enter an address rewrite profile to be used in a session profile. This feature is only available as part of the MTA advanced control feature. See mta-adv-ctrl-status {enable | disable} |
|
|||||||||
|
Enable to check the recipient addresses in the SMTP envelope (
|
disable |
|||||||||
|
Enter the name of a remote logging profile.The remote logging profiles used here are the same as the system-wide remote logging profiles. This feature is only available as part of the MTA advanced control feature. See mta-adv-ctrl-status {enable | disable} |
|
|||||||||
|
Enable to remove the headers that are inserted by this FortiMail system, except
|
enable |
|||||||||
|
Enable to remove other specified message headers that have been inserted by other MTAs. Also configure |
disable |
|||||||||
|
Enable to remove all Alternatively, you can remove this header with the per-domain setting |
disable |
|||||||||
|
Enable to check the sender addresses in the SMTP envelope ( |
disable |
|||||||||
|
Enter a sender reputation score over which the FortiMail system will reject the email and reply to the SMTP client with SMTP reply code 550 when the SMTP client attempts to initiate a connection. Valid range is 0 to 100. To disable the limit, enter This setting applies only if |
80 |
|||||||||
|
Enable to accept or reject email based upon sender reputation scores. Also configure Tip: Sender reputation may not function well for SMTP clients with dynamic IP addresses. Instead, consider |
disable |
|||||||||
|
Enter a sender reputation score over which the FortiMail system will return a temporary failure error when the SMTP client attempts to initiate a connection. Valid range is 0 to 100. To disable the limit, enter This setting applies only if |
50 |
|||||||||
|
Enter the maximum number of email messages per hour that the FortiMail system will accept from a throttled SMTP client. Valid range is 0 to 4294967295. This setting applies only if |
5 |
|||||||||
|
Enter the maximum number of email messages per hour that the FortiMail system will accept from a throttled SMTP client, as a percentage of the number of email messages that the SMTP client sent during the previous hour. Valid range is 0 to 100. This setting applies only if |
1 |
|||||||||
|
Enter a sender reputation score over which FortiMail will rate limit the number of email messages that can be sent by this SMTP client. Valid range is 0 to 100. To disable the limit, enter The enforced rate limit is either The enforced rate limit is either sender-reputation-throttle-number <rate_int> or sender-reputation-throttle-percentage <percentage_int> whichever value is greater. This setting applies only if |
35 |
|||||||||
|
Enter an address rewrite profile to be used in a session profile. This feature is only available as part of the MTA advanced control feature. See mta-adv-ctrl-status {enable | disable} |
|
|||||||||
|
Enable to check the sender addresses in the SMTP envelope ( Caution: Use safe lists and block lists with caution. They can increase incorrect results. For example, a session safe list entry for |
disable |
|||||||||
|
Select which LDAP profile to use for sender address verification. This setting applies if |
|
|||||||||
|
Enable to validate sender email addresses with a query an LDAP server. Also configure |
disable |
|||||||||
|
Enable to reject the email if the domain name in the SMTP greeting ( Mismatching domain names is sometimes used by spammers to mask the true identity of their SMTP client. This setting only affects unauthenticated sessions. Note: Do not enable this setting if you have Microsoft 365 and need to send email to other Microsoft 365 tenants (private or business). |
disable |
|||||||||
|
Select whether to apply
|
all |
|||||||||
|
Select which content action profile to apply to the email that you select in |
|
|||||||||
|
Select the behavior for ESMTP command pipelining, either:
Note: Pipelining may also occur implicitly, even if an email server or FortiMail does not explicitly say that it supports pipelining. See smtp-eom-bare-lf-handling {allow | disallow | ignore}. |
yes |
|||||||||
|
Enable to return an SMTP reply code (the number may vary) rejecting the SMTP command if the client or server uses SMTP commands that have syntax errors, such as:
In the following example, the invalid command is highlighted in bold: 220 FortiMail-400.localdomain ESMTP Smtpd; Wed, 14 Feb 2008 13:41:15 GMT EHLO example.com 250-FortiMail-400.localdomain Hello [192.168.1.1], pleased to meet you RCPT TO:user@example.com 553 5.1.2 user@example.com... Invalid email address |
disable |
|||||||||
|
Enable to block This setting applies only in transparent mode. Caution: Disable this setting only if you trust that SMTP clients connecting using TLS through the FortiMail system will not be sources of viruses or spam. FortiMail systems operating in transparent mode cannot scan encrypted sessions. See also profile tls. |
disable |
|||||||||
|
Enable to return SMTP reply code 501, and to reject the SMTP greeting, if the client or server uses a greeting that contains a domain name with invalid characters. To avoid disclosure of a real domain name, spammers sometimes spoof an SMTP greeting domain name with random characters, rather than using a valid domain name. The following example shows invalid command in bold: 220 FortiMail-400.localdomain ESMTP Smtpd; Wed, 14 Feb 2008 13:30:20 GMT EHLO ^^&^&^#$ 501 5.0.0 Invalid domain name Valid characters for domain names include:
|
disable |
|||||||||
|
Enable to return SMTP reply code 501, and reject the SMTP command, if the domain name accompanying the SMTP greeting is not a domain name that exists in either DNS MX or A records. In the following example, the invalid command is highlighted in bold: 220 FortiMail-400.localdomain ESMTP Smtpd; Wed, 14 Feb 2008 14:32:51 GMT EHLO example.com This setting only affects unauthenticated sessions. |
disable |
|||||||||
|
Enable to rewrite the domain name in the SMTP greeting ( This setting applies only if the FortiMail system is operating in transparent mode. |
disable |
|||||||||
|
Enter the replacement text for the This setting applies only if the FortiMail system is operating in transparent mode, and if |
|
|||||||||
|
Enable to rewrite the domain name in the SMTP greeting ( This setting applies only if the FortiMail system is operating in transparent mode. |
disable |
|||||||||
|
Enable to prevent SMTP clients from using open relays to send email by blocking unauthenticated sessions in outgoing connections. (Unauthenticated sessions are assumed to be occurring with an open relay.) If SMTP clients use open relays to send email, email from their protected domain could be blocklisted by recipient SMTP servers. This setting is used only if proxy-original {enable | disable} is This setting is available only if FortiMail system is operating in transparent mode. |
disable |
|||||||||
|
Enable to return SMTP reply code 550, rejecting the SMTP command, if the domain name portion of the recipient address is not a domain name that exists in either DNS MX or A records. In the following example, the invalid command is highlighted in bold: 220 FortiMail-400.localdomain ESMTP Smtpd; Wed, 14 Feb 2008 14:48:32 GMT EHLO example.com 250-FortiMail-400.localdomain Hello [192.168.1.1], pleased to meet you MAIL FROM:<user1@fortinet.com> 250 2.1.0 <user1@fortinet.com>... Sender ok RCPT TO:<user2@example.com> 550 5.7.1 <user2@example.com>... Relaying denied. IP name lookup failed [192.168.1.1] This setting only affects unauthenticated sessions. |
disable |
|||||||||
|
Enable to return an SMTP reply code (the number varies), and reject the SMTP command, if the sender domain is empty in either:
The following example shows the invalid command highlighted in bold: 220 FortiMail-400.localdomain ESMTP Smtpd; Wed, 20 Nov 2013 10:42:07 -0500 EHLO 250-FortiMail-400.localdomain Hello [172.20.140.195], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 10485760 250-DSN 250-AUTH LOGIN PLAIN 250-STARTTLS 250-DELIVERBY 250 HELP MAIL FROM:user@example.com 550 5.5.0 Empty EHLO/HELO domain. quit 221 2.0.0 FortiMail-400.localdomain closing connection This setting only affects unauthenticated sessions. |
disable |
|||||||||
|
Enable to return SMTP reply code 421, rejecting the SMTP command, if the domain name portion of the sender address is not a domain name that exists in either DNS MX or A records. In the following example, the invalid command is highlighted in bold: 220 FortiMail-400.localdomain ESMTP Smtpd; Wed, 14 Feb 2008 14:32:51 GMT EHLO 250-FortiMail-400.localdomain Hello [192.168.1.1], pleased to meet you MAIL FROM:<user1@example.com> 421 4.3.0 Could not resolve sender domain. This setting only affects unauthenticated sessions. |
disable |
|||||||||
|
Select either:
See also spf-checking {enable | disable} and spf-perm-error-as-failure {enable | disable}. |
disable |
|||||||||
|
Enable to use splice mode once an SMTP session reaches the threshold. Also configure Splice mode lets the FortiMail system simultaneously scan an email and relay it to the SMTP server. This increases throughput and reduces the risk of server timeout. If FortiMail detects spam or a virus, it terminates the server connection and returns an error message to the sender with the spam or virus name and infected file name. This setting applies only if the FortiMail system is operating in transparent mode. |
disable |
|||||||||
|
Enter a threshold value to switch to splice mode based on time (seconds) or data size (kilobytes) using This setting applies only if the FortiMail system is operating in transparent mode. |
0 |
|||||||||
|
Enter the time (seconds) or data size (kilobytes) for This setting applies only if the FortiMail system is operating in transparent mode. |
seconds |