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 access-control <profile_name>
set block-encrypted {enable | disable}
set bypass-bounce-verification {enable | disable}
set check-client-ip-quick {enable | disable}
set conn-blocklisted {enable | disable}
set conn-concurrent <connections_int>
set conn-hidden {enable | disable}
set conn-idle-timeout <timeout_int>
set conn-total <connections_int>
set dkim-signing {enable | disable}
set dkim-signing-authenticated-only {enable | disable}
set dkim-validation {enable | disable}
set domain-key-validation {enable | disable}
set email-queue {default | incoming | no-preference | outgoing}
set endpoint-reputation {enable | disable}
set endpoint-reputation-action {reject | monitor}
set endpoint-reputation-blocklist-duration <duration_int>
set endpoint-reputation-blocklist-trigger <trigger_int>
set eom-ack {enable | disable}
set error-drop-after <errors_int>
set error-penalty-increment <penalty-increment_int>
set error-penalty-initial <penalty-initial_int>
set error-penalty-threshold <threshold_int>
set fortiguard-ip-check-mode {as-profile | as-profile-no-auth | client-connect | disable}
set limit-max-header-size <limit_int>
set limit-max-message-size <limit_int>
set limit-recipient <limit_int>
set number-of-messages <limit_int>
set number-of-recipients <limit_int>
set recipient-blocklist-status {enable | disable}
set recipient-rewrite-map <profile_name>
set recipient-safelist-status {enable | disable}
set remove-current-headers {enable | disable}
set remove-headers {enable | disable}
set remove-received-headers {enable | disable}
set sender-blocklist-status {enable | disable}
set sender-reputation-reject-score <threshold_int>
set sender-reputation-status {enable | disable}
set sender-reputation-tempfail-score <threshold_int>
set sender-reputation-throttle-number <rate_int>
set sender-reputation-throttle-percentage <percentage_int>
set sender-reputation-throttle-score <threshold_int>
set sender-rewrite-map <profile_name>
set sender-safelist-status {enable | disable}
set sender-verification {enable | disable}
set sender-verification-profile <profile_name>
set session-3way-check {enable | disable}
set session-action <content-action_profile>
set session-action-msg-type {accepted | all}
set session-allow-pipelining {yes | no}
set session-command-checking {enable | disable}
set session-disallow-encrypted {enable | disable}
set session-helo-char-validation {enable | disable}
set session-helo-domain-check {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-prevent-open-relay {enable | disable}
set session-recipient-domain-check {enable | disable}
set session-reject-empty-domain {enable | disable}
set session-sender-domain-check {enable | disable}
set spf-validation {enable | disable}
set splice-status {enable | disable}
set splice-threshold
set splice-unit {seconds | kilobytes}
config header-removal-list
edit <header-key_str>
next
config recipient-blocklist
edit <block-recipient-address_str>
next
config recipient-safelist
edit <safe-recipient-address_str>
next
config sender-blocklist
edit <block-sender-address_str>
next
config sender-safelist
edit <safe-sender-address_str>
next
end
next
end
Variable |
Description |
Default |
Enter the name of the session profile. |
|
|
Enter a message header key such as This setting applies only if remove-headers {enable | disable} is enabled. |
|
|
Enter a blocklisted recipient email address. This setting applies only if recipient-blocklist-status {enable | disable} is enabled. |
|
|
Enter a safelisted recipient email address. This setting applies only if recipient-safelist-status {enable | disable} is enabled. |
|
|
Enter a blocklisted sender email address. This setting applies only if sender-blocklist-status {enable | disable} is enabled. |
|
|
Enter a safelisted sender email address. This setting applies only if sender-safelist-status {enable | disable} is enabled. |
|
|
Enter an access control profile to be used in a session profile. Note: This feature is only available as part of the MTA advanced control feature. See mta-adv-ctrl-status {enable | disable} |
|
|
Enable or disable blocking of TLS/MD5 commands so that email must pass unencrypted. Email must not be encrypted in order for the FortiMail unit to scan the email for viruses and spam. This option applies only if the FortiMail unit is operating in transparent mode. |
disable |
|
Select to, if bounce verification is enabled, omit verification of bounce address tags on incoming bounce messages. This bypass does not omit bounce address tagging of outgoing email. Alternatively, you can omit bounce verification with a per-domain setting. See bypass-bounce-verification {enable | disable}. For information on enabling bounce address tagging and verification (BATV), see antispam bounce-verification. |
disable |
|
Enable to query the FortiGuard Antispam Service to determine if the IP address of the SMTP server is blocklisted. This action will happen during the connection phase. In an antispam profile, you can also enable FortiGuard block-IP checking. But that action happens after the entire message has been received by FortiMail. Therefore, if this feature is enabled in a session profile and the action is reject, the performance will be improved. |
disable |
|
Enable to prevent clients from using SMTP servers that have been blocklisted in antispam profiles or, if enabled, the FortiGuard AntiSpam service. This option applies only if the FortiMail unit is operating in transparent mode. |
disable |
|
Enter a limit to the number of concurrent connections per SMTP client. Additional connections are rejected. To disable the limit, enter |
0 |
|
Select either:
This option applies only if the FortiMail unit is operating in transparent mode. For more information about the proxies and built-in MTA transparency, see the FortiMail Administration Guide. Note: Unless you have enabled exclusive {enable | disable}, the per-domain hide option (tp-hidden {no | yes} ) has precedence over this option, and may prevent it from applying to incoming email messages. Note: For full transparency, also set the per-domain hide option (tp-hidden {no | yes} ) to |
disable |
|
Enter a limit to the number of seconds a client may be inactive before the FortiMail unit drops the connection. Set the value between 5-1200. |
30 |
|
This is a rate limit to the number of messages sent per client IP address per time interval (the default value is 30 minutes). You set the time interval using the command:
end To disable the limit, enter |
0 |
|
Enter a limit to the total number of concurrent connections from all sources. To disable the limit, enter |
0 |
|
Enable to sign outgoing email with a DKIM signature. This option 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. For details on generating domain key pairs and publishing the public key, see the FortiMail Administration Guide. |
disable |
|
Enable to sign outgoing email with a DKIM signature only if the sender is authenticated. This option is available only if dkim-signing is |
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 if the DNS record for the domain name of the sender lists DomainKeys. An unauthorized client IP address increases the client sender reputation score. An authorized client IP address decreases the client sender reputation score. If the DNS record for the domain name of the sender does not publish DomainKeys information, the FortiMail unit omits the DomainKeys client IP address validation. |
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. |
|
Enter the email queue to use for the matching sessions. Note: This feature is only available as part of the MTA advanced control feature. See mta-adv-ctrl-status {enable | disable} |
no-preference |
|
Enable to accept, monitor, or reject email based upon endpoint reputation scores. This option is designed for use with SMTP clients with dynamic IP addresses. It requires that your RADIUS server provide mappings between dynamic IP addresses and MSISDNs/subscriber IDs to the FortiMail unit. If this profile governs sessions of SMTP clients with static IP addresses, instead consider sender-reputation-status {enable | disable}. |
disable |
|
Select either:
|
reject |
|
Enter the number of minutes that an MSISDN/subscriber ID will be prevented from sending email or MMS messages after they have been automatically blocklisted. |
0 |
|
Enter the MSISDN reputation score over which the FortiMail unit will add the MSISDN/subscriber ID to the automatic blocklist. The trigger score is relative to the period of time configured as the automatic blocklist window. |
5 |
|
Enable to acknowledge the end of message ( If the FortiMail unit has not yet completed antispam scanning by the time that four (4) minutes has elapsed, it will return SMTP reply code 451( |
disable |
|
Enter the total number of errors the FortiMail unit will accept before dropping the connection. |
5 |
|
Enter the number of seconds by which to increase the delay for each error after the first delay is imposed. |
1 |
|
Enter the delay penalty in seconds for the first error after the number of “free" errors is reached. |
1 |
|
Enter the number of number of errors permitted before the FortiMail unit will penalize the SMTP client by imposing a delay. |
1 |
|
fortiguard-ip-check-mode {as-profile | as-profile-no-auth | client-connect | disable} |
Specify the FortiGuard IP reputation check mode:
|
as-profile |
Enter the limit of Enter 0 to reset to the default value. |
10 |
|
Enter the limit of To disable the limit, enter |
20 |
|
Enter the limit of email messages per session to prevent mass mailing. To disable the limit, enter |
10 |
|
Enter the limit of SMTP greetings that a connecting SMTP server or client can perform before the FortiMail unit terminates the connection. Restricting the number of SMTP greetings allowed per session makes it more difficult for spammers to probe the email server for vulnerabilities, as a greater number of attempts results in a greater number of terminated connections, which must then be re-initiated. Enter 0 to reset to the default value. |
3 |
|
Enter the limit of the message header size. If enabled, messages with headers over the threshold size are rejected. |
32 |
|
Enter the limit of message size in kilobytes (KB) . If enabled, messages over the threshold size are rejected. Note: If both this option and max-message-size <limit_int> in the protected domain are enabled, email size will be limited to whichever size is smaller. |
10240 |
|
Enter the limit of recipients to prevent mass mailing. |
500 |
|
Enter a mail routing profile to be used in a session profile. |
|
|
Enter the number of message per client per time interval. To disable the limit, enter To set the time interval, see session-profile-rate-control-interval <minutes_int>. |
30 |
|
Enter the number of recipients per client per time interval. To disable the limit, enter Then set the time interval using session-profile-rate-control-interval <minutes_int>. |
30 |
|
Enable to use an envelope recipient ( |
disable |
|
Enter an address rewrite profile to be used in a session profile. Note: This feature is only available as part of the MTA advanced control feature. See mta-adv-ctrl-status {enable | disable} |
|
|
Enable to use an envelope recipient ( |
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. Note: 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 unit, except Note: For backwards compatibility, if you upgrade the firmware and both of the related settings remove-headers {enable | disable} and remove-received-headers {enable | disable} were enabled, then this setting will be enabled by default. |
enable |
|
Enable to remove other configured headers from email messages. Enable to remove other headers that have been inserted by other MTAs (not this FortiMail), then configure which headers should be removed in <header-key_str>. |
disable |
|
Enable to remove all Alternatively, you can remove this header with a per-domain setting. For details, see remove-outgoing-received-header {enable | disable}. |
disable |
|
Enable to use an envelope sender ( |
disable |
|
Enter a sender reputation score over which the FortiMail unit will return a rejection error code when the SMTP client attempts to initiate a connection. This option applies only if sender-reputation-status {enable | disable} is enabled. |
80 |
|
Enable to reject email based upon sender reputation scores. |
disable |
|
Enter a sender reputation score over which the FortiMail unit will return a temporary failure error code when the SMTP attempts to initiate a connection. This option applies only if sender-reputation-status {enable | disable} is enabled. |
55 |
|
Enter the maximum number of email messages per hour that the FortiMail unit will accept from a throttled SMTP client. |
5 |
|
Enter the maximum number of email messages per hour that the FortiMail unit will accept from a throttled SMTP client, as a percentage of the number of email messages that the sender sent during the previous hour. |
1 |
|
Enter the sender reputation score over which the FortiMail unit will rate limit the number of email messages that can be sent by this SMTP client. 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 sender-reputation-status {enable | disable} is enabled. |
15 |
|
Enter an address rewrite profile to be used in a session profile. Note: This feature is only available as part of the MTA advanced control feature. See mta-adv-ctrl-status {enable | disable} |
|
|
Enable to use an envelope sender ( |
disable |
|
Enable sender address verification with LDAP. |
disable |
|
Select the LDAP profile to use for sender address verification. |
|
|
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 check only affects unauthenticated sessions. |
disable |
|
Select a content action profile to apply upon session policy match. |
|
|
Define the message type to take session action. |
all |
|
Select one of the following behaviors for ESMTP command pipelining, which causes some SMTP commands to be accepted and processed as a batch, increasing performance over high-latency connections. When set to This option is available for gateway, server, and transparent mode. |
yes |
|
Enable to return SMTP reply code 503, rejecting the SMTP command, if the client or server uses SMTP commands that are syntactically incorrect.
In the following example, the invalid commands are 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:<user1@example.com> 503 5.0.0 Need MAIL before RCPT |
disable |
|
Enable to block TLS/MD5 commands so that email must pass unencrypted, enabling the FortiMail unit to scan the email for viruses and spam. Clear to pass TLS/MD5 commands, allowing encrypted email to pass. The FortiMail unit cannot scan encrypted email for viruses and spam. This option applies only if the FortiMail unit is operating in transparent mode. |
disable |
|
Enable to return SMTP reply code 501, rejecting 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 genuine, valid domain name. If this option is enabled, such connections are rejected. In the following example, the invalid command is highlighted 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, rejecting 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 genuine, valid domain name. If this option is enabled, such connections are rejected. In the following example, the invalid command is highlighted 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 domain characters include:
|
disable |
|
Enable to rewrite the This option applies only if the FortiMail unit is operating in transparent mode. |
disable |
|
Enable to rewrite the This option applies only if the FortiMail unit is operating in transparent mode. |
disable |
|
Enter the replacement text for the |
|
|
Enable to block unauthenticated outgoing connections to unprotected mail servers in order to prevent clients from using open relays to send email. If clients from your protected domains are permitted to use open relays to send email, email from your domain could be blocklisted by other SMTP servers. This feature:
|
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 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 check only affects unauthenticated sessions. |
disable |
|
Enable to return SMTP reply code 553, rejecting the SMTP command, if a domain name does not follow the “@" symbol in the sender email address. Because the sender address is invalid and therefore cannot receive delivery status notifications (DSN), you may want to disable this feature. In the following example, the invalid command is highlighted in bold: 220 FortiMail-400.localdomain ESMTP Smtpd; Wed, 14 Feb 2007 14:48:32 GMT EHLO example.com 250-FortiMail-400.localdomain Hello [192.168.171.217], pleased to meet you MAIL FROM:<john@> 553 5.1.3 <john@>... Hostname required This check only affects unauthenticated sessions. |
disable |
|
Enable o 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 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. |
disable |
|
Enable to, if the sender domain DNS record lists SPF authorized IP addresses, compare the client IP address to the IP addresses of authorized senders in the DNS record. An unauthorized client IP address increases the client sender reputation score. An authorized client IP address decreases the client sender reputation score. If the DNS record for the domain name of the sender does not publish SPF information, the FortiMail unit omits the SPF client IP address validation. |
disable |
|
Enable to permit splicing. Splicing enables the FortiMail unit to simultaneously scan an email and relay it to the SMTP server. This increases throughput and reduces the risk of a server timeout. If the FortiMail unit detects spam or a virus, it terminates the server connection and returns an error message to the sender, listing the spam or virus name and infected file name. This option applies only if the FortiMail unit is operating in transparent mode. |
disable |
|
<integer> |
Enter a threshold value to switch to splice mode based on time (seconds) or data size (kilobytes) using splice-unit {seconds | kilobytes}. This option applies only if the FortiMail unit is operating in transparent mode. |
0 |
Enter the time (seconds) or data size (kilobytes) for the This option applies only if the FortiMail unit is operating in transparent mode. |
seconds |