Fortinet white logo
Fortinet white logo

CLI Reference

profile antispam-action

profile antispam-action

Use this command to configure antispam action profiles.

Syntax

config profile antispam-action

edit <profile_name>

[set comment "<comment_str>"]

set subject-tagging-status {enable | disable}

set subject-tagging-text "<tag_str>"

set header-insertion-status {enable | disable}

config header-insertion-list

edit header-insertion-name <name_str>

set header-insertion-value "<header_str>"

next

end

set disclaimer-insertion {enable | disable}

set disclaimer-insertion-location {beginning | end}

set disclaimer-insertion-content <message_name>

set alternate-host-status {enable | disable}

set alternate-host {<relay_fqdn> | <relay_ipv4>}

set deliver-to-original-host {enable | disable}

set fortiguard-antispam-outbreak {enable | disable}

set defer-delivery {enable | disable}

set bcc-status {enable | disable}

set bcc-addr <recipient_email>

set bcc-env-from-status {enable | disable}

set bcc-env-from-addr <message_str>

set archive-status {enable | disable}

set archive-account <account_name>

set notification-status {enable | disable}

set notification-profile <profile_name>

set action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine}

set quarantine-notify {enable | disable}

set quarantine-notify-profile <profile_name>

set quarantine-folder "<path_str>"

set rewrite-rcpt-local-type {none | prefix | replace | suffix}

set rewrite-rcpt-local-value <value_str>

set rewrite-rcpt-domain-type {none-prefix | replace | suffix}

set rewrite-rcpt-domain-value <value_str>

end

Variable

Description

Default

<profile_name>

Enter the name of an antispam action profile.

action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine}

Enter an action for the profile.

  • discard:Accept the email, but then delete it instead of delivering the email, without notifying the SMTP client.

  • domain-quarantine: Redirect spam to the per-domain quarantine. This option is only available with a valid advanced management feature license.

  • none: Apply any configured header or subject line tags, if any.

  • personal-quarantine: For incoming email, enable to redirect the email to the recipient’s personal quarantine.

    For outgoing email, this action will fall back to the system quarantine.

  • reject: Reject the email and reply to the SMTP client with SMTP reply code 550.

  • rewrite-rcpt:Change the recipient address. Configure rewrites separately for the local-part (the portion of the email address before the '@' symbol, typically a user name) and the domain part (the portion of the email address after the '@' symbol).

  • If you enter this option, also configure rewrite-rcpt-local-type {none | prefix | replace | suffix}, rewrite-rcpt-local-value <value_str>, rewrite-rcpt-domain-type {none-prefix | replace | suffix}, and rewrite-rcpt-domain-value <value_str>.

  • system-quarantine: Redirect the email to the system quarantine.

See also information about final vs. non-final actions and quarantines.

none

alternate-host {<relay_fqdn> | <relay_ipv4>}

Type the fully qualified domain name (FQDN) or IP address of the alternate relay or SMTP server.

This field applies only if alternate-host-status is enable.

alternate-host-status {enable | disable}

Enable to route the email to a specific SMTP server or relay. Also configure alternate-host {<relay_fqdn> | <relay_ipv4>}.

Note: If you enable this setting, for all email that matches the profile, FortiMail will use this destination and ignore mailsetting relay-host-list and the protected domain’s tp-use-domain-mta {yes | no} setting.

disable

archive-account <account_name>

Type the email archive account name where you want to archive the spam.

For more information about archive accounts, see archive policy.

archive-status {enable | disable}

Enable to allow the archive-account <account_name> function to work.

disable

bcc-addr <recipient_email>

Type the blind carbon copy (BCC) recipient email address.

This field applies only if bcc-status is enable.

bcc-env-from-addr <message_str>

Specify an envelope from BCC address. In the case that email is not deliverable and bounced back, the email is returned to the specified envelope from address instead of the original sender. This is helpful when you want to use a specific email to collect bounce notifications.

This setting applies only if bcc-env-from-addr <message_str> is enable.

bcc-env-from-status {enable | disable}

Enable to specify an envelope from address.

disable

bcc-status {enable | disable}

Enable to send a BCC of the email. Also configure bcc-addr <recipient_email>.

disable

comment "<comment_str>"

Enter a description or comment.

defer-delivery {enable | disable}

Enable to defer delivery of emails that may be resource intensive and reduce performance of the mail server, such as large email messages, or lower priority email from certain senders (for example, marketing campaign email and mass mailing).

disable

deliver-to-original-host {enable | disable}

Enable to deliver the message to the original host.

disable

disclaimer-insertion {enable | disable}

Enable to insert a disclaimer. See also disclaimer-insertion {selected-message | all-message}.

disable

disclaimer-insertion-content <message_name>

Enter the name of the disclaimer to insert.

default

disclaimer-insertion-location {beginning | end}

Select whether to insert the disclaimer at the start or end of the email.

beginning

fortiguard-antispam-outbreak {enable | disable}

Enable to manually defer emails and place email in the spam defer queue.

Note: The Spam outbreak protection option under System > FortiGuard > AntiSpam does not affect this feature.

disable

header-insertion-name <name_str>

Enter the message header key, such as X-Custom-Header. Do not enter the colon ( : ) after the key.

Note: Do not enter spaces in the header key. These are forbidden by RFC 2822.

header-insertion-status {enable | disable}

Enable to add message headers to the email before forwarding it to the recipient.

Many email clients can sort incoming email messages into separate mailboxes based on text appearing in various parts of email messages, including the message header. For details, see the documentation for your email client.

Message header lines are composed of two parts: a key (name) and a value, which are separated by a colon, such as:

X-Custom-Header: Spam detected by profile 22.

Also configure header-insertion-name <name_str> and header-insertion-value "<header_str>".

disable

header-insertion-value "<header_str>"

Enter the message header value.

notification-profile <profile_name>

Type the name of the notification profile used for sending notifications.

notification-status {enable | disable}

Enable to send a notification about the detection. Also configure notification-profile <profile_name>.

disable

quarantine-folder "<path_str>"

Enter the location of the quarantine folder.

This setting is available if action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine} is system-quarantine or domain-quarantine.

disable

quarantine-notify {enable | disable}

Enable to quarantine and also notify the recipient about the action.

This setting is available if action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine} is system-quarantine or domain-quarantine.

disable

quarantine-notify-profile <profile_name>

Enter the name of a notification profile.

This setting is available if action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine} is system-quarantine or domain-quarantine.

rewrite-rcpt-local-type {none | prefix | replace | suffix}

Change the local part (the portion of the email address before the '@' symbol, typically a user name) of the recipient address of any email message detected as spam.

none

rewrite-rcpt-local-value <value_str>

Enter the text for the option (except none) that you chose in rewrite-rcpt-local-type {none | prefix | replace | suffix}.

rewrite-rcpt-domain-type {none-prefix | replace | suffix}

Change the domain part (the portion of the email address after the '@' symbol) of the recipient address of any email message detected as spam.

none

rewrite-rcpt-domain-value <value_str>

Enter the text for the option (except none) you choose in rewrite-rcpt-domain-type {none-prefix | replace | suffix}.

subject-tagging-status {enable | disable}

Enable to prepend text defined using subject-tagging-text "<tag_str>" ("tag") to the subject line on detected virus.

disable

subject-tagging-text "<tag_str>"

Enter the text that will appear in the subject line of the email, such as "[VIRUS] ". The FortiMail unit will prepend this text to the subject line of virus before forwarding it to the recipient.

Related topics

profile antispam

mailsetting preference

profile antispam-action

profile antispam-action

Use this command to configure antispam action profiles.

Syntax

config profile antispam-action

edit <profile_name>

[set comment "<comment_str>"]

set subject-tagging-status {enable | disable}

set subject-tagging-text "<tag_str>"

set header-insertion-status {enable | disable}

config header-insertion-list

edit header-insertion-name <name_str>

set header-insertion-value "<header_str>"

next

end

set disclaimer-insertion {enable | disable}

set disclaimer-insertion-location {beginning | end}

set disclaimer-insertion-content <message_name>

set alternate-host-status {enable | disable}

set alternate-host {<relay_fqdn> | <relay_ipv4>}

set deliver-to-original-host {enable | disable}

set fortiguard-antispam-outbreak {enable | disable}

set defer-delivery {enable | disable}

set bcc-status {enable | disable}

set bcc-addr <recipient_email>

set bcc-env-from-status {enable | disable}

set bcc-env-from-addr <message_str>

set archive-status {enable | disable}

set archive-account <account_name>

set notification-status {enable | disable}

set notification-profile <profile_name>

set action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine}

set quarantine-notify {enable | disable}

set quarantine-notify-profile <profile_name>

set quarantine-folder "<path_str>"

set rewrite-rcpt-local-type {none | prefix | replace | suffix}

set rewrite-rcpt-local-value <value_str>

set rewrite-rcpt-domain-type {none-prefix | replace | suffix}

set rewrite-rcpt-domain-value <value_str>

end

Variable

Description

Default

<profile_name>

Enter the name of an antispam action profile.

action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine}

Enter an action for the profile.

  • discard:Accept the email, but then delete it instead of delivering the email, without notifying the SMTP client.

  • domain-quarantine: Redirect spam to the per-domain quarantine. This option is only available with a valid advanced management feature license.

  • none: Apply any configured header or subject line tags, if any.

  • personal-quarantine: For incoming email, enable to redirect the email to the recipient’s personal quarantine.

    For outgoing email, this action will fall back to the system quarantine.

  • reject: Reject the email and reply to the SMTP client with SMTP reply code 550.

  • rewrite-rcpt:Change the recipient address. Configure rewrites separately for the local-part (the portion of the email address before the '@' symbol, typically a user name) and the domain part (the portion of the email address after the '@' symbol).

  • If you enter this option, also configure rewrite-rcpt-local-type {none | prefix | replace | suffix}, rewrite-rcpt-local-value <value_str>, rewrite-rcpt-domain-type {none-prefix | replace | suffix}, and rewrite-rcpt-domain-value <value_str>.

  • system-quarantine: Redirect the email to the system quarantine.

See also information about final vs. non-final actions and quarantines.

none

alternate-host {<relay_fqdn> | <relay_ipv4>}

Type the fully qualified domain name (FQDN) or IP address of the alternate relay or SMTP server.

This field applies only if alternate-host-status is enable.

alternate-host-status {enable | disable}

Enable to route the email to a specific SMTP server or relay. Also configure alternate-host {<relay_fqdn> | <relay_ipv4>}.

Note: If you enable this setting, for all email that matches the profile, FortiMail will use this destination and ignore mailsetting relay-host-list and the protected domain’s tp-use-domain-mta {yes | no} setting.

disable

archive-account <account_name>

Type the email archive account name where you want to archive the spam.

For more information about archive accounts, see archive policy.

archive-status {enable | disable}

Enable to allow the archive-account <account_name> function to work.

disable

bcc-addr <recipient_email>

Type the blind carbon copy (BCC) recipient email address.

This field applies only if bcc-status is enable.

bcc-env-from-addr <message_str>

Specify an envelope from BCC address. In the case that email is not deliverable and bounced back, the email is returned to the specified envelope from address instead of the original sender. This is helpful when you want to use a specific email to collect bounce notifications.

This setting applies only if bcc-env-from-addr <message_str> is enable.

bcc-env-from-status {enable | disable}

Enable to specify an envelope from address.

disable

bcc-status {enable | disable}

Enable to send a BCC of the email. Also configure bcc-addr <recipient_email>.

disable

comment "<comment_str>"

Enter a description or comment.

defer-delivery {enable | disable}

Enable to defer delivery of emails that may be resource intensive and reduce performance of the mail server, such as large email messages, or lower priority email from certain senders (for example, marketing campaign email and mass mailing).

disable

deliver-to-original-host {enable | disable}

Enable to deliver the message to the original host.

disable

disclaimer-insertion {enable | disable}

Enable to insert a disclaimer. See also disclaimer-insertion {selected-message | all-message}.

disable

disclaimer-insertion-content <message_name>

Enter the name of the disclaimer to insert.

default

disclaimer-insertion-location {beginning | end}

Select whether to insert the disclaimer at the start or end of the email.

beginning

fortiguard-antispam-outbreak {enable | disable}

Enable to manually defer emails and place email in the spam defer queue.

Note: The Spam outbreak protection option under System > FortiGuard > AntiSpam does not affect this feature.

disable

header-insertion-name <name_str>

Enter the message header key, such as X-Custom-Header. Do not enter the colon ( : ) after the key.

Note: Do not enter spaces in the header key. These are forbidden by RFC 2822.

header-insertion-status {enable | disable}

Enable to add message headers to the email before forwarding it to the recipient.

Many email clients can sort incoming email messages into separate mailboxes based on text appearing in various parts of email messages, including the message header. For details, see the documentation for your email client.

Message header lines are composed of two parts: a key (name) and a value, which are separated by a colon, such as:

X-Custom-Header: Spam detected by profile 22.

Also configure header-insertion-name <name_str> and header-insertion-value "<header_str>".

disable

header-insertion-value "<header_str>"

Enter the message header value.

notification-profile <profile_name>

Type the name of the notification profile used for sending notifications.

notification-status {enable | disable}

Enable to send a notification about the detection. Also configure notification-profile <profile_name>.

disable

quarantine-folder "<path_str>"

Enter the location of the quarantine folder.

This setting is available if action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine} is system-quarantine or domain-quarantine.

disable

quarantine-notify {enable | disable}

Enable to quarantine and also notify the recipient about the action.

This setting is available if action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine} is system-quarantine or domain-quarantine.

disable

quarantine-notify-profile <profile_name>

Enter the name of a notification profile.

This setting is available if action {discard | domain-quarantine | none | personal-quarantine | reject | rewrite-rcpt | system-quarantine} is system-quarantine or domain-quarantine.

rewrite-rcpt-local-type {none | prefix | replace | suffix}

Change the local part (the portion of the email address before the '@' symbol, typically a user name) of the recipient address of any email message detected as spam.

none

rewrite-rcpt-local-value <value_str>

Enter the text for the option (except none) that you chose in rewrite-rcpt-local-type {none | prefix | replace | suffix}.

rewrite-rcpt-domain-type {none-prefix | replace | suffix}

Change the domain part (the portion of the email address after the '@' symbol) of the recipient address of any email message detected as spam.

none

rewrite-rcpt-domain-value <value_str>

Enter the text for the option (except none) you choose in rewrite-rcpt-domain-type {none-prefix | replace | suffix}.

subject-tagging-status {enable | disable}

Enable to prepend text defined using subject-tagging-text "<tag_str>" ("tag") to the subject line on detected virus.

disable

subject-tagging-text "<tag_str>"

Enter the text that will appear in the subject line of the email, such as "[VIRUS] ". The FortiMail unit will prepend this text to the subject line of virus before forwarding it to the recipient.

Related topics

profile antispam

mailsetting preference