This is an old revision of the document!


The e-mail notification system

To be able to send e-mails from FileRun, you need to either have PHP configured with “sendmail” or have FileRun configured with an SMTP server.

You can change the e-mail settings from the FileRun control panel under System configuration » E-mail » Settings.

Do note that most SMTP servers require authentication, and to prevent spam and other attacks, some don't even allow you to send e-mails from other addresses than the one configured for authentication. So don't be surprised if you are trying to send a file from a particular e-mail address and the recipient sees the message as coming from the address you used for the SMTP authentication.

FileRun tries to detect your SMTP server configuration and in some cases will use STARTTLS even if you don't want to. If that is the case, the solution is to open the file customizables/config.php (create the file if it doesn't exist) in a text editor and edit it too look like this:

<?php 
$config['system']['email']['smtp_options'] = [
  'SMTPAutoTLS' => false, 
  'ssl' => [
    'verify_peer' => false, 
    'verify_peer_name' => false,
    'allow_self_signed' => true
  ]
];

By default the e-mail notifications messages are sent from the e-mail address “some@email-address.com”. Please change this to a valid e-mail address.

There are three ways you can configure FileRun to send e-mail notifications:

The "Notifications" checkbox

The admin can enable or disable the “Notifications” checkbox when adding or editing a user account. In this case the user will receive e-mail notification messages when:

  • A file has been downloaded by another user.
  • Another user provided a file or a folder via copying, moving, uploading or sharing.
  • Another user added a comment or set a label on a file or a folder.
  • The space quota, if one is set, is about to hit the usage limit.

The above can be customized, by either removing or adding triggers. Please see $config['app']['email_notification']['basic_actions'] on the advanced configuration page.

The users themselves can also enable or disable these notifications from their “Account settings” panel.

One requirement from e-mail notifications to be sent on other users action is the permission to “Can interact with”. This is set from the control panel, under the “Permissions” tab, when editing a user account. If user A isn't aware of the existence of user B, user A will not be notified if user B makes changes inside user A's folders.

This option applies only for actions performed inside the user's configured home folder. It does not apply to files and folders accessed via other user's shares.

The "Control Panel" » "Notifications" section

Admin users can also use the “Control Panel » Notifications” section for setting up rules for notifications. Here you manually select which user-performed actions should send e-mail notifications. Using this option you can configure e-mail notifications to be sent to different e-mail addresses than the ones set for the user accounts.

Per folder notifications

With the Enterprise FileRun version, users can choose to be notified when certain actions are being performed in a particular folder, by right-clicking the folder and selecting the Notifications option. The users can choose to be notified about various actions performed by other users on files located inside the selected folder.

The following information which applies to most outgoing notifications can be customized from the control panel, under System configuration > E-mail > Settings:

  • From e-mail address
  • An optional BCC e-mail address
  • E-mail subject
  • Body content

E-mail messages that relate user management actions usually have template files located inside the folder customizables/emails/. These template files can be opened in a text editor and customized.

<Action>
 [...]
 User "{$info.userInfo.name}" has performed the following action: "{$info.details.action}
 [...]
</Action>

The XML tags (<Action>, <From>, <Subject>, etc…) should not be altered or removed from the template files.

The body of the notifications contains Smarty syntax that allows you to use variables and perform various logical operations. For more details on using Smarty, please check this page: http://www.smarty.net/docs/en/smarty.for.designers.tpl

The following are some of the Smarty variables that might be available inside the templates:

{$info.userInfo.username} User’s login name.
{$info.userInfo.name} User’s name.
{$info.userInfo.company} Company name
{$info.userInfo.website} User’s website address.
{$info.userInfo.description} User’s admin note.
{$info.config.url.root} The URL of the FileRun installation.
{$info.settings} Array containing FileRun's current settings.
{$info.details} Array containing details related to the performed action. The structure varies according to each specific action.

You can configure FileRun to send all the notifications for a certain time period in a single e-mail message. This helps preventing FileRun from sending hundreds of e-mail messages at a time, when users are uploading many files in a short time span.

To enable this you need to uncheck the option “Instant email notifications” available in “Control Panel” » System configuration » E-mail » Settings. The notifications will no longer be sent instantly, but queued until you run the script cron/email_notifications.php from the command line. On most Linux servers the command looks like this:

php cron/email_notifications.php your.server.hostname.com

In some cases, where you have a custom php.ini PHP configuration file for the FileRun installation folder you might need to specify the path to it, so that the command is executed with the same configuration and not the default one (which usually doesn't load needed extensions, such as ionCube):

php -c php.ini cron/email_notifications.php your.server.hostname.com

Using a Cron job on Linux servers or a scheduled task on Windows, you can choose the time interval the e-mail notifications are getting sent.

You can read more about cron here: http://en.wikipedia.org/wiki/Cron For examples, see this page: http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/

If you are using a web hosting service, you most probably have a control panel tool for setting up scheduled tasks, so we recommend you to ask your server administrator or hosting service tech support how do you go about setting this up.