The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

sendd - Flush glist's Mailinglist Spool

SYNOPSIS

        Run from crontab:

        00-59 * * * * /path/to/sendd -s

        Or in daemon mode:

        /path/to/sendd -D -t time_to_sleep

COMMAND LINE SWITCHES AND OPTIONS

        Usage: sendd [-v] [-n] {-D [-t time_to_sleep]|-s}
-D
        Run the program in daemon mode.
-t
        Time (in seconds) which we'll be sleeping
        between each run. (only in deamon mode)
-s
        Run once and exit.
-v
        Give verbose error and info messages in logging
-n
        Debug mode. Don't really send mail and do not
        delete the queue file.

DESCRIPTION

        Sendd is the program that flushes glist's mailinglist spool.

        It checks for files in the PREFIX/spool/outgoing directory.
        For each file it finds it will:

        1. Move the file to the PREFIX/spool/send directory.
        2. Parse the file and generate the headers
        3. Connect to the DB in the X-DB_Server and X-Database headers
           and get the e-mail addresses from the push list id X-Push_list_id
           or get the files from the mailinglist file (if the mailinglist type is file)
        4. Generate Bcc/Resent-bcc information in correct format from the list of
           approved e-mail addresses.
        5. Send the mail if it finds all required headers
        6. If the mail was send successfully; delete the message file.

        If the message couldn't be parsed it will be moved to the defer directory,
        which is PREFIX/spool/deferred.

CONFIGURATION

        Configuration is done in the script it self.
        Thogh this is preferred to be changed in the Makefile,
        this can be done in the script as well.

        In the first lines of sendd you can configure the following variables:
PREFIX
        Sendd's prefix path.
SENDMAIL
        The full path to the sendmail program, with options.
        (usually sendmail -t)
USE_SQL
        Set to db2 or pgsql. Defines if the DBI and DBD::Pg/DBD::DB2 modules should be used,
        and postgresql/db2 support is implemented.

FILES

PREFIX/etc/glist.passwd
        The database of passwords.
        This file has the following format:

        servername:dbname:user:pass

        NOTE: This must only be readable by the uid sendd runs as.
        Please also note that it's generally a bad idea to run
        sendd as root.  
Message files in PREFIX/spool/outgoing
        Each message file should be like this:

        Header part
        <empty line>
        Body Part

        The following headers are required:

        From            - The sender of the message
        To              - The recipient of the message
        Subject         - The subject of the message

        The following headers are optional depending if the list
        is sql or file based:

        X-DB_Server     - The database server we should connect to
        X-Database      - The database we should use on the server
        X-Push_list_id  - The id of the member list to use
        X-File          - The file containing the recipients
        

REQUIREMENTS

Perl 5
        Maybe even Perl 5.6?
POSIX
        Should be in the standard perl distribution.
Getopt:Std
        Should be in the standard perl distribution.
File::Copy
        Should be in the standard perl distribution.
DBI
        The CPAN module can install this for you:

        # perl -MCPAN -e shell
        cpan> install DBI
DBD::Pg
        The CPAN module can install this for you:

        # export POSTGRES_INCLUDE=/path/to/postgres/include
        # export POSTGRES_LIB=/path/to/postgres/lib
        # perl -MCPAN -e shell
        cpan> install DBD::Pg
Postfix / Sendmail
        http://www.postfix.org
        http://www.sendmail.org

VERSION

        This is version 1.00, derived from listspoold 1.00

TODO

        * If somehow (despite the locking check) the daemon manages to run twice,
        the message can in some rare conditions be sent twice.

        This can be fixed by adding another queue where the message will be moved
        as soon as it is found by the daemon. Actions after this will be done
        with the file in the new directory.

        This is done in version listspoold 1.00

BUGS

        None known as of this date :)

HISTORY

        This is an glist implementation of listspool version 1.0

AUTHOR

        Ask Solem Hoel <ask@unixmonks.net>, http://www.unixmonks.net

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 2:

Unknown directive: =comment

Around line 304:

=cut found outside a pod block. Skipping to next block.