Next: , Previous: Url-mode, Up: maidag


3.11.8 Remote Mailbox Delivery

Maidag can be used to deliver mail to remote mailboxes, such as ‘imap’ or ‘remote+smtp’. If the mailbox URL is ‘remote+smtp’ or ‘remote+sendmail’, the message is actually forwarded over SMTP to the remote node, so maidag acts as a message transfer agent. For example:

     $ maidag --url remote+smtp://10.10.1.100:24

This command line will send the message to the machine ‘10.10.1.100’ using port ‘24’ (private mail system).

The ‘remote+prog’ mailbox may be of special use. Delivering to this mailbox results in invoking the specified command with the given arguments and passing the message to its standard input. There are two ways to specify a ‘remote+prog’ mailbox:

remote+prog://program?args
Here, program is the absolute pathname of the program binary, and args are its arguments, separated by ‘&’ signs.
|program args
In this notation, args are command line arguments separated by white space.

In both cases, args do not include argv[0].

The ‘remote+prog’ mailbox may be used, in particular, to implement mailing lists with MeTA1.

For example, suppose that the maidag configuration contains:

     auth {
       authorization sql:system;
       authentication generic:system;
     }
     
     sql {
       interface mysql;
       db mail;
       getpwnam "SELECT user as name, mailbox, "
                "'x' as passwd, 500 as uid, 2 as gid, "
                "'/nonexistent' as dir, '/sbin/nologin' as shell "
                "FROM userdb "
                "WHERE user='${user}'";
     }

Then, the following entries in the ‘userdb’ table implement mailman@yourdomain mailing list:

     mysql> select * from userdb;
     +---------------------+---------------------------------------+
     | user                | mailbox                               |
     +---------------------+---------------------------------------+
     | mailman             | |/usr/bin/mailman post mailman        |
     | mailman-admin       | |/usr/bin/mailman admin mailman       |
     | mailman-bounces     | |/usr/bin/mailman bounces mailman     |
     | mailman-confirm     | |/usr/bin/mailman confirm mailman     |
     | mailman-join        | |/usr/bin/mailman join mailman        |
     | mailman-leave       | |/usr/bin/mailman leave mailman       |
     | mailman-owner       | |/usr/bin/mailman owner mailman       |
     | mailman-request     | |/usr/bin/mailman request mailman     |
     | mailman-subscribe   | |/usr/bin/mailman subscribe mailman   |
     | mailman-unsubscribe | |/usr/bin/mailman unsubscribe mailman |
     +---------------------+---------------------------------------+