Fortinet white logo
Fortinet white logo

CLI Reference

customized-message

customized-message

Use this command to customize text.

Customizable messages are used in many places, such as FortiMail GUI login pages, rejection messages, IBE messages, disclaimers, email templates, and other system-related messages.

There is a limit of 8191 characters for each custom message.

Syntax

config customized-message

edit <type_name>

config variable

edit %%<variable_name>%%

set display-name "<gui-label_str>"

set content "<text_str>"

next

end

config {email-template | message}

edit {<email-template_name> | <message_name>}

set status {enable | disable}

[set description "<comment_str>"]

set env-from <sender_email>

set env-to <recipient_email>

set from <sender_email>

set to <recipient_email>

set subject "<text_str>"

set subject-tag-status {enable | disable}

set subject-tag "<text_str>"

set header-insertion-status {enable | disable}

set header-name <key_str>

set header-value "<text_str>"

set location {beginning | end}

set format {html | multiline | text}

set disclaimer-convert-text-to-html-status {enable | disable}

set disclaimer-preview-orig-msg-status {enable | disable}

set content "<text_str>"

set html-body "<text_str>"

set text-body "<text_str>"

next

end

next

end

Variable

Description

Default

%%<variable_name>%%

Enter the variable name to use in the custom message.

For example, if you enter %%COMPANY-NAME%%, also use that same text in the custom message if you insert it. This is also the name of the variable as it appears in the CLI. (The GUI uses display-name "<gui-label_str>" instead.)

Many predefined variables exist, and you cannot edit their values or rename them. Variables cannot be reused in other messages or email templates. For a list of predefined variables and which templates they can be used in, see the FortiMail Administration Guide.

{<email-template_name> | <message_name>}

Enter the name of the email template or message.

Valid inputs are usually only existing names; you cannot create a new entry. Exceptions include types where new messages can be configured and selected, such as disclaimers.

For example, if <type_name> is disclaimer-insertion, then you may want to configure multiple disclaimer messages.

{email-template | message}

Select a type that matches what you entered in <type_name>, either:

  • message — Text labels used in the administrator or webmail user GUI, or inside an email for disclaimers or to explain when content or attachments were blocked.
  • email-template — An email template.

Settings inside this sub-command vary by this selection.

<type_name>

Enter the name of a message that you want to customize, such as alert-email or disclaimer-insertion.

Many predefined message types exist. To display the full list of options, enter:

edit ?

content "<text_str>"

Enter the value of the variable or custom message.

description "<comment_str>"

Enter a comment or description.

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disclaimer-convert-text-to-html-status {enable | disable}

Enable if either:

Plain text email (MIME type text/plain) does not support HTML formatting. If you disable this setting, and the disclaimer is formatted with HTML such as colors and hyperlinks, then plain text email will show the raw HTML code instead of your formatting.

Multipart email is not effected.

This setting applies only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disable

disclaimer-preview-orig-msg-status {enable | disable}

Enable if you want the preview to use the original message's content. In email clients such as Microsoft Outlook, Apple Mail on iOS, and FortiMail webmail, message preview text appears in the message list and/or notification banners.

Disable if you want the preview to start with the disclaimer. Original contents may still appear after the disclaimer if the disclaimer is short, depending on how much text the email client shows for the preview.

This setting applies only if location {beginning | end} is beginning, and if {<email-template_name> | <message_name>} is disclaimer-insertion.

Note: This setting is ignored if both:

(HTML is required to control display of the preview.)

This setting is also ignored if the disclaimer is applied by an antispam action profile, antivirus action profile, or content action profile, and that disclaimer-insertion-location {beginning | end} setting is end. (Message previews only show the first few lines of an email, so they usually do not include disclaimers at the end.)

disable

display-name "<gui-label_str>"

Enter a label that will appear in the variable list when you click Insert Variables in the GUI while customizing a message or creating a variable. For example, you could enter CompanyName for the variable %%COMPANY-NAME%%.

env-from <sender_email>

Enter the sender email address (MAIL FROM:) that will be used in the SMTP envelope. You can either enter text directly, or insert a variable such as %%ORIG_ENVELOPE_FROM%%.

This setting is available only for email templates.

env-to <recipient_email>

Enter the recipient email address (MAIL TO:) that will be used in the SMTP envelope. You can either enter text directly, or insert a variable such as %%ORIG_ENVELOPE_TO%%.

This setting is available only for email templates.

format {html | multiline | text}

Select the format of the email.

This setting is available only for email templates.

html

from <sender_email>

Enter the sender email address (From:) that will be used in the message header. You can either enter text directly, or insert a variable such as %%POSTMASTER%%. Can be up to 60 characters.

This setting is available only for email templates.

header-insertion-status {enable | disable}

Enable or disable insertion of a header line. Also configure header-name <key_str> and header-value "<text_str>".

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disable

header-name <key_str>

Enter the key of the header line. For example, in this header:

X-Corp-News: Daily

the key is X-Corp-News.

header-value "<text_str>"

Enter the value of the header. For example, in this header:

X-Corp-News: Daily

the value is Daily.

html-body "<text_str>"

Enter the body that will be used in the HTML format version of the email. Can be up to 4000 characters.

This setting is available only for email templates.

location {beginning | end}

Select where in the message body to insert the custom message.

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

Note: This setting is ignored if the disclaimer is applied by an antispam action profile, antivirus action profile, or content action profile's disclaimer-insertion-location {beginning | end} setting, and that location setting does not agree. For example, if this setting is beginning, but the other setting is end, then the disclaimer would appear at the end.

beginning

status {enable | disable}

Enable or disable prepending or appending the custom message. Also configure location {beginning | end}.

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disable

subject-tag-status {enable | disable}

Enable or disable a tag in the subject line. Also configure subject-tag "<text_str>".

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disable

subject-tag "<text_str>"

Enter the text to insert at the start of the subject line, such as [NEWSLETTER].

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

subject "<text_str>"

Enter the subject line that will be used in the email. You can either enter text directly, or insert a variable such as %%SUBJECT%%. Can be up to 250 characters.

This setting is available only for email templates.

text-body "<text_str>"

Enter the body that will be used in the plain text format version of the email. Can be up to 4000 characters.

This setting is available only for email templates.

to <recipient_email>

Enter the recipient email address (To:) that will be used in the message header. You can either enter text directly, or insert a variable such as %%ORIG_ENVELOPE_TO%%. Can be up to 60 characters.

This setting is available only for email templates.

Related topics

config domain-setting

config customized-message

system disclaimer-message

customized-message

customized-message

Use this command to customize text.

Customizable messages are used in many places, such as FortiMail GUI login pages, rejection messages, IBE messages, disclaimers, email templates, and other system-related messages.

There is a limit of 8191 characters for each custom message.

Syntax

config customized-message

edit <type_name>

config variable

edit %%<variable_name>%%

set display-name "<gui-label_str>"

set content "<text_str>"

next

end

config {email-template | message}

edit {<email-template_name> | <message_name>}

set status {enable | disable}

[set description "<comment_str>"]

set env-from <sender_email>

set env-to <recipient_email>

set from <sender_email>

set to <recipient_email>

set subject "<text_str>"

set subject-tag-status {enable | disable}

set subject-tag "<text_str>"

set header-insertion-status {enable | disable}

set header-name <key_str>

set header-value "<text_str>"

set location {beginning | end}

set format {html | multiline | text}

set disclaimer-convert-text-to-html-status {enable | disable}

set disclaimer-preview-orig-msg-status {enable | disable}

set content "<text_str>"

set html-body "<text_str>"

set text-body "<text_str>"

next

end

next

end

Variable

Description

Default

%%<variable_name>%%

Enter the variable name to use in the custom message.

For example, if you enter %%COMPANY-NAME%%, also use that same text in the custom message if you insert it. This is also the name of the variable as it appears in the CLI. (The GUI uses display-name "<gui-label_str>" instead.)

Many predefined variables exist, and you cannot edit their values or rename them. Variables cannot be reused in other messages or email templates. For a list of predefined variables and which templates they can be used in, see the FortiMail Administration Guide.

{<email-template_name> | <message_name>}

Enter the name of the email template or message.

Valid inputs are usually only existing names; you cannot create a new entry. Exceptions include types where new messages can be configured and selected, such as disclaimers.

For example, if <type_name> is disclaimer-insertion, then you may want to configure multiple disclaimer messages.

{email-template | message}

Select a type that matches what you entered in <type_name>, either:

  • message — Text labels used in the administrator or webmail user GUI, or inside an email for disclaimers or to explain when content or attachments were blocked.
  • email-template — An email template.

Settings inside this sub-command vary by this selection.

<type_name>

Enter the name of a message that you want to customize, such as alert-email or disclaimer-insertion.

Many predefined message types exist. To display the full list of options, enter:

edit ?

content "<text_str>"

Enter the value of the variable or custom message.

description "<comment_str>"

Enter a comment or description.

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disclaimer-convert-text-to-html-status {enable | disable}

Enable if either:

Plain text email (MIME type text/plain) does not support HTML formatting. If you disable this setting, and the disclaimer is formatted with HTML such as colors and hyperlinks, then plain text email will show the raw HTML code instead of your formatting.

Multipart email is not effected.

This setting applies only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disable

disclaimer-preview-orig-msg-status {enable | disable}

Enable if you want the preview to use the original message's content. In email clients such as Microsoft Outlook, Apple Mail on iOS, and FortiMail webmail, message preview text appears in the message list and/or notification banners.

Disable if you want the preview to start with the disclaimer. Original contents may still appear after the disclaimer if the disclaimer is short, depending on how much text the email client shows for the preview.

This setting applies only if location {beginning | end} is beginning, and if {<email-template_name> | <message_name>} is disclaimer-insertion.

Note: This setting is ignored if both:

(HTML is required to control display of the preview.)

This setting is also ignored if the disclaimer is applied by an antispam action profile, antivirus action profile, or content action profile, and that disclaimer-insertion-location {beginning | end} setting is end. (Message previews only show the first few lines of an email, so they usually do not include disclaimers at the end.)

disable

display-name "<gui-label_str>"

Enter a label that will appear in the variable list when you click Insert Variables in the GUI while customizing a message or creating a variable. For example, you could enter CompanyName for the variable %%COMPANY-NAME%%.

env-from <sender_email>

Enter the sender email address (MAIL FROM:) that will be used in the SMTP envelope. You can either enter text directly, or insert a variable such as %%ORIG_ENVELOPE_FROM%%.

This setting is available only for email templates.

env-to <recipient_email>

Enter the recipient email address (MAIL TO:) that will be used in the SMTP envelope. You can either enter text directly, or insert a variable such as %%ORIG_ENVELOPE_TO%%.

This setting is available only for email templates.

format {html | multiline | text}

Select the format of the email.

This setting is available only for email templates.

html

from <sender_email>

Enter the sender email address (From:) that will be used in the message header. You can either enter text directly, or insert a variable such as %%POSTMASTER%%. Can be up to 60 characters.

This setting is available only for email templates.

header-insertion-status {enable | disable}

Enable or disable insertion of a header line. Also configure header-name <key_str> and header-value "<text_str>".

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disable

header-name <key_str>

Enter the key of the header line. For example, in this header:

X-Corp-News: Daily

the key is X-Corp-News.

header-value "<text_str>"

Enter the value of the header. For example, in this header:

X-Corp-News: Daily

the value is Daily.

html-body "<text_str>"

Enter the body that will be used in the HTML format version of the email. Can be up to 4000 characters.

This setting is available only for email templates.

location {beginning | end}

Select where in the message body to insert the custom message.

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

Note: This setting is ignored if the disclaimer is applied by an antispam action profile, antivirus action profile, or content action profile's disclaimer-insertion-location {beginning | end} setting, and that location setting does not agree. For example, if this setting is beginning, but the other setting is end, then the disclaimer would appear at the end.

beginning

status {enable | disable}

Enable or disable prepending or appending the custom message. Also configure location {beginning | end}.

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disable

subject-tag-status {enable | disable}

Enable or disable a tag in the subject line. Also configure subject-tag "<text_str>".

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

disable

subject-tag "<text_str>"

Enter the text to insert at the start of the subject line, such as [NEWSLETTER].

This setting is available only if {<email-template_name> | <message_name>} is disclaimer-insertion.

subject "<text_str>"

Enter the subject line that will be used in the email. You can either enter text directly, or insert a variable such as %%SUBJECT%%. Can be up to 250 characters.

This setting is available only for email templates.

text-body "<text_str>"

Enter the body that will be used in the plain text format version of the email. Can be up to 4000 characters.

This setting is available only for email templates.

to <recipient_email>

Enter the recipient email address (To:) that will be used in the message header. You can either enter text directly, or insert a variable such as %%ORIG_ENVELOPE_TO%%. Can be up to 60 characters.

This setting is available only for email templates.

Related topics

config domain-setting

config customized-message

system disclaimer-message