RE: sqllog - Autoresponder - Forwarding - X-Info

From: Gimbert Mario (no email)
Date: Mon Dec 02 2002 - 03:32:58 EST


> -----Original Message-----
> From:
> [mailto:]On Behalf Of Roland Reimann
> Sent: Sunday, December 01, 2002 6:29 PM
> To:
> 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 | | | 1192| bin
in urlaub |
| 4123 | | 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








Hosted Email Solutions

Invaluement Anti-Spam DNSBLs



Powered By FreeBSD   Powered By FreeBSD