vacation/ 40755 63 124 0 7716602173 5701 vacation/CVS/ 40755 63 124 0 7640626706 6340 vacation/CVS/Root100644 63 124 106 7535157604 7264 crucible@cvs.userminvacation.sourceforge.net:/cvsroot/userminvacation vacation/CVS/Repository100644 63 124 31 7535157604 10475 userminvacation/vacation vacation/CVS/Entries100644 63 124 650 7640626706 7757 /config/1.1.1.1/Tue Sep 3 16:07:53 2002// /config.info/1.1.1.1/Tue Sep 3 16:07:53 2002// /module.info/1.1.1.1/Tue Sep 3 16:07:53 2002// D/images//// D/lang//// /Changelog/1.2/Thu Mar 27 16:56:04 2003// /README/1.4/Thu Mar 27 16:50:26 2003// /index.cgi/1.3/Thu Mar 27 16:27:55 2003// /save_vacation.cgi/1.2/Thu Mar 27 15:42:40 2003// /vacation-lib.pl/1.2/Thu Mar 27 16:37:19 2003// /version/1.4/Thu Mar 27 16:37:33 2003// vacation/Changelog100644 63 124 774 7640626444 7610 Changelog for Usermin::Vacation Version 0.9 - Rolled in a patch from Colin Hill at Duke University that allows the user to update their vacation message without cycling vacation on and off. Colin's patch also fixed the problem where user's couldn't update their from: line. Thanks Colin! - Implemented an RFE from Hank Mensinga to have vacation determine the hostname from the URL for virtual hosting enviroments. Version 0.5 - Added German translation contributed by Danny Trommer (dantro@esc.de) vacation/README100644 63 124 5323 7640625722 6667 Vacation Email Auto-Reply Settings module for Usermin by John Duksta Version 0.9 - 27 Mar 2003 --------------------------------------------------------------------- Description This Usermin module will allow users to enable and disable the vacation auto-reply program and set the vacation message. If a user already has a .forward file (if they're using procmail for example) it will save the existing ~/.forward to ~/.forward.vacation.bak and append the vacation command to their .forward file. Otherwise, it simply creates a new .forward with delivery to their mailbox and the pipe to vacation. It will also honor the 'edit-from' setting in the mailbox module. Thus, if the mailbox module is configured not to allow editing of the 'From:' line, neither will vacation. --------------------------------------------------------------------- Prerequisites This Usermin module is designed to work with Linux Vacation, which is a port of the BSD vacation program. It can be found at http://vacation.sourceforge.net/ I haven't tested with any other vacation programs. YMMV. --------------------------------------------------------------------- Installation Untar the vacation module into the Usermin directory and complete the required configuration below. --------------------------------------------------------------------- Required configuration The path to vacation must be set in Usermin Modules Configuration before this module will work properly for users. --------------------------------------------------------------------- Dependencies Checks the config of the mailbox module to determine the hostname to use for the user's 'From:' address. Vacation will now honor all the settings possible here, including getting the hostname from the URL. Also checks the 'edit-from' config option from the mailbox module and honors the setting. --------------------------------------------------------------------- To Do - Test 'From:' map lookup. It 'should' work as I copied the code for get_from() from reply_mail.cgi in the mailbox module, but I don't use maps here, so I really don't know if it will work. - Test if this works with qmail. I've been using Postfix for years now and have never tried qmail, so I have no idea if qmail honors .forward files. --------------------------------------------------------------------- Thanks to Jamie Cameron for Webmin and Usermin in general and for the code snippets I snagged from the mailbox module. Thanks to Danny Trommer for the German Translation. Thanks also go out to Jeffery Zeldman (http://www.zeldman.com) for the JR Bob Dobbs icon I used for this module. I suck at making icons and I figured JR Bob Dobbs was a good thing to denote vacation. Gotta accumulate slack. vacation/config100644 63 124 27 7535157131 7130 vacation_path=vacation vacation/config.info100644 63 124 41 7535157131 10056 vacation_path=Path to vacation,0 vacation/images/ 40755 63 124 0 7535157605 7152 vacation/images/CVS/ 40755 63 124 0 7535157605 7605 vacation/images/CVS/Root100644 63 124 106 7535157605 10532 crucible@cvs.userminvacation.sourceforge.net:/cvsroot/userminvacation vacation/images/CVS/Repository100644 63 124 40 7535157605 11743 userminvacation/vacation/images vacation/images/CVS/Entries100644 63 124 57 7535157605 11205 /icon.gif/1.1.1.1/Tue Sep 3 16:07:53 2002// D vacation/images/icon.gif100644 63 124 1563 7535157131 10672 GIF89a00Q$,3:3398q}KFsf !+32:FLS]k}cnt%)6;@Q\eu!,00:99: ï:Ȱ¼ װГ $ʯ%#,qO:(̠$}`(a $ ڱǎ:@y*tRW5mؽ{jb d#v4Y :V,3@:J"T'A\Ph'^EqQ% mOQ%(x;!NŊA5z k & x!GV1yQ >̀Aג@_̀Al]!-H/#DT$cWe:-rGbgoY"E}ŀI DࠃGy'WQ$(L\n"; # Open and parse an existing .vacation.msg file if (-e $vacation_file) { open(VACATION, $vacation_file); while() { chomp; $vacation_subject = &html_escape($1) if m/^Subject:\s(.*)/ ; $vacation_from = &html_escape($1) if m/^From:\s(.*)/ ; $vacation_body = $vacation_body.&html_escape($_)."\n" if !m/(^Subject:|^From)(.*)/ ; } close(VACATION); } else { $vacation_subject = &html_escape($text{'subject_text'}); $vacation_from = &html_escape(&get_from); $vacation_body = &html_escape($text{'body_text'}); } print "
\n"; print &text('index_desc'),"

\n"; print "\n"; # Get the Subject of the vacation reply print ""; print "\n"; # Get the From line (default this if $vacation_from is null) if ($mailbox_cfg{'edit_from'}) { print ""; print "\n"; } else { print ""; print "\n"; } print "
$text{'subject_desc'}
$text{'from_desc'}
$text{'from_desc'}$vacation_from
\n"; # Get the vacation message body print "$text{'body_desc'}
\n"; print "
\n"; print "
\n
"; if ($vacation_active) { print "\n"; print ""; } else { print "\n"; print ""; } print "
"; print "\n
\n
\n"; &footer("/", $text{'index'}); vacation/lang/ 40755 63 124 0 7640624477 6631 vacation/lang/CVS/ 40755 63 124 0 7640626706 7261 vacation/lang/CVS/Root100644 63 124 106 7535157605 10206 crucible@cvs.userminvacation.sourceforge.net:/cvsroot/userminvacation vacation/lang/CVS/Repository100644 63 124 36 7535157605 11424 userminvacation/vacation/lang vacation/lang/CVS/Entries100644 63 124 110 7640626706 10667 /de/1.2/Thu Mar 27 16:39:27 2003// /en/1.3/Thu Mar 27 16:39:08 2003// D vacation/lang/de100644 63 124 1144 7640624477 7246 # German translation contributed by Danny Trommer (dantro@esc.de) # index_title=automatische Abwesenheitsnotiz index_desc=Bitte tragen Sie Ihre automatische Antwort hier ein.
Oft ist es sehr nuetzlich, wenn Sie angeben, wann Sie wieder erreichbar sind und wer Sie waehrend Ihrer Abwesenheit vertritt. subject_desc=Betreff: subject_text=Abwesenheitsnotiz from_desc=Absender: body_desc=Nachricht: body_text=Ich bin im Moment nicht erreichbar. Bitte senden Sie Ihre Nachricht an meine Stellvertretung. vacation_enable=Aktiviere Abwesenheitsnachricht vacation_disable=Deaktiviere Abwesenheitsnachricht vacation/lang/en100644 63 124 762 7640624454 7240 index_title=Vacation Auto-Reply index_desc=Set your vacation auto-reply message here.
It's usually helpful to include when you will be back and who to contact while you're away. subject_desc=Subject: subject_text=Vacation auto-reply from_desc=From: body_desc=Message Body: body_text=I will be out of the office until next week. I will read your message regarding "$SUBJECT" when I return. vacation_enable=Enable Vacation vacation_disable=Disable Vacation vacation_update=Update Vacation Message vacation/lang/de~100644 63 124 1145 7553530316 7434 # German translation contributed by Danny Trommer (dantro@esc.de) # index_title=automatische Abwesenheitsnotiz index_desc=Bitte tragen Sie Ihre automatische Antwort hier ein.
Oft ist es sehr nuetzlich, wenn Sie angeben, wann Sie wieder erreichbar sind und wer Sie waehrend Ihrer Abwesenheit vertritt. subject_desc=Betreff: subject_text=Abwesenheitsnotiz from_desc=Absender: body_desc=Nachricht: body_text=Ich bin im Moment nicht erreichbar.\nBitte senden Sie Ihre Nachricht an meine Stellvertretung. vacation_enable=Aktiviere Abwesenheitsnachricht vacation_disable=Deaktiviere Abwesenheitsnachricht vacation/lang/de.rej100644 63 124 770 7640615736 10007 *************** *** 9,11 **** body_text=Ich bin im Moment nicht erreichbar.\nBitte senden Sie Ihre Nachricht an meine Stellvertretung. vacation_enable=Aktiviere Abwesenheitsnachricht vacation_disable=Deaktiviere Abwesenheitsnachricht --- 9,12 ---- body_text=Ich bin im Moment nicht erreichbar.\nBitte senden Sie Ihre Nachricht an meine Stellvertretung. vacation_enable=Aktiviere Abwesenheitsnachricht vacation_disable=Deaktiviere Abwesenheitsnachricht + vacation_update=Update-Ferien-Anzeige vacation/module.info100644 63 124 115 7535157131 10120 depends=0.940 desc=Vacation Auto-Reply version=0.940 usermin=1 name=Vacation vacation/save_vacation.cgi100755 63 124 1240 7640615760 11313 #!/usr/bin/perl # save_vacation.cgi # Save the user's vacation file require './vacation-lib.pl'; &ReadParseMime(); $in{'vacation_subject'} =~ s/\r//g; $in{'vacation_from'} =~ s/\r//g; $in{'vacation_body'} =~ s/\r//g; open(VACATION, ">$vacation_file"); print VACATION "Subject: ",$in{'subject'},"\n"; if ($mailbox_cfg{'edit_from'}) { print VACATION "From: ",$in{'from'},"\n"; } else { print VACATION "From: ",&get_from,"\n"; } print VACATION $in{'body'},"\n"; close(VACATION); # Activate vacation by tweaking .forward &start_vacation if ($in{'start_vacation'} == 1 && !$in{'update'}); &stop_vacation if ($in{'stop_vacation'} == 1 && !$in{'update'}); &redirect(""); vacation/vacation-lib.pl100644 63 124 6375 7723611201 10711 # vacation-lib.pl # # # Mod: June 28, 2003 (Carlton Thomas) # (1) Added a check for zero length forward files. # If a forward file is zero length then the module will ensure that # a copy of each message is sent to the user's mailbox and the vacation # program, otherwise, messages will only be sent to the vacation program # and will NOT be added to the user's mailbox. # # (2) Added alias support. # The module now assumes that the From address specified by the user is a # valid alias. The From address must be of the form user@domain. The module # adds the alias switch (-a) and specifies the "user" part of the From # address as the alias name. This works for aliases in the sendmail alias # file and virtual users in the sendmail virtusertable. use File::Copy; do '../web-lib.pl'; &init_config(); &switch_to_remote_user(); $vacation_file = "$remote_user_info[7]/.vacation.msg"; $vacation_db = "$remote_user_info[7]/.vacation.db"; $forward_file = "$remote_user_info[7]/.forward"; $forward_save_file = "$remote_user_info[7]/.forward.vacation.bak"; $vacation_active = &check_vacation_active; %mailbox_cfg = &foreign_config('mailbox'); # get_from - checks mailbox module configuration to # determine user's appropriate From: address. # returns a scalar containing the user's from address. sub get_from { $hostname = $mailbox_cfg{'server_name'} ? $mailbox_cfg{'server_name'} : &get_system_hostname(); $from = $remote_user.'@'.$hostname; if ($mailbox_cfg{'from_map'}) { open(MAP, $mailbox_cfg{'from_map'}); while() { s/\r|\n//g; s/#.*$//; if (/^\s*(\S+)\s+(\S+)/ && $from eq $1) { $from = $2; last; } } close(MAP); } $remote_user_info[6] =~ s/,.*$//; $from = "\"$remote_user_info[6]\" <$from>" if ($remote_user_info[6]); return $from; } # check_vacation_active - determines if vacation is currently active # returns 1 if yes, 0 if no. sub check_vacation_active { $active=0; open (FORWARD, "$forward_file"); while () { $active = 1 if (m/^[^#].*$config{'vacation_path'}/); } close (FORWARD); return $active; } # start_vacation - enables vacation by appending a line to their .forward # to call vacation. Also makes the system call to vacation to init $vacation_db sub start_vacation { local ($from) = @_; ($userpart, $domainpart) = split (/\@/, $from); # Check whether forward_file exists if ((-e $forward_file) && (!(-z $forward_file))){ #backup existing .forward file and add vacation pipe. copy("$forward_file","$forward_save_file"); open(FORWARD, ">>$forward_file"); print FORWARD "\"|$config{'vacation_path'} -a $userpart $remote_user\""; close(FORWARD); } else { open(FORWARD, ">$forward_file"); print FORWARD "\\$remote_user\n"; print FORWARD "\"|$config{'vacation_path'} -a $userpart $remote_user\""; close(FORWARD); } # Now make the system call to vacation to init .vacation.db system("$config{'vacation_path'} -I"); } # stop_vacation - if $forward_save_file exists, restore it; otherwise # remove .forward file. Also, delete $vacation_db sub stop_vacation { if (-e $forward_save_file) { copy("$forward_save_file","$forward_file"); unlink($forward_save_file); } else { unlink($forward_file); } unlink($vacation_db); } 1; vacation/version100644 63 124 4 7640624315 7323 0.9