Fortinet white logo
Fortinet white logo

CLI Reference

report mail

report mail

Use this command to configure report profiles that define what information will appear in generated reports.

In addition to log files, FortiMail units require a report profile to be able to generate a report. A report profile is a group of settings that contains the report name, file format, subject matter, and other aspects that the FortiMail unit considers when generating the report.

Syntax

config report mail

edit <profile_name>

[set comment "<comment_str>"]

set scope {cloud-api | default}

set period-relative {last-N-days | last-N-hours | last-N-weeks | last-month | last-quarter | last-week | this-month | this-quarter | this-week | this-year | today | yesterday}

set period-relative-value <n_int>

set period-absolute-from <start_str>

set period-absolute-to <end_str>

set direction {all | incoming | outgoing | unknown}

set dest-ip-type {ip-group | ip-mask}

set dest-ip-mask <destination_ipv4/mask>

set dest-ip-group <group_name>

set domains {<domain_str>...}

set sender-domains {<domain_str>...}

set query-status <query_str>

set schedule {daily | dates | none | weekdays}

set schedule-hour <hour_int>

set schedule-dates {1 2 ... 30 31}

set schedule-weekdays {Monday Tuesday Wednesday Thursday Friday Saturday Sunday}

set file-format {html | pdf}

set recipients <recipient_email>

end

Variable

Description

Default

<profile_name>

Enter a name for the profile. Do not include spaces.

comment "<comment_str>"

Enter a description or comment.

dest-ip-group <group_name>

Select which IP group to use.

dest-ip-mask <destination_ipv4/mask>

Enter the destination IP address and network mask of SMTP sessions that will be included in the report.

0.0.0.0/0

dest-ip-type {ip-group | ip-mask}

Select how you want to define the destination address of SMTP sessions that will be included in the report. Then also configure dest-ip-mask <destination_ipv4/mask> or dest-ip-group <group_name>.

ip-mask

direction {all | incoming | outgoing | unknown}

Select the direction of email to include in the report, relative to protected domains:

  • all: Both incoming and outgoing email.

  • incoming: Only email whose recipient is a member of a protected domain.

  • outgoing: Only email whose recipient is not a member of a protected domain.

  • unknown: Email that does not have a recipient domain name.

all

domains {<domain_str>...}

Enter a list of zero or more recipient domains. An empty list matches all recipient domains.

all

file-format {html | pdf}

Select the file format of the generated report.

pdf

period-absolute-from <start_str>

Enter the beginning of the time range in the format yyyy-mm-dd-hh, where yyyy is the year, mm is the month, dd is the day, and hh is the hour in 24-hour clock format.

For example, entering 2008-10-24-09 includes log messages as early as 9 AM on October 24, 2008.

period-absolute-to <end_str>

Enter the end of the time range in the format yyyy-mm-dd-hh, where yyyy is the year, mm is the month, dd is the day, and hh is the hour in 24-hour clock format.

For example, entering 2009-10-24-17 includes log messages as late as 5 PM on October 24, 2009.

period-relative {last-N-days | last-N-hours | last-N-weeks | last-month | last-quarter | last-week | this-month | this-quarter | this-week | this-year | today | yesterday}

Select the time range of log messages to use.

Days are 24 hours. Weeks are 7 days. Months are 30 days. Quarters are 3 months. Time periods adjust, however, due to leap year, shorter or longer months, and daylight saving time (DST).

Time is relative to the current FortiMail system clock. See system time ntp.

Enter the time span of log messages from which to generate the report. If you entered last-N-days, last-N-hours, or last-N-weeks also configure period-relative-value <n_int>.

yesterday

period-relative-value <n_int>

If you entered last-N-days, last-N-hours, or last-N-weeks as the value for period-relative, enter the value of n.

Note: Because days are defined as 24 hours, yesterday, last-week, last-month, and last-quarter are the current date plus dates in the previous time period. For example, if today is Friday at 10 AM, then last-week includes data from last Friday after 10 AM to Thursday plus this Friday until 10 AM, which are 8 dates in total.

If you want only 7 dates, then instead select last-N-days and 7.

0

query-status <query_str>

Enter the name of a query whose result you want to include in the report, such as Total_Mail_by_Direction.

To display a list of available query names, enter a question mark ( ? )

Endpoint queries are available only if carrier-endpoint-status {enable | disable} is enable.

recipients <recipient_email>

Enter a list of email addresses, if any, that will receive a copy of the generated report. Separate each recipient with a comma ( , ).

schedule {daily | dates | none | weekdays}

Select when to automatically generate the report:

none

schedule-dates {1 2 ... 30 31}

Select which dates of the month to generate the report.

schedule-hour <hour_int>

Select which hour of the day, according to a 24-hour clock, to generate the report.

For example, to generate reports at 5 PM, you would enter 17.

1

schedule-weekdays {Monday Tuesday Wednesday Thursday Friday Saturday Sunday}

Select which days to generate the reports.

scope {cloud-api | default}

Select whether or not to use data from the Google or Microsoft API.

default

sender-domains {<domain_str>...}

Enter a list of zero or more sender domains. An empty list matches all sender domains.

Related topics

log alertemail setting

report mail

report mail

Use this command to configure report profiles that define what information will appear in generated reports.

In addition to log files, FortiMail units require a report profile to be able to generate a report. A report profile is a group of settings that contains the report name, file format, subject matter, and other aspects that the FortiMail unit considers when generating the report.

Syntax

config report mail

edit <profile_name>

[set comment "<comment_str>"]

set scope {cloud-api | default}

set period-relative {last-N-days | last-N-hours | last-N-weeks | last-month | last-quarter | last-week | this-month | this-quarter | this-week | this-year | today | yesterday}

set period-relative-value <n_int>

set period-absolute-from <start_str>

set period-absolute-to <end_str>

set direction {all | incoming | outgoing | unknown}

set dest-ip-type {ip-group | ip-mask}

set dest-ip-mask <destination_ipv4/mask>

set dest-ip-group <group_name>

set domains {<domain_str>...}

set sender-domains {<domain_str>...}

set query-status <query_str>

set schedule {daily | dates | none | weekdays}

set schedule-hour <hour_int>

set schedule-dates {1 2 ... 30 31}

set schedule-weekdays {Monday Tuesday Wednesday Thursday Friday Saturday Sunday}

set file-format {html | pdf}

set recipients <recipient_email>

end

Variable

Description

Default

<profile_name>

Enter a name for the profile. Do not include spaces.

comment "<comment_str>"

Enter a description or comment.

dest-ip-group <group_name>

Select which IP group to use.

dest-ip-mask <destination_ipv4/mask>

Enter the destination IP address and network mask of SMTP sessions that will be included in the report.

0.0.0.0/0

dest-ip-type {ip-group | ip-mask}

Select how you want to define the destination address of SMTP sessions that will be included in the report. Then also configure dest-ip-mask <destination_ipv4/mask> or dest-ip-group <group_name>.

ip-mask

direction {all | incoming | outgoing | unknown}

Select the direction of email to include in the report, relative to protected domains:

  • all: Both incoming and outgoing email.

  • incoming: Only email whose recipient is a member of a protected domain.

  • outgoing: Only email whose recipient is not a member of a protected domain.

  • unknown: Email that does not have a recipient domain name.

all

domains {<domain_str>...}

Enter a list of zero or more recipient domains. An empty list matches all recipient domains.

all

file-format {html | pdf}

Select the file format of the generated report.

pdf

period-absolute-from <start_str>

Enter the beginning of the time range in the format yyyy-mm-dd-hh, where yyyy is the year, mm is the month, dd is the day, and hh is the hour in 24-hour clock format.

For example, entering 2008-10-24-09 includes log messages as early as 9 AM on October 24, 2008.

period-absolute-to <end_str>

Enter the end of the time range in the format yyyy-mm-dd-hh, where yyyy is the year, mm is the month, dd is the day, and hh is the hour in 24-hour clock format.

For example, entering 2009-10-24-17 includes log messages as late as 5 PM on October 24, 2009.

period-relative {last-N-days | last-N-hours | last-N-weeks | last-month | last-quarter | last-week | this-month | this-quarter | this-week | this-year | today | yesterday}

Select the time range of log messages to use.

Days are 24 hours. Weeks are 7 days. Months are 30 days. Quarters are 3 months. Time periods adjust, however, due to leap year, shorter or longer months, and daylight saving time (DST).

Time is relative to the current FortiMail system clock. See system time ntp.

Enter the time span of log messages from which to generate the report. If you entered last-N-days, last-N-hours, or last-N-weeks also configure period-relative-value <n_int>.

yesterday

period-relative-value <n_int>

If you entered last-N-days, last-N-hours, or last-N-weeks as the value for period-relative, enter the value of n.

Note: Because days are defined as 24 hours, yesterday, last-week, last-month, and last-quarter are the current date plus dates in the previous time period. For example, if today is Friday at 10 AM, then last-week includes data from last Friday after 10 AM to Thursday plus this Friday until 10 AM, which are 8 dates in total.

If you want only 7 dates, then instead select last-N-days and 7.

0

query-status <query_str>

Enter the name of a query whose result you want to include in the report, such as Total_Mail_by_Direction.

To display a list of available query names, enter a question mark ( ? )

Endpoint queries are available only if carrier-endpoint-status {enable | disable} is enable.

recipients <recipient_email>

Enter a list of email addresses, if any, that will receive a copy of the generated report. Separate each recipient with a comma ( , ).

schedule {daily | dates | none | weekdays}

Select when to automatically generate the report:

none

schedule-dates {1 2 ... 30 31}

Select which dates of the month to generate the report.

schedule-hour <hour_int>

Select which hour of the day, according to a 24-hour clock, to generate the report.

For example, to generate reports at 5 PM, you would enter 17.

1

schedule-weekdays {Monday Tuesday Wednesday Thursday Friday Saturday Sunday}

Select which days to generate the reports.

scope {cloud-api | default}

Select whether or not to use data from the Google or Microsoft API.

default

sender-domains {<domain_str>...}

Enter a list of zero or more sender domains. An empty list matches all sender domains.

Related topics

log alertemail setting