## ProFTPD module `mod_msg`

The `mod_msg` module allows system users to send messages to connected clients via the `ftpdctl` program. The module works by creating a SysV message queue, which is used to pass messages from the daemon process to session processes.

This module is contained in the `mod_msg.c` file for ProFTPD 1.2, and is not compiled by default. Installation instructions are discussed here. Documentation on `mod_msg` usage follows.

The most current version of `mod_msg` can be found at:

      http://www.castaglia.org/proftpd/

## Author

Please contact TJ Saunders <tj at castaglia.org> with any questions, concerns, or suggestions regarding this module.

## Directives

- MesssageControlsACLs
- MessageEngine
- MessageLog
- MessageQueue

## Control Actions

- `msg`

### MessageControlsACLs

Syntax: MessageControlsACLs actions|"all" "allow"|"deny" "user"|"group" list
Default: None
Context: server config Module: mod_msg
Compatibility: 1.2.10rc1 and later

Example:

      # Allow all users to send messages to connected clients
      MessageControlsACLs msg allow user *

### MessageEngine

Syntax: MessageEngine on|off
Default: off
Context: server config, `<VirtualHost>`, `<Global>`
Module: mod_msg
Compatibility: 1.2.10rc1 and later

The `MessageEngine` directive enables or disables the module's runtime message queue. If it is set to off this module does no passing of messages. Use this directive to disable the module instead of commenting out all `mod_msg` directives.

### MessageLog

Syntax: MessageLog path|"none"
Default: None
Context: server config Module: mod_msg
Compatibility: 1.2.10rc1 and later

The `MessageLog` directive is used to a specify a log file for `mod_msg` reporting and debugging. The path parameter must be the full path to the file to use for logging. Note that this path must not be to a world-writeable directory and, unless `AllowLogSymlinks` is explicitly set to on (generally a bad idea), the path must not be a symbolic link.

If path is "none", no logging will be done at all.

### MessageQueue

Syntax: MessageQueue path
Default: None
Context: server config Module: mod_msg
Compatibility: 1.2.10rc1 and later

The `MessageQueue` directive configures a path to a file that `mod_msg`will use when sending messages. This file itself is not used for storing messages; it is necessary for obtaining a unique key to use as the ID for the message queue.``

## Control Actions

### `msg`

Syntax: ftpdctl msg [class|host|user name]|[all] message
Purpose: Send a message to a class, host, user, or all

The `msg` control action can be used to send messages to connected clients. Any words that follow the given user or host name in the `ftpdctl` command will be sent to the connected session, and added to the response to the session's next FTP command. Note, however, that some command responses cannot be altered, such as `EPSV`, `PASV`, or `STOU`; `mod_msg` avoids these command responses. Note: some FTP clients may not display the text messages of FTP responses to the user; there is nothing that `mod_msg` can do when such clients are used.

Examples:

      ftpdctl msg user dave Dave, you need to delete some files
      ftpdctl msg all This server will be going offline for maintenance soon

## Installation

To install `mod_msg`, copy the `mod_msg.c` file into

      proftpd-dir/contrib/

after unpacking the latest proftpd-1.2 source code. Then follow the usual steps for using third-party modules in proftpd, making sure to include the `--enable-ctrls` configure option, which `mod_msg` requires:

      ./configure --enable-ctrls --with-modules=mod_msg
      make
      make install

## Usage

Example configuration:

      <IfModule mod_msg.c>
        MessageEngine on
        MessageLog /var/log/ftpd/msg.log
        MessageQueue /var/ftpd/msg.queue

        # Allow all system users to send messages
        MessageControlsACLs msg allow user *
      </IfModule>

© Copyright 2017 TJ Saunders
All Rights Reserved