Fortinet white logo
Fortinet white logo

CLI Reference

customized-message

customized-message

Use this command to customize text on the FortiMail unit and the email that it processes.

Custom messages are used in many places such as login pages, IBE messages, disclaimer messages, email templates, and other system-related messages.

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

Syntax

config customized-message

edit <customized-message-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 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 status {enable | disable}

set location {beginning | end}

set format {html | multiline | text}

set content "<text_str>"

set html-body "<text_str>"

set text-body "<text_str>"

next

end

next

end

Variable

Description

Default

<customized-message-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 ?

%%<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 | message}

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

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

Settings inside this sub-command vary by this selection.

{<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.

For example, if <customized-message-type_name> is disclaimer-insertion, then you may want to configure multiple disclaimer messages, both system-wide and for specific protected domains.

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.

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 Company Name 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 wil 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.

beginning

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.

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-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

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

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

domain-setting

config policy recipient

system disclaimer-message

customized-message

customized-message

Use this command to customize text on the FortiMail unit and the email that it processes.

Custom messages are used in many places such as login pages, IBE messages, disclaimer messages, email templates, and other system-related messages.

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

Syntax

config customized-message

edit <customized-message-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 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 status {enable | disable}

set location {beginning | end}

set format {html | multiline | text}

set content "<text_str>"

set html-body "<text_str>"

set text-body "<text_str>"

next

end

next

end

Variable

Description

Default

<customized-message-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 ?

%%<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 | message}

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

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

Settings inside this sub-command vary by this selection.

{<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.

For example, if <customized-message-type_name> is disclaimer-insertion, then you may want to configure multiple disclaimer messages, both system-wide and for specific protected domains.

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.

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 Company Name 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 wil 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.

beginning

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.

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-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

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

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

domain-setting

config policy recipient

system disclaimer-message