Why should your SFTP Server be “scriptable”?

Scripting is a well-known technique to extend systems or software functionality by adding short portions of code, usually written in an easy, high lever language, often referred to as a “scripting language”.

JavaScript, for example, was born with such intent in mind. The purpose was to extend the (back then very static) behavior of web pages, utilizing short programs that would be run directly within the browser itself. Since then, JavaScript has gone very far, and today it can probably be considered a full-blown programming language (although it still retains features, like “late binding” that make it suitable for quick script crafting).

But scripting as a technique is still widely used by System Administrator, in the form of Batch/PowerShell scripts in Windows envirnoments, or Shell scripts in Unix-like environments.

From a software designer perspective, adding scripting capabilities to a computer program means letting users free to extend it and make it do that one “additional custom step” that the original designer could never think about, simply because it addresses a very specific issue or necessity that is unique to the specific user.

Keeping the above in mind, it’s easy to maintain that an SFTP server is much more than just some tool that allows to transfer files from one point to another rendering interception useless. An SFTP server is actually a living ecosystem where files reside, are moved, copied, audited, analyzed, …

The SFTP server should be able to perform complex tasks that go far beyond just sending or receiving files within an encrypted communication channel. It should be able to verify the correctness of the uploaded data, prevent certain operations based upon the result of other (previous) operations, notify the System Administrator when certain events occur, and perform a plethora of other tasks depending on the specific user needs.

For such reason the SFTP server should be able to react to the occurrence of certain events by running user-defined scripts that perform custom actions and address the users’ real specific needs. In this blog we will use Syncplify.me Server!‘s scripting framework and event-handling subsystem as a platform to show how custom scripts can extend an SMTP server, increase its security, improve its functionality, and deliver a perfectly suitable, safe, and compliant file management environment.