From c3a4a6ed8d09950dd95b4c810d0f1445c92d65dd Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 14 Aug 2017 21:28:49 +0100 Subject: [PATCH] remove some comments from the top of vacation.pl; add links to file(s); remove unnecessary index.php --- VIRTUAL_VACATION/Contributions.txt | 93 ++++++++++++++ VIRTUAL_VACATION/{INSTALL.TXT => INSTALL.txt} | 29 ++++- VIRTUAL_VACATION/index.php | 22 ---- VIRTUAL_VACATION/vacation.pl | 119 ++---------------- 4 files changed, 127 insertions(+), 136 deletions(-) create mode 100644 VIRTUAL_VACATION/Contributions.txt rename VIRTUAL_VACATION/{INSTALL.TXT => INSTALL.txt} (91%) delete mode 100644 VIRTUAL_VACATION/index.php diff --git a/VIRTUAL_VACATION/Contributions.txt b/VIRTUAL_VACATION/Contributions.txt new file mode 100644 index 00000000..699af0ed --- /dev/null +++ b/VIRTUAL_VACATION/Contributions.txt @@ -0,0 +1,93 @@ +This file is not exhaustive. + +Please feel free to add yourself and a summary of changes to this file at the bottom if creating a pull request. + + +Postfixadmin was originally written by Mischa Peters + +Copyright (c) 2002 - 2005 High5! +Licensed under GPL for more info check GPL-LICENSE.TXT + + + +Additional authors: + +2004/07/13 David Osborn + strict, processes domain level aliases, more + subroutines, send reply from original to address + +2004/11/09 David Osborn + Added syslog support + Slightly better logging which includes messageid + Avoid infinite loops with domain aliases + +2005-01-19 Troels Arvin + PostgreSQL-version. + Normalized DB schema from one vacation table ("vacation") + to two ("vacation", "vacation_notification"). Uses + referential integrity CASCADE action to simplify cleanup + when a user is no longer on vacation. + Inserting variables into queries stricly by prepare() + to try to avoid SQL injection. + International characters are now handled well. + +2005-01-21 Troels Arvin + Uses the Email::Valid package to avoid sending notices + to obviously invalid addresses. + +2007-08-15 David Goodwin + Use the Perl Mail::Sendmail module for sending mail + Check for headers that start with blank lines (patch from forum) + +2007-08-20 Martin Ambroz + Added initial Unicode support + +2008-05-09 Fabio Bonelli + Properly handle failed queries to vacation_notification. + Fixed log reporting. + +2008-07-29 Patch from Luxten to add repeat notification after timeout. See: + https://sourceforge.net/tracker/index.php?func=detail&aid=2031631&group_id=191583&atid=937966 + +2008-08-01 Luigi Iotti + Use envelope sender/recipient instead of using + From: and To: header fields; + Support to good vacation behavior as in + http://www.irbs.net/internet/postfix/0707/0954.html + (needs to be tested); + +2008-08-04 David Goodwin + Use Log4Perl + Added better testing (and -t option) + +2009-06-29 Stevan Bajic + Add Mail::Sender for SMTP auth + more flexibility + +2009-07-07 Stevan Bajic + Add better alias lookups + Check for more heades from Anti-Virus/Anti-Spam solutions + +2009-08-10 Sebastian + Adjust SQL query for vacation timeframe. It is now possible to set from/until date for vacation message. + +2012-04-1 Nikolaos Topp + Add configuration parameter $smtp_client in order to get mails through + postfix helo-checks, using check_helo_access whitelist without permitting 'localhost' default style stuff + +2012-04-19 Jan Kruis + change SQL query for vacation into function. + Add sub get_interval() + Gives the user the option to set the interval time ( 0 = one reply, 1 = autoreply, > 1 = Delay reply ) + See https://sourceforge.net/tracker/?func=detail&aid=3508083&group_id=191583&atid=937966 + +2012-06-18 Christoph Lechleitner + Add capability to include the subject of the original mail in the subject of the vacation message. + A good vacation subject could be: 'Re: $SUBJECT' + Also corrected log entry about "Already informed ..." to show the $orig_from, not $email + +2017-07-14 Thomas Kempf + Replacing deprecated Mail::Sender by Email::Sender + Add configuration parameter $no_vacation_pattern in order to exlude specific alias-recipients from + sending vacation mails, even if one or multiple of the recipients the alias points to has vacation + currently active. + diff --git a/VIRTUAL_VACATION/INSTALL.TXT b/VIRTUAL_VACATION/INSTALL.txt similarity index 91% rename from VIRTUAL_VACATION/INSTALL.TXT rename to VIRTUAL_VACATION/INSTALL.txt index c7046a9e..675b229d 100644 --- a/VIRTUAL_VACATION/INSTALL.TXT +++ b/VIRTUAL_VACATION/INSTALL.txt @@ -14,9 +14,34 @@ There are a bunch of Perl modules which need installing, depending on your distribution these may be available through your package management tool, or will need installing through CPAN. -A full list of required modules can be found in the source of vacation.pl. -It obviously relies on Perl +Perl dependencies +----------------- + +Email::Valid +Email::Sender +Email::Simple +Email::Valid +Try::Tiny +MIME::Charset +MIME::EncWords +Log::Log4perl +Log::Dispatch +GetOpt::Std + +You may install these via CPAN, or through your package tool. + +CPAN: 'perl -MCPAN -e shell', then 'install Module::Whatever' + + + +On Debian based systems, you probably want these packages : + + apt-get install libemail-sender-perl libemail-simple-perl libemail-valid-perl libtry-tiny-perl libdbd-pg-perl libmime-perl liblog-log4perl-perl liblog-dispatch-perl libgetopt-argvfile-perl libmime-charset-perl libmime-encwords-perl libmime-encwords-perl + +and one of : libdbd-pg-perl or libdbd-mysql-perl + + About Virtual Vacation ---------------------- diff --git a/VIRTUAL_VACATION/index.php b/VIRTUAL_VACATION/index.php deleted file mode 100644 index 2f95cf27..00000000 --- a/VIRTUAL_VACATION/index.php +++ /dev/null @@ -1,22 +0,0 @@ - -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: index.php -// -// Template File: -none- -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// -header ("Location: ../login.php"); -exit; -?> diff --git a/VIRTUAL_VACATION/vacation.pl b/VIRTUAL_VACATION/vacation.pl index fb084e1d..4ba6ccd0 100644 --- a/VIRTUAL_VACATION/vacation.pl +++ b/VIRTUAL_VACATION/vacation.pl @@ -1,113 +1,13 @@ #!/usr/bin/perl # -# Virtual Vacation 4.1 -# -# $Revision$ -# Originally by Mischa Peters -# -# Copyright (c) 2002 - 2005 High5! -# Licensed under GPL for more info check GPL-LICENSE.TXT -# -# Additions: -# 2004/07/13 David Osborn -# strict, processes domain level aliases, more -# subroutines, send reply from original to address -# -# 2004/11/09 David Osborn -# Added syslog support -# Slightly better logging which includes messageid -# Avoid infinite loops with domain aliases -# -# 2005-01-19 Troels Arvin -# PostgreSQL-version. -# Normalized DB schema from one vacation table ("vacation") -# to two ("vacation", "vacation_notification"). Uses -# referential integrity CASCADE action to simplify cleanup -# when a user is no longer on vacation. -# Inserting variables into queries stricly by prepare() -# to try to avoid SQL injection. -# International characters are now handled well. -# -# 2005-01-21 Troels Arvin -# Uses the Email::Valid package to avoid sending notices -# to obviously invalid addresses. -# -# 2007-08-15 David Goodwin -# Use the Perl Mail::Sendmail module for sending mail -# Check for headers that start with blank lines (patch from forum) -# -# 2007-08-20 Martin Ambroz -# Added initial Unicode support -# -# 2008-05-09 Fabio Bonelli -# Properly handle failed queries to vacation_notification. -# Fixed log reporting. -# -# 2008-07-29 Patch from Luxten to add repeat notification after timeout. See: -# https://sourceforge.net/tracker/index.php?func=detail&aid=2031631&group_id=191583&atid=937966 -# -# 2008-08-01 Luigi Iotti -# Use envelope sender/recipient instead of using -# From: and To: header fields; -# Support to good vacation behavior as in -# http://www.irbs.net/internet/postfix/0707/0954.html -# (needs to be tested); -# -# 2008-08-04 David Goodwin -# Use Log4Perl -# Added better testing (and -t option) -# -# 2009-06-29 Stevan Bajic -# Add Mail::Sender for SMTP auth + more flexibility -# -# 2009-07-07 Stevan Bajic -# Add better alias lookups -# Check for more heades from Anti-Virus/Anti-Spam solutions -# -# 2009-08-10 Sebastian -# Adjust SQL query for vacation timeframe. It is now possible to set from/until date for vacation message. -# -# 2012-04-1 Nikolaos Topp -# Add configuration parameter $smtp_client in order to get mails through -# postfix helo-checks, using check_helo_access whitelist without permitting 'localhost' default style stuff -# -# 2012-04-19 Jan Kruis -# change SQL query for vacation into function. -# Add sub get_interval() -# Gives the user the option to set the interval time ( 0 = one reply, 1 = autoreply, > 1 = Delay reply ) -# See https://sourceforge.net/tracker/?func=detail&aid=3508083&group_id=191583&atid=937966 -# -# 2012-06-18 Christoph Lechleitner -# Add capability to include the subject of the original mail in the subject of the vacation message. -# A good vacation subject could be: 'Re: $SUBJECT' -# Also corrected log entry about "Already informed ..." to show the $orig_from, not $email -# -# 2017-07-14 Thomas Kempf -# Replacing deprecated Mail::Sender by Email::Sender -# Add configuration parameter $no_vacation_pattern in order to exlude specific alias-recipients from -# sending vacation mails, even if one or multiple of the recipients the alias points to has vacation -# currently active. +# Virtual Vacation 4.2 # +# See Contributions.txt for a list of contributions. +# https://github.com/postfixadmin/postfixadmin/blob/master/VIRTUAL_VACATION/Contributions.txt + +# See INSTALL.txt for help installing (and lists of dependent packages etc) +# https://github.com/postfixadmin/postfixadmin/blob/master/VIRTUAL_VACATION/INSTALL.txt -# Requirements - the following perl modules are required: -# DBD::Pg or DBD::mysql -# EMail::Sender,Email::Simple,Email::Valid,Try::Tiny,MIME::Charset, MIME::EncWords, Log::Log4perl, Log::Dispatch, and GetOpt::Std -# -# You may install these via CPAN, or through your package tool. -# CPAN: 'perl -MCPAN -e shell', then 'install Module::Whatever' -# -# On Debian based systems : -# libemail-sender-perl -# libemail-simple-perl -# libemail-valid-perl -# libtry-tiny-perl -# libdbd-pg-perl -# libmime-perl -# liblog-log4perl-perl -# liblog-dispatch-perl -# libgetopt-argvfile-perl -# libmime-charset-perl -# libmime-encwords-perl # # Note: When you use this module, you may start seeing error messages # like "Cannot insert a duplicate key into unique index @@ -115,12 +15,7 @@ # behavior, and not an indication of trouble (see the "already_notified" # subroutine for an explanation). # -# You must also have the Email::Valid and MIME-tools perl-packages -# installed. They are available in some package collections, under the -# names 'perl-Email-Valid' and 'perl-MIME-tools', respectively. -# One such package collection (for Linux) is: -# http://dag.wieers.com/home-made/apt/packages.php -# + use utf8; use DBI; use Encode qw(decode);