OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Gimbert Mario (mgimbert_at_sbsd.de)
Date: Mon Dec 02 2002 - 02:32:58 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    > -----Original Message-----
    > From: owner-postfix-userspostfix.org
    > [mailto:owner-postfix-userspostfix.org]On Behalf Of Roland Reimann
    > Sent: Sunday, December 01, 2002 6:29 PM
    > To: postfix-userspostfix.org
    > Subject: sqllog - Autoresponder - Forwarding - X-Info
    >
    >I´m now proudly running Postfix with Cyrus SASL2, Cyrus IMAP, MySQL,
    >Web-Cyradm and pam_mysql.

    > 2.) Holiday messages
    >
    > Is it possible to realize a Holiday-message or auto-responder? With my
    > config?

    i don´t run cyrus but our config for autoresponder looks like this
    we have the following config:
    if you cannot adopt my solution 1 to 1 it may at least give you a hint....

    virtual table:
    +------+----------------+--------------------------+------------------+-----
    ----------+
    | id | virtual | local | fk_parenthosting |
    autoreplymsg |
    +------+----------------+--------------------------+------------------+-----
    ----------+
    | 4116 | testdomain.de | testautoreply.kewler.de | 1192| bin
    in urlaub |
    | 4123 | testdomain.de | testaccount | 1192| NULL
    |
    +------+----------------+--------------------------+------------------+-----
    ----------+

    transport table:
    +----+---------------------+--------------+
    | id | domain | transport |
    +----+---------------------+--------------+
    | 8 | autoreply.domain.de | autoreply |
    +----+---------------------+--------------+

    master.cf:
    autoreply unix - n n - - pipe flags=F
    use
    r=nobody argv=/usr/local/bin/autoresponder.pl ${sender} ${recipient}

    /usr/local/bin/autoresponder.pl:
    --begin script--
    #!/usr/bin/perl
    ($sender, $recipient) = ARGV;

    $SENDMAIL = "/usr/local/sbin/sendmail";

    #db schmick
    $db_name = "xxx";
    $db_host = "xxx";
    $db_user = "xxx";
    $db_pass = "xxx";

    $dsn = "dbi:mysql:dbname=$db_name;host=$db_host";

    open DEBUG, ">> /tmp/autoreply";

    use DBI;
    $db = DBI->connect($dsn, $db_user, $db_pass) || die "DB connect failed";

    $sth = $db->prepare("SELECT virtual,autoreplymsg FROM virtual WHERE local =
    '$recipient'");
    $sth->execute();
    ($virtual, $autoreplymsg) = $sth->fetchrow_array;

    ## do not reply to mailing lists.....
    if
    ($sender=~/^(?i)owner-.*|^(?i)newsletter.*|(?i)listserver.*|^(?i)mailerdaemo
    n.*|^(?i)maile
    r-daemon.*/){
        exit 0;
        }else{
    open(MAIL, "|$SENDMAIL -f '' -t") || die "Cannot execute $SENDMAIL: $!\n";
    print MAIL <<EOF;
    From: MAILER-DAEMON (Automatic reply service)
    To: $sender
    Subject: $virtual is away from the mail

    $autoreplymsg

    EOF

        close MAIL || die "$SENDMAIL failed: $!\n";
        exit 0;
        };
    ---end script----

    hth, mario