How to set up email notifications

CompleteFTP supports highly customizable email notifications. This means that when an event such as a file upload occurs, an email can be sent.

To set up email notifications, the mail server (SMTP server) settings must be entered. The server hostname, port number (normally port 25) and optional username and password are entered in the Email Notification tab found in the Events panel. SSL connections are also permitted by checking the "Enabled SSL/TLS" checkbox. For SSL, the port number will most likely need to be changed - the default SMTP SSL port is 465.

The list of current notifications is displayed in the Email Notification tab. Use Remove to delete notifications, and Add to create a new notification.

Enter an appropriate name for the notification, and select what Events the notification is applicable for. The various fields are described below:

Events

Processes may be triggered by any of the types of events listed below. By default, events are only triggered when an operation, such as a file upload, succeeds, but they may also be triggered on failure. This is determined by the checkboxes labelled 'Trigger on success' and 'Trigger on error'.

Upload file
When a file has been uploaded. All macros are available.
Download file
When a file has been downloaded. All macros are available.
Move file
When a file has been renamed or moved. All macros are available.
Delete file
When a file has been deleted. All macros are available.
Create folder
When a new folder has been created by a user. All macros are available.
Move folder
When a folder has been renamed or moved by a user. All macros are available.
Delete folder
When a folder has been deleted by a user. All macros are available.
Log in
When a user logs in. All macros are available.
Log out
When a user logs out. All macros are available.
Server start
When the CompleteFTP Windows service starts. By default, the service is configured to restart automatically in case of failure, so this event can be useful to alert administrators of such failures.
Server stop
When the CompleteFTP Windows service stops gracefully. This event will not trigger if the service stops ungracefully.
Site start
[Enterprise MFT only] When a site starts.
Site stop
[Enterprise MFT only] When a site stops.
Auto-ban
When an IP address has been auto-banned.
SSL/TLS certificate expiring
When a user tries to connect via FTPS or HTTPS and the server certificate is due to expire in less than 30 days. Note that this event is triggered at most once every 24 hours or after the CompleteFTP service has been restarted.
SSL/TLS certificate expired
When a user tries to connect via FTPS or HTTPS and the server certificate has expired. Note that this event is triggered at most once every 24 hours or after the CompleteFTP service has been restarted.
Cluster synchronization failed
[Enterprise MFT only] When the primary fails to synchronize with a secondary.

Filters

Filters restrict events based on a set of criteria that are defined by the administrator. These criteria may be based on: (1) the folder in which a file-operation is taking place, (2) the user performing the operation, and/or (3) the site on which the operation is taking place.

Folder filter

The folder- or file-path filter may be used to select the files/folders for which the event should be triggered. By default Windows-style wildcards are used for matching. For example, if the event should be triggered only for files with the extension .dat in the folder /Home/MyUser then the filter should be set to /Home/MyUser/*.dat. If the event should be triggered for files named test.dat in any directory, then the filter should be set to */test.dat.

Filters may be inverted by checking the checkbox labelled 'Inverse'. If this is done then the event will occur for all files/folders that don't match the filter.

Regular expressions (.NET-style) may also be used. To use these, the filter should be prefixed by 'regex:'. Information on .NET regular expressions may be found on the Microsoft(tm) website. Note that multiple filters may be defined using regular expressions using the syntax, regex:^(/Folder1/.*|/Folder2/.*), which would match anything underneath the folders, /Folder1 and /Folder2.

Example

To test this filter to see if it can filter the files/folders whose name has only got a number in it.

  1. Under folder user1, create 2 folders: abc and 123.
  2. Folder filter: regex:^(/Home/user1/[0-9]/*).
  3. Upload any file to folder 123 (or its subfolder - 123/456), the email will be sent.
  4. Upload a file to abc or its subfolder, no email will be sent because this abc folder is not match the /Home/user1/[0-9]/* filter.

The main point here is it check the folder path, so that without the path (/Home/user1/...), it won't work.

User can change the [0-9] to [a-z] to see the opposite result of 3. and 4.

User filter

A user filter may be used to select the users for which an event should occur, or, if it's inverted, the users for which it shouldn't occur. By default it will occur for all users. Users may be selected simply by checking the box next to them in the dropdown list that's displayed, when the user filter control is clicked.

Example

How to test this filter so that it can be used to filter for the user, 'user1' only:

  1. User filter: set as user1.
  2. Login to server via FileZilla using the user, 'user1', and upload a file.
  3. Check email, there should be an email sent and received.
  4. Continue to login to the server with FileZilla using user, 'user2', and upload a file.
  5. Check email again, no email should have been sent.

Site filter

[Enterprise MFT only] A site filter may be used to select the sites for which an event should occur or, if it's inverted, the sites on which it shouldn't occur. By default it will occur on all sites. Sites may be selected simply by checking the box next to them in the dropdown list that's displayed when the site filter control is clicked.

From address

Enter the email address that the email notification is set to originate from. The %OwnerEmail% (email address of folder owner) or %LoginEmail% (email address of logged-in user) macros may be used here.

To address

Enter the email address that the email notification is sent to. The %OwnerEmail% (email address of folder owner) or %LoginEmail% (email address of logged-in user) macros may be used here.

Subject

Enter the subject of the notification message. Various macros can be used here.

Message

Enter the body of the notification message. Various macros can be used here.

For an example on setting up an email notification, please refer to Step-by-step guide: E-mail notification when a file is uploaded.