Setting Up Email Notifications
The email notification feature is a built-in pre- and post-processing application that generates customized emails based on transfer events. To enable email notifications, HST Server must be configured for pre/post-processing and have network access to an open SMTP relay server.
Prerequisites:
- HST Server configured for pre- and post-processing. For instructions, see Setting Up Pre/Post Processing.
- An open SMTP server that you can reach on your network and that does not use any external authentication or SSL.
Setting up Email Notifications:
-
Prepare the email notification configuration template.
Open the aspera.conf file:
/opt/aspera/etc/aspera.conf
Locate or create the section <EMAILNOTIF>...</EMAILNOTIF>:
<CONF version="2"> ... <EMAILNOTIF> <MAILLISTS mylist = "asperausers@example.com, admin@example.com" myadminlist = "admin@example.com" /> <FILTER MAILLISTS = "mylist" TARGETDIR = "/content/users" /> <MAILCONF DEBUG = "0" FROM = "asperaserver@example.com" MAILSERVER = "mail.example.com" SUBJECT = "Transfer %{SOURCE} %{TARGET} - %{STATE}" BODYTEXT = "Aspera transfer: %{STATE}%{NEWLINE}%{TOTALBYTES} bytes in %{FILECOUNT} files: %{FILE1}, %{FILE2}, ...%{FILELAST}." /> </EMAILNOTIF> </CONF>
-
Set up the basic notification function in <MAILCONF/>
<MAILCONF/> defines the general email configuration, including the sender, the mail server, and the body text. In the SUBJECT and BODYTEXT options, the pre- and post-processing variables can be used with the format %{variable}, such as %{STATE} for the variable STATE. For the complete list of the variables, see Pre/Post Variables.
MAILCONF Field Description Values Example FROM The email address to send notifications from. (Required) a valid email address FROM="admin@example.com" MAILSERVER The outgoing mail server (SMTP). (Required) A valid URL MAILSERVER="mail.example.com" SUBJECT General subject of the email. text string SUBJECT="Transfer:%{STATE}" BODYTEXT General body of the email. text string BODYTEXT="Transfer has %{STATE}." DEBUG Print debugging info and write to the logs. "0" = off, "1" = on DEBUG="0" -
Create mailing lists in <MAILLISTS />.
<MAILLISTS /> defines sets of mailing lists. For example, to create the following mailing list:
Item Value Mailing list name list1 Emails to include janedoe@companymail.com, johndoe@companymail.com Specify the mailing list in the following form:
<MAILLISTS list1 = "janedoe@companymail.com, johndoe@companymail.com" />
-
Set up mailing filters in <FILTER />.
<FILTER /> defines email notification conditional filters. When the conditions are met, a customized email is sent to the indicated mailing list. Multiple filters are allowed.
The values in the filter are matched as substrings, for example, USER = root means the value would match strings like root, treeroot, and root1. The pre- and post-processing variables can be used with the format %{variable}, such as %{STATE} for the variable STATE. For the complete list of the variables, see Pre/Post Variables.
FILTER Field Description Values Example MAILLISTS Required The email lists to send to. Separate lists with comma (,). text string MAILLISTS="mylist" USER Login name of the user who transferred the files. text string USER="aspera_user_1" SRCIP Source IP of the files. a valid IPv4 address SRCIP="10.0.1.1" DESTIP Destination IP of the files. a valid IPv4 address DESTIP="10.0.1.5" SOURCE The top-level directories and files that were transferred. text string SOURCE="/folder1" TARGETDIR The directory that the files were sent to. text string TARGETDIR="/folder2" SUBJECTPREFIX The email subject, preceded by the SUBJECT in <MAILCONF />. text string SUBJECTPREFIX="Sub" BODYPREFIX The email body, preceded by the BODYTEXT in <MAILCONF />. text string BODYPREFIX="Txt" TOTALBYTESOVER Send email when total bytes transferred is over this number. This only applies to emails sent at the end of a transfer. positive integer TOTALBYTESOVER="9000" SENDONSESSION Send email for the entire session. yes / no SENDONSESSION="yes" SENDONSTART Send email when transfer is started. This setting is dependent on SENDONSESSION="yes". yes / no SENDONSTART="yes" SENDONSTOP Send email when transfer is stopped. This setting is dependent on SENDONSESSION="yes". yes / no SENDONSTOP="yes" SENDONFILE Send email for each file within a session. yes / no SENDONFILE="yes"