View Single Post
  #3  
Old 2nd May 2013, 19:48
shiwu shiwu is offline
Junior Member
 
Join Date: May 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I encountered the same problem when trying configure following configuration:

Distribitution: CentOS release 6.4 (Final) + updates
postfix: 2.2.el6_1
Roundcube: 0.8.6
postfixadmin: 2.3.6

Perl modules required for vacation.pl were installed from EPEL. To do create new yum repo config file /etc/yum.repos.d/epel.repo:

Quote:
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

After every new mail was sent to email address, which had vacation active, in vacation log file the last entry was always:

Quote:
2013/05/02 15:23:29 DEBUG> /var/spool/vacation/vacation.pl:426 main::send_vacation_email - Already notified user1@mydomain.com, or some error prevented us from doing so
I spent a lot of time tracking the source of the problem. Finally I downloaded the lates available vacation.pl (version 4.0r1) script from that URL:
http://svn.code.sf.net/p/postfixadmi...ON/vacation.pl

After some searching I found that when return in line 490 is commented out the vacation start working fine. It seems that So open vacation.pl and find part of code containing:

Quote:
if ($rv == 1) {
my @row = $stm->fetchrow_array;
if (already_notified($email, $orig_from) == 1) {
$logger->debug("Already notified $email, or some error prevented us from doing so");
return;
}
When return is commented out, script do not ends in this if statement, and is continuing further till sending vacation message. after script modification I have now in vacation log file:

Quote:
2013/05/02 17:44:09 DEBUG> /var/spool/vacation/vacation.pl:489 main::send_vacation_email - Already notified user1@mydomain.com, or some error prevented us from doing so
2013/05/02 17:44:09 DEBUG> /var/spool/vacation/vacation.pl:494 main::send_vacation_email - Will send vacation response for <9501a8e91d7c1f72a1de0afec12e0058@mydomain.com>: FROM: user1@mydomain.com (orig_to: user1@mydomain.com), TO: user2@mydomain.com; VACATION SUBJECT: I'm on vacation ; VACATION BODY: I will replay to all emails when I'm back.
2013/05/02 17:44:12 DEBUG> /var/spool/vacation/vacation.pl:536 main::send_vacation_email - Vacation response sent to user2@mydomain.com, from user1@mydomain.com
I have also implement some more changes in vacation.pl script, which maybe useful:

Quote:
diff vacation.pl.oryg vacation.pl
335c335
< $interval = get_interval($to);
---
> #$interval = get_interval($to);
372c372
< my $query = qq{SELECT email FROM vacation WHERE email=? and active=$db_true and activefrom <= NOW() and activeuntil >= NOW()};
---
> my $query = qq{SELECT email FROM vacation WHERE email=? and active=$db_true and activefrom <= NOW() and activeto >= NOW()};
490c490
< return;
---
> #return;
499c499
< my $friendly_from = "Vacation Service";
---
> my $friendly_from = "$orig_to";
Reply With Quote