Services

Services are a standard way to configure and use plugins enabled in the plugins directory.

  /etc/vsmtp
 ┣ vsmtp.vsl
 ┣ filter.vsl
 ┣ conf.d/
 ┃    ┣ config.vsl
 ┃    ┣ interfaces.vsl
 ┃    β”— app.vsl
 ┣ domain-available/
 ┃    β”— example.com
 ┃        ┣ config.vsl
 ┃        ┣ incoming.vsl
 ┃        ┣ outgoing.vsl
 ┃        β”— internal.vsl
 ┣ domain-enabled/
 ┃    β”— example.com -> /etc/vsmtp/domain-available/example.com
 ┣ objects/
 ┃    β”— net.vsl
 ┣ services/
+┃    β”— mysql-service.vsl
 β”— plugins/
      β”— vsmtp-plugin-mysql.so -> /usr/lib/vsmtp/libvsmtp-plugin-mysql-1.0.0.so

Declared as .vsl scripts, they expose variables or functions that uses plugins interfaces.

For example, a MySQL plugin is available to download, we can use it’s interface inside of a service script called mysql-service.vsl.

import "plugins/vsmtp-plugin-mysql" as mysql;

// Let's establish a connexion to a MySQL database.
export const database = mysql::connect(...);

/etc/vsmtp/services/mysql-service.vsl

Check out the MySQL plugin tutorial for more details.