POSTFIX VIRTUAL VACATION WITH MYSQL



VIRTUAL VACATION  DOC.

# useradd -s /sbin/nologin vacation
# mkdir /var/spool/vacation
# cp /var/www/html/mailadmin/VIRTUAL_VACATION/vacation.pl /var/spool/vacation/
# chown -R vacation.vacation /var/spool/vacation/
# chmod 700 /var/spool/vacation/vacation.pl
# cd /var/spool/vacation/

### Install Cpan Command ###
# perl -MCPAN -e shell


### Modules Install Example ###
# cpan
cpan> install DBD::mysql


### Requirements - The Following Perl Modules Are Required: ###
DBD::mysql , Mail::Sender , Email::Valid , MIME::Charset , Log::Log4perl , Log::Dispatch , MIME::EncWords and Class::Load

# wget http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Log-Dispatch-2.32.tar.gz
# tar -xvf Log-Dispatch-2.32.tar.gz
# cd Log-Dispatch-2.32
# perl Makefile.PL
# make
# make install

# wget http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Params-Validate-1.06.tar.gz
# tar -xvf Params-Validate-1.06.tar.gz
# cd Params-Validate-1.06
# perl Build.PL
# ./Build && ./Build test
# ./Build install


### Change The Lines ###
# vim /var/spool/vacation/vacation.pl
our $db_type = 'mysql';
our $db_host = 'localhost';
our $db_username = 'postfix';
our $db_password = 'postfix';
our $db_name = 'postfix';
our $vacation_domain = 'autoreply.new.com';
our $log_to_file = 1;

save & quit

# perl vacation.pl -f rajiv@new.com raju@fosteringlinux.com

### Edit The Lines ###
# vim /etc/postfix/master.cf:
vacation unix - n n - - pipe
flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient}


# vim /etc/postfix/main.cf:
transport_maps = hash:/etc/postfix/transport

# vim /etc/postfix/transport
autoreply.new.com vacation:

# postmap hash:/etc/postfix/transport

# /etc/init.d/postfix restart | reload

### Change The Lines ###
# vim /var/www/html/mailadmin/config.inc.php
$CONF['vacation'] = 'YES';
$CONF['vacation_domain'] = 'autoreply.new.com';

### Open The Web Browser ###
Login to Mail admin then Create Email ID [ abc@new.com ] and [ test@new.com ] give the
Password [ XXXX ] and Logout

Login to User account [ abc@new.com ] and Set Auto Response then Logout

Log in to User account [ test@new.com ] Compose Mail
TO [ abc@new.com ]
Subject [ test mail ]
and Send

Click To [ inbox ] and check Auto Response Mail

In Case Some Problem in Auto Response Mail Check the maillog & vacation.log
Log file Path is

# tailf /var/log/maillog
# tailf /var/log/vacation.log

Comments

Popular posts from this blog

How to install and configure node js and PM2 in rhel7

PCS Corosync Pacemaker Cluster Mariadb using NFS

How to Create or Configure iSCSI Server and Clinet