PostfixAdmin Vacation/Out of Office Autoresponder

piaoling  2014-05-07 16:56:42

PostfixAdmin Vacation/Out of Office Autoresponder

August 10, 2009· by Craig Ballinger · in linux

PostfixAdmin actually comes with a perl plugin that enables a Vacation/Out of Office Autoresponder; for some reason, though, it’s not installed by default. The setup only takes a few minutes and it enables users to manage their own autoresponders, so it’s well worth the time.

This setup assumes that you’ve followed this Postfix Dovecot Mailserver Walkthrough. If not, your mileage may vary. Basically, you’ll need to have PostfixAdmin setup, and be using it to manage virtual mail users.

First, we need to grab some perl library dependancies

1.sudo apt-get install libmail-sender-perl libdbd-mysql-perl libemail-valid-perl libmime-perl liblog-log4perl-perl liblog-dispatch-perl libgetopt-argvfile-perl libmime-charset-perl libmime-encwords-perl

Create a user to manage the system:

1.sudogroupadd -r -g 65501 vacation
2.sudouseradd-r -u 65501 -g vacation -d /var/spool/vacation -s /sbin/nologin vacation
3.sudomkdir/var/spool/vacation
1.cd/var/www/postfixadmin/VIRTUAL_VACATION
2.sudocpvacation.pl /var/spool/vacation/vacation.pl
3.sudochown-R vacation:vacation /var/spool/vacation
4.sudochmod-R 700 /var/spool/vacation

Update the vacation script with your settings

1.sudonano /var/spool/vacation/vacation.pl

our $db_type = ‘mysql’;
our $db_username = ‘postfix’;
our $db_password = ‘yourdbpasswd’;
our $db_name = ‘postfix’;

our $vacation_domain = ‘autoreply.yourdomain.com’;
Save and close (CTRL + X)

Update the postfixadmin config file

1.cd/var/www/postfixadmin
2.sudonano config.inc.php

$CONF['vacation'] = ‘YES’;
$CONF['vacation_domain'] = ‘autoreply.yourdomain.com’;

1.cd/etc/postfix
2.sudonano master.cf

Add (near the end of the file):
vacation unix – n n – - pipe flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} ${recipient}
Save and close (CTRL + X)

1.sudonano main.cf

transport_maps = hash:/etc/postfix/transport
Save and close (CTRL + X)

Create (or update) a transport map to handle the redirected email

1.sudonano transport

autoreply.yourdomain.com vacation
Save and close (CTRL + X)

Postfix uses a hashed file to do the lookups, the postmap command creates that file.

1.sudopostmap /etc/postfix/transport

Reload the postfix config to activate the changes

1.sudo/etc/init.d/postfix reload

That’s it. Now if you log in to your postfix admin control panel, you’ll be able to manage autoresponders for all the accounts. When users log in to their specific accounts they’ll also be able to manage their own out of office notifications.

类别 :  默认(751)  |  浏览(10057)  |  评论(1)
发表评论(评论将通过邮件发给作者):

Email:
userhead
2020-10-16 01:06:38
hola