#!/usr/bin/perl #!c:/perl/bin/perl.exe # The above line may need to be changed to reflect the location of # the perl interpreter on your system. Use "which perl" on a Unix system # to make a noble attempt to locate your perl interpreter. If you are # installing this on an NT IIS server then you probably do not need to # modify this line because it will most likely be ignored. Apache under # NT generally DOES require the top line to be configured. We have provided # two common paths above as examples, only the top line will be used, the # second line is just there to provide an example. ############################################################################ # MailMan, Standard Edition, version 3.0.35 # # Copyright (c) 1996 - 2001, Endymion Corporation. All rights reserved. # Endymion Corporation: http://www.endymion.com/ # by Ryan Alyn Porter, 1996 - 2001 # contributions by Stephen M Noa, 2001 # # This product is not free and is not in the public domain. # For detailed information on the licensing structure of MailMan, see # http://www.endymion.com/products/mailman/ # # Initiated: 9/07/1997 Version 1.1 # Re-awakened: 4/24/1998 Version 2.0 beta # Released: 7/20/1998 Version 2.0 # Last Modified: 7/25/2001 Version 3.0.35 ############################################################################ # If you are having problems with MailMan not working at all, please # take a look at the MailMan FAQ, stored online at # http://www.endymion.com/products/mailman/faq.htm. A version of the FAQ # should also have been in the distribution that contained this file. package mailman; # Enable these while you are working on modifications. Make absolutely # certain that 'use strict' is NOT enabled in production installations. # CGI.pm and 'use strict' are not compatible, if you have 'use strict' # enabled then your users will not be able to upload files because CGI.pm # provides uploaded files using a bizarre on-the-fly file handle that will # cause an error if you have 'use strict' enabled. We think that this is # ugly too, but there is no way around it at the moment. #use strict; #$^W = 1; # Warnings. # If you are getting mysterious "Internal Server Error" messages when # you try to run MailMan, then you might want to un-comment this line # to get a decent log of the error in a location that you can find. #BEGIN #{ # open(STDERR, 'c:/tmp/mailman_log.txt'); #} # Version information that might find its way into output. $mailman::strMailManVersion = 'v3.0.35'; $mailman::strMailManEdition = 'Standard Edition'; # Variable initialization. Clean and neat and all, but very necessary # for mod_perl. InitializeVars(); ############################################################################ # This section contains a few variables that you might need to set in order # to get MailMan functioning properly. If your installation is working, # then you don't need to worry about any of these. ############################################################################ # Location Attachments # When a user selects an attachment from a message for downloading, # MailMan generates that attachment on-the-fly and sends it through the # HTTP server to the user's browser. MailMan includes the necessary # HTTP header information for the user's browser to determine the # file name, but many broswers, most notably Microsoft's Internet # Explorer, either ignore these headers or just don't handle them # very well. The result is that when a user downloads an attachment, # your browser may present the user with a "Save As" box with the # file name filled in as the name of this script, a string or random # characters, or any number of other un-graceful things. We think that # the best solution to this problem would be for browser makers to # pay attention to HTTP headers, but until then we provide a mechanism # for working around the problem. If you set up a directory that is # writable by MailMan and readable by your web server, then MailMan # will write out the attachment file to that directory temporarily, # and redirect the user's browser to that file. When the user logs # in or out MailMan will ensure that the user's files in this # temporary directory are removed. A user that exits MailMan without # logging out and never logs back in could potentially leave stale # attachment files on the server, so occasional monitoring of the # temporary directory for stale files would be appropriate. Also note # that this mechanism could be considered a privacy problem since a # user's attachments are deposited temporarily into a world-readable # directory rather than generated on-the-fly the way MailMan normally # would do. We have left the decision up to each individual # administrator as to whether or not to use this feature. Most people # seem to prefer allowing MailMan to generate attachments on-the-fly # for simplicity, ease of administration, and security/privacy, but # some people think that the attachment file name thing is a critical # issue. The decision is yours. # IMPORTANT SECURITY ADVISORY: # Make absolutely certain that the directory that you use for # attachments does *NOT* allow executable code. Do NOT use this # method of attachment handling if you are not absolutely certain # that executable code is not allowed in that directory. If your # temporary directory allows executable code then any attachments # that end in ".cgi", ".php", ".pl", etc, may be executed by your # server when they are accessed, rather than simply served. You do # *NOT* want this. # To use this feature, create a directory that is readable by your # web server and writable by the user that MailMan runs as. Set # $mailman::strLocalLocationAttachments to the local path name of # this directory, for instance # $mailman::strLocalLocationAttachments = '/public_html/attachtmp/'; # Then set $mailman::strURLLocationAttachments to the URL location # of this directory, for instance # $mailman::strURLLocationAttachments = '/attachtmp/'; # Note the terminal slashes at the end, those are necessary. Just # set and uncomment the following lines to use this feature: #$mailman::strLocalLocationAttachments = 'c:/www/public_html/mailman/tmp/'; #$mailman::strURLLocationAttachments = '/mailman/tmp/' # Local File Permissions # Use this if you want to modify the permissions that files and # directories created by MailMan use. This will only make much sense # to Unix and Unix-like operating systems. If this value is not set, # nothing will happen. This should be an octal integer as in the # example below, not a string. # This value will only matter if you set # $mailman::strLocalLocationAttachments and # $mailman::strURLLocationAttachments, of course. $mailman::iLocalFilePermissions = 0666; # Local Directory Permissions # Same as above, used for directories created by MailMan. # This value will only matter if you set # $mailman::strLocalLocationAttachments and # $mailman::strURLLocationAttachments, of course. $mailman::iLocalDirectoryPermissions = 0777; # Outgoing Banner Text # This is the banner that is appended to the end of any message that # this MailMan installation sends. One reason why this is one of the # first configuration options is because we want to make it very # obvious that you can remove or modify this banner. Endymion places # no restrictions at all on this banner, so don't worry about leaving # credit to us in here or anything like that. Please feel free to # change this to whatever you like, or completely remove it. If this # value is not defined then it will simply append no banner. $mailman::strOutgoingBannerText = "\n" . "---------------------------------------------\n" . "This message was sent using the Spirit Lake Nation Webmail.\n" . "http://www.spiritlakenation.com/\n"; # Incoming Mail Server: # The way that we originally intended to allow people to 'rig' the server # names for an installation was through simple template modifications, as # mentioned in the FAQ. A lot of people have asked about ways to rig the # server names in the script itself though, so we added this. We aim to # please... If you want to rig your incoming server name so that it makes # no difference at all what an incoming form specifies, just un-comment # this line and specify it. $mailman::strIncomingServer = 'mail.spiritlakenation.com'; # Outgoing Mail Server: # Same deal, different server. $mailman::strOutgoingServer = 'mail.spiritlakenation.com'; # Sendmail Path: # If you would like your MailMan installation to use a local Sendmail # invocation when sending outbound mail instead of connecting to an # SMTP server, then you can un-comment this line and configure this to # point to the path of your Sendmail command. Use this if you do not # have an SMTP server running at all. # This might also work with some minor modification with other # command-line agents that support something like Sendmail's "-bs" # option, which instructs Sendmail to use the SMTP protocol via standard # input and standard output. If you have access to an SMTP server then # you are really probably better off using the wire connection instead # of this. #$mailman::strLocalLocationSendmail = '/usr/sbin/sendmail'; # From Domain Name: # Set this variable to override the domain name that is assumed when a # user logs in. For instance, when the user "rap" logs into the POP3 # server "mail5.it.endymion.com", MailMan will assume that his address # is "rap@mail5.it.endymion.com". If you set this variable to # "endymion.com", then it will assume that his address is # "rap@endymion.com" instead. If the mapping between POP3 user names # and email addresses is more complicated then you will need to actually # build your own routines to do the mapping. For instance, if the user # "endy-rap" at the POP3 server "shell1.ba.best.com" actually receives # mail at the address "rap@endymion.com", then you will need to do make # your own custom mapping routine to deal with this. #$mailman::strFromDomainName = "endymion.com"; # From Domain Trim: # If the above option doesn't work for you, you can set this value to # instruct MailMan to trim the machine name when it derives the 'from' # email address. The number that you set this to represents the total # number of names to shear off of the left-hand side of the machine # name. For instance, if the user's POP3 server name is # "mail.rex.endymion.com", and you set this value to 0, the default, # then when the user composes a message MailMan will guess # "username@mail.rex.endymion.com" as the 'from' address. If you set # this value to 1 then it will guess "username@rex.endymion.com", if # you set it to 2 then it will guess "username@endymion.com", etc. This # can be helpful if you have a number of different virtual domains # and you want the email address to be inferred dynamically, rather # than by hard-coding it with the "From Domain Name" configuration value. $mailman::iFromDomainTrim = 1; # Outgoing Domain Name: # When a user specifies a recipient name without full domain qualification # ("rap" instead of "rap@endymion.com", for example) then the SMTP server # should provide configuration rules for determining how to deal with this # mail. It should not be the responsibility of the mail client to fill in # a complete address. We have had many requests for a feature to allow # an administrator to specify a default domain name, however, and we aim # to please. This configuration variable is the result. If you want # MailMan to assume a default domain name when it is given an incomplete # address, uncomment this line and set it to your domain name. We strongly # recommend against this, however, you should be looking into your SMTP # server's configuration options and not using this feature. #$mailman::strOutgoingDomainName = 'endymion.com'; # Messages Per Page: # This value controls the number of messages returned per page in a # message list. Adjust it if you like. $mailman::iMessagesPerPage = 10; # Redirect Location # MailMan can redirect users to an alternate web page instead of the login # page when logging out. To redirect to an alternate location besides the # default login page you need to uncomment the line below and set it to the # URL location of the page you want to use. $mailman::strURLRedirectLocation = 'http://www.spiritlakenation.com/'; # Local Template Location: # If you have a web server that sets the current directory to something # strange, you can set this to an absolute path to make it easier to # allow MailMan to find the templates. Just set this variable to an # absolute path like "C\:\\inetpub\\wwwroot\\mailman\\templates\\" # or '/usr/home/rap/mailman/' or whatever. Note the final slash, that's # important. If you leave it out then things won't work. If you need # to set this value, then un-comment the following line: #$mailman::strLocalTemplateLocation = "D:/inetpub/wwwroot/Endymion2/products/mailman/demo/"; # Local Script Location: # If your server is one of the ones that causes problems that require the # above value to be set, then you might also need to set this value. In # most cases your script location and your template location will be # identical, but if you move your templates to a different directory than # your script for whatever reason, then you will need to set this. If you # have no idea what I'm talking about, you should probably just leave this. $mailman::strLocalScriptLocation = $mailman::strLocalTemplateLocation; # URL Image Location: # Use this to rig the URLs that will be used to access the images that # the templates point to. This value will be prepended to any value in # the templates of the form ""i_*.gif"" (including the inner quotes). # If you have customized your templates and your own custom images are # not showing up in MailMan's output, it is probably because the custom # images that you are using are not named "i_*.gif". # To use this variable, set it to the exact value that you want prepended # to image names in order to make them into URLs that will point to your # image directory. For instance, if you bury your images in an "images" # directory under the directory where MailMan is installed, set this to # 'images/' (with the slash). If you put your images in a completely # different directory, something that is rooted, like '/mailman/images/' # might be what you are looking for. In the most extreme cases you can # do away with relative URLs entirely and provide a complete absolute URL # like the one below #$mailman::strURLImageLocation = 'http://www.endymion.com/images/'; # Use Perl 'alarm()' function: # Set this to true if your Perl interpreter supports "alarm". As of this # Writing, NT Perl does not. If this is not set, MailMan will not be able # to timeout when a server hangs. The OSSettings() routine will attempt # to set this variable, but you can override it here if you want. # The point of the "alarm" feature as used in MailMan is to allow MailMan # to detect when a mail server has not responded within a reasonable # amount of time. If your server's Perl interpreter does not support # "alarm", then MailMan will still work, but if a mail server ever does # not respond then the user will get no feedback to that effect. #$mailman::bUseAlarm = 1; # Timeout Duration: # The aforementioned timeout delay. Set this to something else to modify # how long MailMan will sit around waiting for a mail server to respond. # Only works if $mailman::bUseAlarm is set to something. $mailman::iTimeoutDurationInSeconds = 180; # Use Perl 'crypt()' function: # Some Perl impelentations apparently do not support the crypt() function. # We have never seen one, and there are plenty of implementations out there # that you should be able to find a good one, but we try to accomodate # anyway. Comment out this line if your Perl implementation is breaking # on the crypt() function. Be warned that if you do this your users' # usernames and passwords will be less obfuscated than they were before, # which admittedly wasn't much. This is a good place to repeat the # suggestion that MailMan is an excellent candidate for SSL and other # fancy HTTP security mechanisms. #$mailman::bUseCrypt = 1; # Use Hijack Test: # MailMan performs a test to determine if the current session has been # hijacked by a different user from a different address. On a few # systems this will not work because of the configuration. If your # MailMan installation sits behind a cluster of caching proxy servers # for load balancing, for instance. If you want to disable the hijack # checking functionality, just comment out this line. #$mailman::bUseHijackTest = 1; # Kiosk Mode: # If you are using MailMan in a kiosk environment, it will generally # be possible for a user to use a combination of "BACK" and "RELOAD" in # the kiosk web browser to intrude backwards into the mail sessions of # previous users. If you set this value then MailMan will operate in # kiosk mode, which means that when a user logs in, MailMan will create # a new browser window with that user's session. If the user logs out # then that window will close, and the user's history information will # go with the window so that intrusions with "BACK" and "RELOAD" aren't # possible. We recommend against using this feature for installations # that are not kiosk-based because it relies on Javascript and cookies, # which does not leave users with older browsers with a way in. If you # are in a kiosk environment then you have control over the browser an # that's not a problem. We strongly recommend against using the # Microsoft Internet Explorer for kiosk environments because it does not # properly respect the "Expires:" and "Cache-control:" HTTP headers, so # IE will cache user mail to the hard drive whether you want it to or # not. Microsoft appears to have no interest in fixing this problem. # IE 4 SP1 pretty consistently crashed during our tests of the # full-screen popup window kiosk mode, too, which is likely not exactly # the behavior that you are looking for in your kiosk browser. # The kiosk mode feature primarily activates and deactivates sections # of outbound templates, so if you have customized your templates before # you decided to use kiosk mode then it is entirely possible that you # broke this mode by removing vital Javascript. Consult the # out-of-the-box template set for examples of the Javascript snippets # necessary for this mode. #$mailman::bKioskMode = 1; ############################################################################ # You should not have to configure any values after this line. ############################################################################ use Socket; use FileHandle; my($mma) = new FileHandle(); use CGI; my($mmb) = new CGI; { my(@mmc) = $mmb->param; my($mmd) = 0; for($mmd=0;$mmd<$#mmc+1;$mmd++) { my($mme) = $mmc[$mmd];; if($mme =~ /^(.+)\.[xy]$/) { my($mmf) = $1; if($mme =~ /^([^\#]+)\#(.*)\.[xy]$/) { $mmf = $1; $mmb->param($mmf,mmmm($2)); } else { $mmb->param($mmf,'MAILMANSPECIALTRUE'); } $mmb->delete("${mmf}.x"); $mmb->delete("${mmf}.y"); } else { if($mme =~ /^([^\#]+)\#(.*)$/) { $mmb->param($1,mmmm($2)); } } } } if($mmb->param('INTERFACE')) { my(@mmg) = split(/\&/,$mmb->param('INTERFACE')); my($mmh) = ''; foreach $mmh (@mmg) { if($mmh =~ /^([^\=]+)\=(.*)$/) { $mmb->param($1,mmmm($2)); } } unless($mmb->param('INTERFACE') =~ /ALTERNATE_TEMPLATES/) { $mmb->param('ALTERNATE_TEMPLATES',''); } } { @mailman::mmi = split(/\;/,$ENV{'HTTP_COOKIE'}); my($mmj) = ''; foreach $mailman::mmj (@mailman::mmi) { $mailman::mmk = 1; if($mailman::mmj =~ /MailManAuth\=(\S+)/) { my(@mml) = split(/\&/,$1); my($mmm) = ''; foreach $mmm (@mml) { $mmm =~ /^(.+)\#(.+)$/; unless($mmb->param($1)) { $mmb->param($1,$2); } } } } } $mailman::mmn = mmmq($mmb->param('USERNAME')); $mailman::mmn =~ s/^\s*([^\s]+)\s*$/$1/; if($mailman::mmo) { $mailman::mmn =~ tr/[A-Z]/[a-z]/; } $mailman::mmp = mmmp($mailman::mmn); $mailman::mmq = mmmq($mmb->param('PASSWORD')); $mailman::mmq =~ s/^\s*([^\s]+)\s*$/$1/; $mailman::mmr = mmmp($mailman::mmq); unless($mailman::strIncomingServer) { $mailman::strIncomingServer = mmmq($mmb->param('SERVER')); $mailman::strIncomingServer =~ s/^\s*([^\s]+)\s*$/$1/; $mailman::strIncomingServer =~ tr/[A-Z]/[a-z]/; } $mailman::mms = mmmp($mailman::strIncomingServer); unless($mailman::strOutgoingServer) { $mailman::strOutgoingServer = $mmb->param('OUTGOING'); $mailman::strOutgoingServer =~ s/^\s*([^\s]+)\s*$/$1/; $mailman::strOutgoingServer =~ tr/[A-Z]/[a-z]/; } $mailman::mmt = ''; if(defined($mailman::strLocalLocationAttachments) && defined($mailman::strURLLocationAttachments)) { unless($mailman::strLocalLocationAttachments =~ /[\/\\]$/) { $mailman::strLocalLocationAttachments .= '/'; } unless($mailman::strURLLocationAttachments =~ /[\/\\]$/) { $mailman::strURLLocationAttachments .= '/'; } $mailman::mmu = $mailman::strLocalLocationAttachments . mmml($mailman::mmn . '@' . $mailman::strIncomingServer); $mailman::mmv = $mailman::strURLLocationAttachments . mmml( mmml($mailman::mmn . '@' . $mailman::strIncomingServer)); $mailman::mmw = 1; } $mailman::mmx = mmmk($ENV{SERVER_NAME},42); $mailman::mmx .= mmmk($ENV{REMOTE_HOST} . $ENV{REMOTE_ADDR},69); $mailman::mmy = mmmp($mailman::mmx); mmmj(); $mailman::mmz = $ENV{SCRIPT_NAME}; unless($mailman::mmz =~ /^\//) { $mailman::mmz = "/$mailman::mmz"; } $mailman::mmaa = $mailman::mmz; $mailman::mmaa =~ s/^(.*[\\\/])[^\\\/]+$/$1/; if($mailman::mmaa eq '/') { $mailman::mmab = ''; } else { $mailman::mmab = "path=$mailman::mmaa; "; } sub mmku { if($mmb->param('NOFRAMES')) { $mailman::mmac = 1; } if($mmb->param('NOCACHE')) { $mailman::mmad = 1; } if(defined($mmb->param('ALTERNATE_TEMPLATES'))) { $mailman::mmae = $mmb->param('ALTERNATE_TEMPLATES'); } } sub mmkv { my($mmaf) = shift; my(@mmc) = $mmb->param; my($mmd) = 0; for($mmd=0;$mmd<$#mmc+1;$mmd++) { my($mme) = $mmc[$mmd];; if($mme =~ /^$mmaf\:(.*)$/) { return $1; } } return; } mmku(); mmkw(); { my($mmj) = ''; @mailman::mmi = split(/\;/,$ENV{'HTTP_COOKIE'}); foreach $mailman::mmj (@mailman::mmi) { if($mailman::mmj =~ /MailManCmds\=(\S+)/) { my($mmag) = ''; @mailman::mmah = split(/\&/,$1); foreach $mmag (@mailman::mmah) { $mmag =~ /^(.+)\#(.+)$/; unless($mmb->param($1)) { $mmb->param($1,$2); } } } } } mmku(); mmkw(); mmkz(); sub mmkw { my($mmai) = ''; if($mmb->param('BLANK')) { mmmi('t_blank.htm'); } if($mmb->param('MENU')) { mmmi('t_f_menu.htm'); } if($mmb->param('LOGOUT')) { if($mailman::mmw) { mmmx(); } if($mailman::bKioskMode) { print "Set-cookie: MailManAuth=;$mailman::mmab" . "expires=Sun, 03-May-1998 16:00:00 GMT\n"; print "Set-cookie: MailManCmds=;$mailman::mmab" . "expires=Sun, 03-May-1998 16:00:00 GMT\n"; print "Set-cookie: MailManDir=;$mailman::mmab" . "expires=Sun, 03-May-1998 16:00:00 GMT\n"; $mailman::mmn = ''; mmmi('t_closewindow.htm'); } else { if($mailman::strURLRedirectLocation) { print "Location: $mailman::strURLRedirectLocation\n\n"; } else { mmkz(); } } } if($mmb->param('START')) { mmkz(); } if($mmb->param('LOGIN')) { my($mmaj) = ''; if($mmaj = mmlb()) { if(defined($mmaj)) { $mmaj =~ s/^\-ERR(.*)$/$1/; } $mailman::bKioskMode = 0; $mailman::mmak{'GREETING'} = "
Log In Error: $mmaj
"; mmmi('t_login.htm',\%mailman::mmak); } if($mailman::mmw) { mmmx(); } if($mailman::mmac) { mmli(); } else { mmmi('t_f_frameset.htm'); } } if($mailman::bUseHijackTest && $mmb->param('CHECKSUM') && $mmb->param('CHECKSUM') ne '') { if(mmmq($mmb->param('CHECKSUM')) ne $mailman::mmx) { mmkx( qq|Your MailMan session was initiated from a different network address than\n| . qq|your current location. For security reasons, MailMan will not continue.\n| . qq|You must log in again\n| . qq|from this location to continue.\n| ); } } if($mmb->param('RELOAD')) { if($mailman::mmac) { mmli(); } else { mmmi('t_f_frameset.htm'); } } if($mmai = mmkv('LIST')) { mmli($mmai); } if($mmb->param('LIST')) { mmli(); } my($mmal) = $mmb->param('BACKGROUND'); if($mmal) { if($mailman::mmac) { print "Location: $mmal\n\n"; exit(0); } else { mmlh($mmal); } } if($mmal = $mmb->param('BACKGROUNDFRAME')) { mmmi('t_backgroundframe.htm'); } if($mmai = mmkv('SHOW')) { my($mmam) = -1; if($mmai =~ /^(.+)mimepart\:(.+)$/) { $mmam = $1; $mailman::mman = $2; $mailman::mman =~ s/%(..)/pack("c",hex($1))/ge; } elsif($mmai =~ /^(.+)cid\:(.+)$/) { $mmam = $1; $mailman::mmao = $2; $mailman::mmao = mmmm($2); } else { $mmam = $mmai; } $mmam = mmmm($mmam); mmlv($mmam,0); } if($mmai = mmkv('SOURCE')) { my($mmam) = mmmm($mmai); mmlw($mmam); } if($mmai = mmkv('PREV')) { my($mmam) = mmmm($mmai); mmlv($mmam,-1); } if($mmai = mmkv('NEXT')) { my($mmam) = mmmm($mmai); mmlv($mmam,1); } if($mmai = mmkv('DELETE')) { my($mmaj) = mmlb(); if($mmaj) { mmkx($mmaj); } my($mmam) = mmmm($mmai); mmly($mmam); mmla($mma,"QUIT"); close $mma; $mailman::mmap = 0; if($mailman::mmac) { mmli(); } else { mmmi('t_f_frameset.htm'); } } if($mmb->param('DELETEMARKED')) { my($mmaj) = ''; if($mmaj = mmlb()) { mmkx($mmaj); } my(@mmc) = $mmb->param; my($mmd) = 0; for($mmd=0;$mmd<$#mmc;$mmd++) { my($mme) = $mmc[$mmd];; if($mme =~ /^MARK\:(.*)$/) { mmly(mmmm($1)); } } mmla($mma,"QUIT"); close $mma; $mailman::mmap = 0; if($mailman::mmac) { mmli(); } else { mmmi('t_f_frameset.htm'); } } if($mmai = mmkv('MOVE')) { my($mmaq) = mmml($mmb->param('FOLDERTRANSFERLIST')); if($mmaq eq 'MAILMANSPECIALSELECT' || $mmaq eq '') { mmli(); } my($mmaj) = ''; if($mmaj = mmlb()) { mmkx($mmaj); } my($mmam) = mmmm($mmai); if(CopyMessageToFolder($mmam,$mmaq)) { RemoveMessageFromFolder($mmam,'MOVED'); } mmla($mma,"QUIT"); close $mma; $mailman::mmap = 0; if($mailman::mmac) { mmli(); } else { mmmi('t_f_frameset.htm'); } } if($mmb->param('MOVEMARKED')) { my($mmaq) = mmml($mmb->param('FOLDERTRANSFERLIST')); if($mmaq eq 'MAILMANSPECIALSELECT' || $mmaq eq '') { mmli(); } my($mmaj) = ''; if($mmaj = mmlb()) { mmkx($mmaj); } my(@mmc) = $mmb->param; my($mmd) = 0; for($mmd=0;$mmd<$#mmc;$mmd++) { my($mme) = $mmc[$mmd];; if($mme =~ /^MARK\:(.*)$/) { my($mmam) = mmmm($1); if(CopyMessageToFolder($mmam,$mmaq)) { RemoveMessageFromFolder($mmam,'MOVED'); } } } mmla($mma,"QUIT"); close $mma; $mailman::mmap = 0; if($mailman::mmac) { mmli(); } else { mmmi('t_f_frameset.htm'); } } if($mmb->param('NEW')) { $mmb->param('ATTACH',0); mmlz('NEW',0,0); } if($mmb->param('USEATTACH')) { $mmb->param('ATTACH',1); mmma(''); } if($mmai = mmkv('REPLY')) { my($mmam) = mmmm($mmai); mmlz($mmam,0,0); } if($mmai = mmkv('REPLYALL')) { my($mmam) = mmmm($mmai); mmlz($mmam,1,0); } if($mmai = mmkv('FORWARD')) { my($mmam) = mmmm($mmai); mmlz($mmam,0,1); } if($mmb->param('SEND')) { mmmc(); } if($mmb->param('HELP')) { mmmi('t_help.htm'); } } sub mmkx { my($mmar,$mmas) = @_; my($mmat) = ''; if($mmar eq "ALRM") { if($mailman::bUseAlarm){ alarm(0); } $mmar = $mailman::mmau; mmla($mma,"QUIT"); close $mma; } if($mailman::mmac) { $mmat = 't_nf_error.htm'; } else { $mmat = 't_f_error.htm'; } my(%mmak); $mmak{'ERROR'} = $mmar; mmmi($mmat,\%mmak); unless($mmas) { exit(1); } } sub mmky { my($mmav) = @_; my($mmat) = ''; print CGI->multipart_start(); if($mailman::mmac) { $mmat = 't_nf_status.htm'; } else { $mmat = 't_f_status.htm'; } my(%mmak); $mmak{'STATUS'} = $mmav; mmmi($mmat,\%mmak); print CGI->multipart_end(); } sub mmkz { print "Set-cookie: MailManAuth=;$mailman::mmab" . "expires=Sun, 03-May-1998 16:00:00 GMT\n"; print "Set-cookie: MailManCmds=;$mailman::mmab" . "expires=Sun, 03-May-1998 16:00:00 GMT\n"; print "Set-cookie: MailManDir=;$mailman::mmab" . "expires=Sun, 03-May-1998 16:00:00 GMT\n"; print "Expires: Sun, 03 May 1998 16:00:00 GMT\n"; $mailman::mmn = ''; $mailman::mmaw = ''; if($mailman::bKioskMode) { my($mmax) = ''; ($mailman::mmak{'GREETING'},$mmax) = mmmh('t_login.htm', ('GREETING','KIOSKMODESCRIPT')); $mailman::mmak{'HTMLCOMMENTBEGIN'} = ''; $mailman::mmak{'KIOSKMODESCRIPT'} = mmme($mmax,\%mailman::mmak); $mailman::mmak{'HTMLCOMMENTBEGIN'} = ''; $mailman::mmak{'HTMLCOMMENTEND'} = ''; } else { $mailman::mmak{'GREETING'} = mmmg('t_login.htm','GREETING'); } mmmi('t_login.htm',\%mailman::mmak); } sub mmla { my($mmba) = "\015\012"; my($mmbb, $mmbc) = @_; my($mmbd) = length($mmbc . $mmba); syswrite($mmbb,$mmbc . $mmba,$mmbd); } sub mmlb { if($mailman::mmap){ return; } my($mmbe); unless(defined($mailman::mmn) && $mailman::mmn ne '') { return("No username provided, cannot proceed."); } unless(defined($mailman::mmq) && $mailman::mmq ne '') { return("No password provided, cannot proceed."); } unless(defined($mailman::strIncomingServer) && $mailman::strIncomingServer ne '') { return("No server provided, cannot proceed."); } retrylogin: if($mailman::bUseAlarm) { $mailman::mmau = "Connection to server timed out."; $SIG{'ALRM'} = \&mmkx; alarm($mailman::iTimeoutDurationInSeconds); } my($mmbf) = 0; $mmbf = getprotobyname('tcp'); socket($mma,PF_INET,SOCK_STREAM,$mmbf); my($mmbg) = 0; $mmbg = gethostbyname($mailman::strIncomingServer); unless($mmbg) { return("Could not find an IP address for the host " . "\"$mailman::strIncomingServer\"."); } my($mmbh) = ''; $mmbh = sockaddr_in(110, $mmbg); unless(connect($mma, $mmbh)) { return("Could not connect to server " . "\"$mailman::strIncomingServer\", \"$!\""); } select($mma); $|=1; select(STDOUT); binmode($mma); $mailman::mmau = "The server connected, but will not respond."; if($mailman::bUseAlarm){ alarm($mailman::iTimeoutDurationInSeconds); } unless(<$mma> =~ /^\+OK/) { return("The server does not respond appropriately."); } $mailman::mmau = "The server timed out during login."; if($mailman::bUseAlarm){ alarm($mailman::iTimeoutDurationInSeconds); } mmla($mma,"USER $mailman::mmn"); my($mmbi) = ''; $mmbi = <$mma>; unless($mmbi =~ /^\+OK/) { return($mmbi); } mmla($mma,"PASS $mailman::mmq"); $mmbi = <$mma>; unless($mmbi =~ /^\+OK/) { if((($mmbi =~ /another session/i) || ($mmbi =~ /another POP3 session/i) || ($mmbi =~ /mailbox in use/i) || ($mmbi =~ /unable to lock/i) || ($mmbi =~ /mailbox busy/i)) && $mmbe < 12) { mmla($mma,"QUIT"); close $mma; $mmbe++; sleep(5); goto retrylogin; } else { return "Access denied: $mmbi"; } return($mmbi); } if($mailman::bUseAlarm) { alarm(0); } mmla($mma,'STAT'); $mmbi = <$mma>; $mmbi =~ /^\+OK\s+(\d+)\s+/i; $mailman::mmbj = $1; if($mailman::mmbj == 0) { $mailman::mmap = 1; return; } mmla($mma,"LIST"); $mmbi = <$mma>; unless($mmbi =~ /^\+OK/) { return($mmbi); } $mailman::mmbj = 0; while(<$mma> =~ /(\d+) (\d+)/) { $mailman::mmbk[$1] = $2; $mailman::mmbj++; } $mailman::mmap = 1; return; } sub mmlc { my($mmbl) = @_; $mailman::mmau = "The server timed out fetching a header."; if($mailman::bUseAlarm){ alarm($mailman::iTimeoutDurationInSeconds); } mmla($mma,"TOP $mmbl 0"); my($mmbi) = ''; $mmbi = <$mma>; unless($mmbi =~ /^\+OK/) { mmkx($mmbi); } mmld($mma); $mailman::mmbm = $mmbl . 'H' . $mailman::mmbn; $mailman::mmbo = $mmbl; } sub mmld { my($mmbb) = shift; $mailman::mmbp = ''; $mailman::mmbq = ''; $mailman::mmbr = ''; $mailman::mmbs = ''; $mailman::mmbt = '0'; $mailman::mmbu = ''; $mailman::mmbv = ''; $mailman::mmbn = ''; $mailman::mmbw = 0; $mailman::mmbx = 0; my($mmby) = 0; my($mmbz) = 0; my($mmca) = 0; my($mmcb) = 1; my($mmcc) = ''; my($mmcd) = -1; while(defined($_ = <$mmbb>)) { if(/^[\r\n]+$/){ $mmby = 1; } if(/^\.[\r\n]*$/){ last; } if(/^Content-type\:\s+([^\;\s]+)[\;\s]/i) { my($mmce) = $1; if( ($mmce !~ /multipart\/alternative/i) && ($mmce !~ /text\//i)) { $mailman::mmbx = 1; } } if(/^begin \d\d\d (\S+)\s*$/i) { $mailman::mmbx = 1; } unless($mmby) { $mmcb = 1; if(/^To\:\s*(.+)$/i || ((/^\s(.+)$/) && $mmbz)) { $mailman::mmbp .= $1; $mailman::mmbp =~ s/^(.*)[\r\n]+$/$1/; $mailman::mmbp = mmle($mailman::mmbp); $mmcc .= $_; $mmbz = 1; $mmca = 0; $mmcb = 0; } if(/^CC\:\s*(.+)$/i || ((/^\s(.+)$/) && $mmca)) { $mailman::mmbq .= $1; $mailman::mmbq =~ s/^(.*)[\r\n]+$/$1/; $mailman::mmbq = mmle($mailman::mmbq); $mmcc .= $_; $mmbz = 0; $mmca = 1; $mmcb = 0; } if(/^From\:\s*(.+)$/i) { $mailman::mmbr = $1; $mailman::mmbr =~ s/^(.*)[\r\n]+$/$1/; $mailman::mmbr = mmle($mailman::mmbr); $mmcc .= $_; } if(/^Date\:\s*(.+)$/i) { $mailman::mmbs = $1; $mailman::mmbs =~ s/^(.*)[\r\n]+$/$1/; $mmcc .= $_; } if(/^Subject\:\s*(.+)$/i) { $mailman::mmbu = $1; $mailman::mmbu =~ s/^(.*)[\r\n]+$/$1/; $mailman::mmbu = mmle($mailman::mmbu); $mmcc .= $_; } if(/^Reply-To\:\s*(.+)$/i) { $mailman::mmbv = $1; $mailman::mmbv =~ s/^(.*)[\r\n]+$/$1/; $mmcc .= $_; } if(/^Message-ID\:\s*(.+)$/i) { $mailman::mmbn = $1; $mailman::mmbn =~ s/^(.*)[\r\n]+$/$1/; } if($mmcb) { $mmbz = 0; $mmca = 0; } } if(/^MIME-Version\:\s*1\.0/i) { if(!$mmby) { $mailman::mmbw = 1; } } } if($mailman::mmbn eq "") { $mailman::mmbn = $mmcc; while(length($mailman::mmbn)>20) { $mailman::mmbn = (substr($mailman::mmbn,0,20) ^ substr($mailman::mmbn,20)); } $mailman::mmbn = pack("u*",$mailman::mmbn); } $mailman::mmbn =~ s/(\W)/sprintf("%%%x", ord($1))/eg; unless($mailman::mmbp){ $mailman::mmbp = "Unknown";} unless($mailman::mmbr){ $mailman::mmbr = "Unknown";} unless($mailman::mmbs){ $mailman::mmbs = "Unknown";} unless($mailman::mmbu){ $mailman::mmbu = "Unspecified";} unless($mailman::mmbm){ $mailman::mmbm = "0";} $mailman::mmcf = mmlg($mailman::mmbp); $mailman::mmcg = mmlg($mailman::mmbr); $mailman::mmch = mmlg($mailman::mmbq); $mailman::mmci = mmlg($mailman::mmbu); $mailman::mmcj = mmlg($mailman::mmbs); } sub mmle { my $mmck = shift; $mmck =~ s/\=\?(iso-8859-1|us-ascii)\?q\?([^\?]+)\?\=/ mmlq(mmlp($2))/xeig; $mmck =~ s/\=\?(iso-8859-1|us-ascii)\?b\?([^\?]+)\?\=/ mmlr(mmlp($2))/xeig; return $mmck; } sub mmlf { my($mmam) = @_; $mmam =~ /^(\d+)H(.+)$/; my($mmcl) = $1; my($mmcm) = $2; if($1 eq '' || $2 eq '') { mmkx('The message ID string "' . $mmam . '" is poorly formed.'); } $mmcm =~ s/%(..)/pack("c",hex($1))/ge; $mailman::mmau = "The server timed out during message listing."; if($mailman::bUseAlarm){ alarm($mailman::iTimeoutDurationInSeconds); } mmla($mma,"LIST"); my($mmbi) = ''; $mmbi = <$mma>; unless($mmbi =~ /^\+OK/) { mmkx($mmbi); } $mailman::mmcn = 0; while(<$mma> =~ /(\d+) (\d+)/) { $mailman::mmbk[$1] = $2; $mailman::mmcn++; } my($mmd) = $mmcl; my($mmco) = 0; while($mmd>0) { mmlc($mmd); $mailman::mmbn =~ s/%(..)/pack("c",hex($1))/ge; if($mailman::mmbn eq $mmcm) { $mmco = 1; last; } $mmd--; } if(!$mmco) { $mailman::mmbp = ''; $mmd = $mmcl; mmlc($mmd); } if($mailman::mmbp eq '') { mmkx('Could not find the specified message.'); } return ($mmd); } sub mmlg { my($mmcp) = @_; $mmcp =~ s/\&/\&\;/g; $mmcp =~ s/\/\>\;/g; $mmcp =~ s/\%mmcq/\/g; my($mmcs) = '(http://|https://|ftp://)' . q%(?:&(?![gl]t;)|[^\s\(\)\|<>,"'\&])+% . q%[^\.?!;,"'\|\[\]\(\)\s<>\&]%; my($mmct) = "\$1\<\/a\>"/eig; if($mailman::mmac) { $mmcp =~ s/(href\=\"[^\"]*)(BACKGROUND\=)/${1}NOFRAMES\=TRUE&$2/g; } return $mmcp; } sub mmlh { my($mmcu) = shift; $mailman::mmak{'URL'} = $mmcu; mmmi('t_backgroundframeset.htm',\%mailman::mmak); } sub mmli { my($mmcv) = @_; unless(defined($mmcv)) { $mmcv = 0; } my($mmcw, $mmcx) = (0, 0); my($mmat) = ''; if($mailman::mmac) { if($mailman::mmaw eq 'SENT') { my($mmcy) = 't_nf_messagelistsent.htm'; if(defined($mailman::mmae)) { $mmcy = $mailman::mmae . $mmcy; } if(-e "${mailman::strLocalTemplateLocation}$mmcy") { $mmat = 't_nf_messagelistsent.htm'; } else { $mmat = 't_nf_messagelist.htm'; } } else { $mmat = 't_nf_messagelist.htm'; } } else { if($mailman::mmaw eq 'SENT') { my($mmcy) = 't_f_messagelistsent.htm'; if(defined($mailman::mmae)) { $mmcy = $mailman::mmae . $mmcy; } if(-e "${mailman::strLocalTemplateLocation}$mmcy") { $mmat = 't_f_messagelistsent.htm'; } else { $mmat = 't_f_messagelist.htm'; } } else { $mmat = 't_f_messagelist.htm'; } } my($mmcz, $mmda, $mmdb, $mmdc) = ('','','',''); ($mmcz, $mmda, $mmdc, $mmdb) = mmmh($mmat, ('MESSAGE_EVEN', 'MESSAGE_ODD', 'ATTACHMENT_IMAGE', 'UNREAD_IMAGE')); my($mmaj) = ''; if($mmaj = mmlb()) { mmkx($mmaj); } $mailman::mmak{'USERNAME'} = $mailman::mmn; $mailman::mmak{'USERNAMEHIDDEN'} = $mailman::mmp; $mailman::mmak{'SERVERHIDDEN'} = $mailman::mms; $mailman::mmak{'PASSWORDHIDDEN'} = $mailman::mmr; $mailman::mmak{'CHECKSUM'} = $mailman::mmy; $mailman::mmak{'NUM'} = $mailman::mmbj; if(defined($mailman::strFromDomainName)) { $mailman::mmak{'SERVER'} = mmmz($mailman::strFromDomainName); } else { $mailman::mmak{'SERVER'} = mmmz($mailman::strIncomingServer); } if($mailman::mmbj > 0) { $mailman::mmau = "The server timed out during message listing."; if($mailman::bUseAlarm){ alarm($mailman::iTimeoutDurationInSeconds); } mmla($mma,"LIST"); my($mmbi) = ''; $mmbi = <$mma>; unless($mmbi =~ /^\+OK/) { mmkx($mmbi); } $mailman::mmbj = 0; while(<$mma> =~ /(\d+) (\d+)/) { $mailman::mmbk[$1] = $2; $mailman::mmbj++; } } if($mailman::mmbj > 0) { if($mmcv == 0) { $mmcv = $mailman::mmbj; } my($mmdd); if($mailman::mmbj > 1) { my($mmde) = 0; for($mmde=$mailman::mmbj; $mmde>0; $mmde-=$mailman::iMessagesPerPage) { my($mmdf) = $mmde; my($mmdg) = $mmde-$mailman::iMessagesPerPage+1; my($mmdh) = ''; if($mmdg<1) { $mmdg = 1; } if($mmcv <= $mmdf && $mmcv >= $mmdg) { $mmdd = 1; $mmcw = $mmdf; $mmcx = $mmdg; } else { $mmdd = 0; } if($mmdf == $mmdg) { $mmdh = "$mmdf"; } else { $mmdh = "$mmdf-$mmdg"; } if($mailman::mmac) { if($mmdd) { $mailman::mmak{'PAGELINKS'} .= "[$mmdh] "; } else { $mailman::mmak{'PAGELINKS'} .= qq||; } } else { if($mmdd) { $mailman::mmak{'PAGELINKS'} .= "[$mmdh] "; } else { $mailman::mmak{'PAGELINKS'} .= qq|| . qq|[$mmdh] |; } } } } else { $mailman::mmak{'PAGELINKS'} = ''; $mmcw = 1; $mmcx = 1; } } if($mailman::mmbj > 0) { $mailman::mmak{'MESSAGELIST'} = ''; my($mmde) = 0; for($mmde=$mmcw;$mmde>=$mmcx;$mmde--) { mmlc($mmde); $mailman::mmak{'FROM'} = $mailman::mmcg; $mailman::mmak{'TO'} = $mailman::mmcf; $mailman::mmak{'SUBJECT'} = $mailman::mmci; $mailman::mmak{'DATE'} = $mailman::mmcj; $mailman::mmak{'ID'} = $mailman::mmbm; $mailman::mmak{'MESSAGENUM'} = $mmde; $mailman::mmak{'SIZE'} = $mailman::mmbk[$mmde]; if($mailman::mmbx) { $mailman::mmak{'ATTACHMENT_IMAGE'} = $mmdc; } else { $mailman::mmak{'ATTACHMENT_IMAGE'} = ''; } $mailman::mmak{'OPENIMAGE'} = $mmdb; my($mmdi); if($mmde%2==0) { $mmdi = mmme($mmcz,\%mailman::mmak); } else { $mmdi = mmme($mmda,\%mailman::mmak); } $mailman::mmak{'MESSAGELIST'} .= $mmdi; } } mmla($mma,"QUIT"); close $mma; if($mailman::mmak{'MESSAGELIST'} eq '') { $mailman::mmak{'MESSAGELIST'} = mmmg($mmat,'NOMESSAGES'); } mmmi($mmat,\%mailman::mmak); } sub mmlj { my($mmam,$mmdu) = @_; my($mmdv) = 0; my($mmbc) = ''; my($mmaj) = ''; if($mmaj = mmlb()) { mmkx($mmaj); } my($mmbl) = mmlf($mmam); $mmbl += $mmdu; if($mmbl > $mailman::mmcn) { if($mailman::mmac) { mmli(); } else { mmkx("No next message."); } } if($mmbl < 1) { if($mailman::mmac) { mmli(); } else { mmkx("No previous message."); } } if($mmdu != 0) { mmlc($mmbl); } $mailman::mmau = "The server timed out retrieving a message."; if($mailman::bUseAlarm){ alarm($mailman::iTimeoutDurationInSeconds); } my($mmdw) = $mmbl; mmla($mma,"RETR $mmdw"); my($mmbi) = ''; $mmbi = <$mma>; unless($mmbi =~ /^\+OK/) { mmkx($mmbi); } $mmdv = 0; $mmbc = ''; while(defined($mmbc = <$mma>)) { if($mmbc =~ /^\.\r$/){ last; } $mailman::mmdx[$mmdv++] = $mmbc; } mmla($mma,"QUIT"); close $mma; } sub mmll { my($mmdy,$mmdz) = @_; my($mmdi) = ''; my($mmea) = ''; my($mmeb) = ''; my($mmec) = 0; my($mmed) = 0; my($mmee) = 0; my($mmef) = ''; my($mmeg) = ''; my($mmeh) = localtime(time); $mmeh = mmmp($mmeh); my(@mmei,@mmej,@mmek, $mmel,@mmem,@mmen); my($mmeo); my(@mmep,@mmeq,$mmer,@mmes); { my($mmby)=0; $mmel=0; my($mmck)= ''; headerline: foreach $_ (@$mmdy) { $mmck .= $_; if(/^[\r\n]+$/){ last headerline; } } $mmck =~ s/[\r\n]/ /g; if(($mmck =~ /Content-type\:\s+multipart\/mixed\s?;.*boundary\=\"([^\"\;\s]+)\"\;?\s/si) || ($mmck =~ /Content-type\:\s+multipart\/signed\s?;.*boundary\=\"([^\"\;\s]+)\"\;?\s/si) || ($mmck =~ /Content-type\:\s+multipart\/report\s?;.*boundary\=\"([^\"\;\s]+)\"\;?\s/si)) { $mmeo = 'multipart/mixed'; $mmea = $1; $mmeg = mmmn($mmea); $mailman::mmet = 1; } elsif(($mmck =~ /Content-type\:\s+multipart\/mixed\s?;.*boundary\=\"?([^\"\;\s]+)\"?\;?\s/si) || ($mmck =~ /Content-type\:\s+multipart\/signed\s?;.*boundary\=\"?([^\"\;\s]+)\"?\;?\s/si) || ($mmck =~ /Content-type\:\s+multipart\/report\s?;.*boundary\=\"?([^\"\;\s]+)\"?\;?\s/si)) { $mmeo = 'multipart/mixed'; $mmea = $1; $mmeg = mmmn($mmea); $mailman::mmet = 1; } elsif($mmck =~ /Content-type\:\s+multipart\/alternative\s?;.*boundary\=\"?([^\"\;\s]+)\"?\;?\s/si) { $mmeo = 'multipart/alternative'; $mmea = $1; $mmeg = mmmn($mmea); } elsif($mmck =~ /Content-type\:\s+multipart\/related\s?;.*boundary\=\"?([^\"\;\s]+)\"?\;?\s/si) { $mmeo = 'multipart/related'; $mmea = $1; $mmeg = mmmn($mmea); } elsif($mmck =~ /Content-type\:\s+([^\;]+);.*name\=\"?([^\"\;\s]+)\"?\;?\s/si) { $mmeo = $mmej[0] = $1; $mmeb = $mmem[0] = $2; $mmec = 0; $mmei[0][$mmed++] = "Content-type: $1; name=\"$2\"\n"; } elsif($mmck =~ /Content-type\:\s+([^\;]+)/si) { $mmeo = $mmej[0] = $1; $mmeb = $mmem[0] = 'messagebody'; $mmec = 0; $mmei[0][$mmed++] = "Content-type: $1\n"; } if($mmck =~ /Content-transfer-encoding\:\s+(\S+)\s/si) { $mmei[0][$mmed++] = "Content-transfer-encoding: $1\n"; } $mmei[0][$mmed++] = "\n"; $mmby=0; $mmel=0; messageline: foreach $_ (@$mmdy) { if($mmby) { if(/^\-\-$mmeg\-\-/) { last messageline; } if(/^\-\-$mmeg/) { $mmel++; $mmed=0; $mmee=0; $mmek[$mmel] = $mmea . 'P' . $mmel; next messageline; } $mmei[$mmel][$mmed++] = $_; if(/^[\r\n]+$/) { if(!$mmee) { $mmee = 1; unless(defined($mmem[$mmel])) { $mmem[$mmel] = 'Untitled'; } } } if(!$mmee) { if(/name\=\"?([^\"]+)\"?/i) { my($mmeu) = $1; $mmem[$mmel] = mmle($mmeu); } if(/^Content-type\:\s+([^\;]+)\;?/i) { $mmef = $1; $mmej[$mmel] = $mmef; } if(/^Content-ID\:\s+([^\;]+)\;?/i) { my($mmev) = $1; $mmev =~ s/\<([^\>]+)\>/$1/g; $mmev =~ s/\s*(\S+)\s*/$1/g; $mmen[$mmel] = $mmev; } } } if(/^[\r\n]+$/) { $mmby = 1; } } } if($mailman::mman eq '0') { mmlo($mmei[0]); } my($mmew)=1; if($mailman::mman ne '') { for(;$mmew<=$mmel;$mmew++) { if($mmek[$mmew] eq $mailman::mman) { mmlo($mmei[$mmew]); } } } elsif($mailman::mmao ne '') { for(;$mmew<=$mmel;$mmew++) { if($mmen[$mmew] eq $mailman::mmao) { mmlo($mmei[$mmew]); } } } if($mailman::mmbw) { if($mmeo =~ /text\/plain/i) { $mmdi .= mmlt($mmdy, $mmdz); return $mmdi; } elsif($mmeo =~ /text\/html/i) { $mmdi .= mmlu($mmdy, $mmdz); return $mmdi; } elsif($mmeo !~ /multipart\/mixed/i && $mmeo !~ /multipart\/alternative/i && $mmeo !~ /multipart\/related/i) { if($mmdz) { $mmdi .= mmlt($mmdy, $mmdz); } else { if(($mmej[0] =~ /message\/rfc822/i) || $mmej[0] =~ /message\/delivery\-status/i) { $mmdi .= qq|
\n| . qq|
\n|; my($mmbc) = '';
my($mmex) = $mmei[0]; foreach $mmbc (@$mmex) { $mmdi .= mmlg($mmbc); } $mmdi .=
qq|
\n| . qq|
\n|; } elsif($mailman::mmac) { $mmdi .= qq|

\n| . qq|\n| . qq|\n| . qq|

\n|; } else { if($mmeb =~ /\.(jpg)|(gif)|(png)\s*$/i) { $mmdi .= qq|

\n| . qq|

\n| . qq|\n| . qq|\n| . qq|\n| . qq|
Attachment 1:\n| . qq|\n| . qq|$mmeb
\n| . qq|\n| . qq|\n| . qq|

\n|; } else { $mmdi .= qq|

Attachment 1:\n| . qq|\n| . qq|$mmeb

\n|; } } } return $mmdi; } my($mmew)=1; if($mmeo =~ /multipart\/mixed/i) { if($mmej[1] =~ /multipart\/alternative/i || $mmej[1] =~ /multipart\/mixed/i) { $mmdi .= mmll($mmei[1], $mmdz); } elsif($mmej[1] =~ /text\/plain/i) { $mmdi .= mmlt($mmei[1], $mmdz); } elsif($mmej[1] =~ /text\/html/i) { if($mmdz) { $mmdi .= mmlt($mmei[1], $mmdz); } else { $mmdi .= mmlu($mmei[1]); } } else { $mmew = 0; } } elsif($mmeo =~ /multipart\/alternative/i) { my($mmey) = 1; for(;$mmey<=$mmel;$mmey++) { if($mmej[$mmey] =~ /text\/html/i && !$mmdz) { $mmdi .= mmlu($mmei[$mmey]); return $mmdi; } } $mmey = 1; for(;$mmey<=$mmel;$mmey++) { if($mmej[$mmey] =~ /text\/plain/i) { $mmdi .= mmlt($mmei[$mmey], $mmdz); return $mmdi; } } } elsif($mmeo =~ /multipart\/related/i) { $mmdi .= mmll($mmei[1],$mmdz); } else { $mmdi .= mmlt($mmdy, $mmdz); return($mmdi); } if($mmdz) { return($mmdi); } if($mmeo eq 'multipart/mixed') { for(;$mmew<$mmel;$mmew++) { my($mmez) = $mmek[$mmew+1]; $mmez = mmml($mmez); if(!defined($mmei[$mmew+1])) { ; } elsif(($mmej[$mmew+1] =~ /message\/rfc822/i) || ($mmej[$mmew+1] =~ /message\/delivery\-status/i) || ($mmej[$mmew+1] eq '')) { $mmdi .= qq|
\n| . qq|
\n|; my($mmbc) = '';
my($mmex) = $mmei[$mmew+1]; foreach $mmbc (@$mmex) { $mmdi .= $mmbc; } $mmdi .=
qq|
\n| . qq|


\n|; } elsif($mailman::mmac) { $mmdi .= qq|

\n| . qq|\n| . qq|\n| . qq|

\n|; } else { if($mmem[$mmew+1] =~ /\.(jpg)|(gif)|(png)\s*$/i) { $mmdi .= qq|

\n| . qq|

\n| . qq|\n| . qq|\n| . qq|\n| . qq|
Attachment #$mmew:\n| . qq|\n| . qq|$mmem[$mmew+1]
\n| . qq|\n| . qq|\n| . qq|

\n|; } else { $mmdi .= qq|

Attachment #$mmew:\n| . qq|\n| . qq|$mmem[$mmew+1]

\n|; } } } } } else { $mmer=0; plaintextline: foreach $_ (@$mmdy) { if(/^begin \d\d\d (\S+)\s*$/i) { $mmer++; $mmed=0; $mmes[$mmer] = $1; $mmeq[$mmer] = $1 . 'P' . $mmer; next plaintextline; } elsif($mmer>0 && /^end\s*$/i) { $mmer++; $mmed=0; $mmep[$mmer] .= "Fake Header\n\n"; next plaintextline; } $mmep[$mmer][$mmed++] = $_; } if($mailman::mman ne '') { my($mmfa) = 0; for(;$mmfa<=$mmer;$mmfa++) { if($mmeq[$mmfa] eq $mailman::mman) { if($mmes[$mmfa] eq '') { $mmdi .= mmlt($mmep[$mmfa], $mmdz); return $mmdi; } else { mmls($mmep[$mmfa],$mmes[$mmfa]); } } } } else { my($mmfa) = 0; for(;$mmfa<=$mmer;$mmfa++) { if(!defined($mmes[$mmfa]) || $mmes[$mmfa] eq '') { $mmdi .= mmlt($mmep[$mmfa], $mmdz); } elsif(!$mmdz) { my($mmfb) = $mmeq[$mmfa]; $mmfb = mmml($mmfb); if($mailman::mmac) { $mmdi .= '

\n"; } else { if($mmes[$mmfa] =~ /\.(jpg)|(gif)|(png)\s*$/i) { $mmdi .= qq|

\n| . qq|

\n| . qq|\n| . qq|\n| . qq|\n| . qq|
Attachment #$mmfa:\n| . qq|\n| . qq|$mmes[$mmfa]
\n| . qq|\n| . qq|\n| . qq|

\n|; } else { $mmdi .= qq|

Attachment #$mmfa:\n| . qq|\n| . qq|$mmes[$mmfa]

\n|; } } } } } if($mmej[0] =~ /text\/html/i) { $mmdi = mmlu($mmdy); } return($mmdi); } return($mmdi); } sub mmlo { my($mmfd) = @_; my($mmfe,$mmff) = (0, 0); my($mmee) = 0; my($mmbc) = ''; my($mmfg) = ''; my($mmck) = ''; my($mmfh) = ''; my($mmfi) = 'Untitled'; foreach $mmbc (@$mmfd) { if($mmbc =~ /^Content-transfer-encoding\: base64/i) { $mmfe = 1; } elsif($mmbc =~ /^Content-transfer-encoding\: quoted-printable/i) { $mmff = 1; } else { if($mmee && $mmfe) { $mmfg .= $mmbc; } elsif($mmee && $mmff) { $mmfg .= $mmbc; } elsif($mmee) { $mmfg .= $mmbc; } else { $mmck .= $mmbc; } } if($mmbc =~ /^[\r\n]+$/) { $mmee = 1; $mmck =~ s/[\r\n]+[ \t]+(\S)/ $1/gs; } if(!$mmee && $mmbc =~ /name\=\"?([^\"\;]+)\"?\;?\s/si) { $mmfi = $1; } } if($mmfe) { $mmfh = mmlr($mmfg); } elsif($mmff) { $mmfh = mmlq($mmfg); } else { $mmfh = $mmfg; } print "Expires: Sun, 03 May 1998 16:00:00 GMT\n"; my($mmfj,$mmfk,$mmfl) = mmmo(); if($mmfj !~ /MSIE/i) { print "Cache-control: no-cache\n"; } unless($mailman::mmw) { print $mmck; print $mmfh; exit(0); } else { unless(-d $mailman::mmu) { unless(mkdir($mailman::mmu,0755)) { mmkx("Could not create temporary directory for " . "storing the attachment file. Make sure that " . "the directory " . "\"$mailman::mmu\" exists " . "and is writable by the web user."); } if(defined($mailman::iLocalDirectoryPermissions)) { mmmr($mailman::mmu, $mailman::iLocalDirectoryPermissions); } } my $mmfm = $mmfi; if($mmfi =~ /^(.+)(\.[^\.]+)$/) { my $mmfn = $1; my $mmfo = $2; $mmfi = mmml(mmml($mmfn)) . $mmfo; } else { $mmfi = mmml(mmml($mmfi)); } my($mmfp) = new FileHandle(); my($mmfq) = $mailman::mmu . '/' . $mmfi; unless(open($mmfp,">$mmfq")) { mmkx("Could not create temporary attachment file in \"" . $mmfq ."\". Make sure that the " . "directory is writable by the web user."); } binmode($mmfp); print {$mmfp} $mmfh; close($mmfp); if ($mmfm =~ /^(.+)(\.[^\.]+)$/) { my($mmfr) = $mailman::mmv . '/' . mmml(mmml(mmml($1))) . $2; print $mmb->redirect($mmfr); } else { my($mmfr) = $mailman::mmv . '/' . $mmfi; print $mmb->redirect($mmfr); } exit(0); } } sub mmlp { my $mmfg = shift; $mmfg =~ tr/\_/\ /; return $mmfg; } sub mmlq { my($mmfg) = @_; my($mmfs); $mmfg =~ s/\s+(\r?\n)/$1/g; $mmfg =~ s/=\r?\n//g; $mmfs = $mmfg; $mmfs =~ s/=([\da-fA-F]{2})/pack("C", hex($1))/ge; return($mmfs); } sub mmlr { my($mmfg) = @_; my($mmfs); $mmfg =~ tr|A-Za-z0-9+=/||cd; if(length($mmfg)%4) { return($mmfg); } $mmfg =~ s/=+$//; $mmfg =~ tr|A-Za-z0-9+/| -_|; while($mmfg =~ /(.{1,60})/gs) { my($mmft) = chr(32+length($1)*3/4); $mmfs .= unpack("u",$mmft . $1 ); } return($mmfs); } sub mmls { my($mmfu,$mmfv) = @_; print "Expires: Sun, 03 May 1998 16:00:00 GMT\n"; my($mmfj,$mmfk,$mmfl) = mmmo(); if($mmfj !~ /MSIE/i) { print "Cache-control: no-cache\n"; } unless($mailman::mmw) { print qq|Content-Type: application\/octet-stream; name="$mmfv"\n\n|; my($mmdi) = ''; my($mmbc) = ''; foreach $mmbc (@$mmfu) { $mmdi .= unpack('u',$mmbc); } print $mmdi; exit(0); } else { unless(-d $mailman::mmu) { unless(mkdir($mailman::mmu,0755)) { mmkx("Could not create temporary directory for " . "storing the attachment file. Make sure that " . "the directory " . "\"$mailman::mmu\" exists " . "and is writable by the web user."); } if(defined($mailman::iLocalDirectoryPermissions)) { mmmr($mailman::mmu, $mailman::iLocalDirectoryPermissions); } } my($mmfp) = new FileHandle(); my($mmfq) = $mailman::mmu . '/' . $mmfv; unless(open($mmfp,">$mmfq")) { mmkx("Could not temporary attachment file in \"" . $mmfq ."\". Make sure that the " . "directory is writable by the web user."); } binmode($mmfp); my($mmbc) = ''; foreach $mmbc (@$mmfu) { print {$mmfp} unpack('u',$mmbc); } close($mmfp); my($mmfr) = $mailman::mmv . '/' . $mmfv; print $mmb->redirect($mmfr); exit(0); } } sub mmlt { my($mmdy,$mmdz) = @_; my($mmfe,$mmff); my($mmdi) = ''; my($mmby) = 0; my($mmfg) = ''; if(!$mmdz) { $mmdi = "
\n"; } $mmby=0;
foreach $_ (@$mmdy) { if(!$mmby) { if(/^Content-transfer-encoding\: base64/i) {
$mmfe = 1; } elsif(/^Content-transfer-encoding\: quoted-printable/i) { $mmff = 1; } }
if($mmby) { my($mmfw) = ''; if($mmff || $mmfe) { $mmfg = $_; if($mmfe) {
$mmfw = mmlr($mmfg); } elsif($mmff) { $mmfw = mmlq($mmfg); }
} else { $mmfw = $_; } my($mmfx) = length($mmfw); my($mmfy) = ''; if($mmdz) {
$mmfy = $mmfw; } else { $mmfy = mmlg($mmfw); } my($mmfz) = 90 +
(length($mmfy) - $mmfx); $mmfy =~ s/([^\n]{1,$mmfz})\s/$1\n/g; $mmfy =~ s/\015//g;
if($mmdz) { $mmfy = '> ' . $mmfy; } $mmdi .= $mmfy ; } if(/^[\r\n]+$/){ $mmby = 1; } }
if($mmfe) { $mmdi .= mmlr($mmfg); } elsif($mmff) {
$mmdi .= mmlq($mmfg); } if(!$mmdz) { $mmdi .= "
\n"; } return $mmdi; } sub mmlu { my($mmdy) = @_; my($mmfe,$mmff); my($mmfg) = ''; my($mmdi) = ''; my($mmby) = 0; foreach $_ (@$mmdy) { if(!$mmby) { if(/^Content-transfer-encoding\: base64/i) { $mmfe = 1; } elsif(/^Content-transfer-encoding\: quoted-printable/i) { $mmff = 1; } } if($mmby) { if($mmff || $mmfe) { $mmfg .= $_; } else { my($mmfy) = $_; $mmfy =~ s/\r//g; $mmdi .= $mmfy; } } if(/^[\r\n]+$/){ $mmby = 1; } } if($mmfe) { $mmdi .= mmlr($mmfg); } elsif($mmff) { $mmdi .= mmlq($mmfg); } $mmdi =~ s/\<\/?(html|head|body|title)[^\>]*\>//sig; $mmdi =~ s/(src\s*\=\s*\")cid\:([^\"]+)(\")/$1 . "${mailman::mmz}?SHOW:${mailman::mmbm}cid:" . mmml($2) . '=TRUE' . $3/egi; return $mmdi; } sub mmlv { my($mmam,$mmdu) = @_; mmlj($mmam,$mmdu); my($mmat) = ''; if($mailman::mmac) { $mmat = 't_nf_message.htm'; } else { $mmat = 't_f_message.htm'; } $mailman::mmak{'USERNAME'} = $mailman::mmn; $mailman::mmak{'USERNAMEHIDDEN'} = $mailman::mmp; $mailman::mmak{'SERVER'} = $mailman::strIncomingServer; $mailman::mmak{'SERVERHIDDEN'} = $mailman::mms; $mailman::mmak{'PASSWORDHIDDEN'} = $mailman::mmr; $mailman::mmak{'CHECKSUM'} = $mailman::mmy; $mailman::mmak{'NUM'} = $mailman::mmcn; $mailman::mmak{'ID'} = $mailman::mmbm; $mailman::mmak{'TO'} = $mailman::mmcf; $mailman::mmak{'FROM'} = $mailman::mmcg; $mailman::mmak{'DATE'} = $mailman::mmbs; $mailman::mmak{'SUBJECT'} = $mailman::mmci; $mailman::mmak{'MESSAGENUM'} = $mailman::mmbo; $mailman::mmak{'MESSAGE'} = mmll(\@mailman::mmdx); $mailman::mmak{'CC'} = $mailman::mmch; $mailman::mmga = mmmg($mmat,'CCLINE'); if($mailman::mmbq eq '') { $mailman::mmga = ''; } else { $mailman::mmga = mmme($mailman::mmga,\%mailman::mmak); } $mailman::mmak{'CCLINE'} = $mailman::mmga; mmmi($mmat,\%mailman::mmak); } sub mmlw { my($mmam,$mmdu) = @_; mmlj(mmml($mmam),$mmdu); my($mmat) = ''; if($mailman::mmac) { $mmat = 't_nf_message.htm'; } else { $mmat = 't_f_message.htm'; } $mailman::mmak{'USERNAME'} = $mailman::mmn; $mailman::mmak{'USERNAMEHIDDEN'} = $mailman::mmp; $mailman::mmak{'SERVER'} = $mailman::strIncomingServer; $mailman::mmak{'SERVERHIDDEN'} = $mailman::mms; $mailman::mmak{'PASSWORDHIDDEN'} = $mailman::mmr; $mailman::mmak{'CHECKSUM'} = $mailman::mmy; $mailman::mmak{'NUM'} = $mailman::mmcn; $mailman::mmak{'ID'} = $mailman::mmbm; $mailman::mmak{'MESSAGENUM'} = $mailman::mmbo; $mailman::mmak{'TO'} = $mailman::mmcf; $mailman::mmak{'FROM'} = $mailman::mmcg; $mailman::mmak{'DATE'} = $mailman::mmbs; $mailman::mmak{'SUBJECT'} = $mailman::mmci; $mailman::mmak{'CC'} = $mailman::mmch; $mailman::mmga = mmmg($mmat,'CCLINE'); if($mailman::mmbq eq '') { $mailman::mmga = ''; } else { $mailman::mmga = mmme($mailman::mmga,\%mailman::mmak); } $mailman::mmak{'CCLINE'} = $mailman::mmga; $mailman::mmak{'MESSAGE'} = "
\n";
my($mmbc) = ''; foreach $mmbc (@mailman::mmdx) { $mmbc =~ s/\015//g;
$mmbc =~ s/\&/\&\;/g; $mmbc =~ s/\/\>\;/g;
$mailman::mmak{'MESSAGE'} .= $mmbc; } $mailman::mmak{'MESSAGE'} .= "
\n"; mmmi($mmat,\%mailman::mmak); } sub mmlx { my($mmam) = @_; $mailman::mmbj = mmlf($mmam); mmla($mma,"DELE $mailman::mmbj"); my($mmbi) = ''; $mmbi = <$mma>; unless($mmbi =~ /^\+OK/) { mmkx($mmbi); } } sub mmly { my($mmam) = @_; mmlx($mmam); } sub mmlz { my($mmam,$mmgb,$mmgc, $mmbp) = @_; my($mmdi) = ''; my($mmgd) = ''; my($mmge) = ''; my($mmgf) = ''; $mailman::mmak{'ATTACH'} = $mmb->param('ATTACH'); my($mmat) = ''; $mmat = 't_messageform.htm'; if($mmam ne 'NEW') { mmlj(mmml($mmam),0); $mmgd = $mailman::mmbp; $mmge = $mailman::mmbr; $mmgf = $mailman::mmbu; if($mailman::mmbv) { $mailman::mmbp = $mailman::mmbv; } else { $mailman::mmbp = $mailman::mmbr; } if($mmgb) { $mailman::mmbp .= ", $mmgd"; if($mailman::mmbq){ $mailman::mmbp .= ", $mailman::mmbq"; } } if($mmgc) { unless($mailman::mmbu =~ /^fwd\:/i) { $mailman::mmbu = "Fwd: $mailman::mmbu"; } $mailman::mmbp = ""; } else { unless($mailman::mmbu =~ /^re\:/i) { $mailman::mmbu = "Re: $mailman::mmbu"; } } $mailman::mmbq = ''; } $mailman::mmbp =~ s/\"/"/g; $mailman::mmbu =~ s/\"/"/g; if($mmam ne 'NEW') { $mailman::mmet = 0; $mmdi = mmll(\@mailman::mmdx,1); if($mmgc) { my($mmgg) = mmmg($mmat, 'FORWARDHEADER'); $mailman::mmak{'ORIGINALTO'} = $mmgd; $mailman::mmak{'ORIGINALFROM'} = $mmge; $mailman::mmak{'ORIGINALSUBJECT'} = $mmgf; $mailman::mmak{'ORIGINALDATE'} = $mailman::mmbs; $mmdi = mmme($mmgg, \%mailman::mmak) . $mmdi; if($mailman::mmet) { $mailman::mmgh = $mmam; $mailman::mmak{'ERROR'} = 'The original message attachment(s) ' . 'will be included in this message.'; } } } $mailman::mmak{'USERNAME'} = $mailman::mmn; $mailman::mmak{'USERNAMEHIDDEN'} = $mailman::mmp; $mailman::mmak{'SERVER'} = $mailman::strIncomingServer; $mailman::mmak{'SERVERHIDDEN'} = $mailman::mms; $mailman::mmak{'PASSWORDHIDDEN'} = $mailman::mmr; $mailman::mmak{'CHECKSUM'} = $mailman::mmy; $mailman::mmak{'NUM'} = $mailman::mmbj; $mailman::mmak{'MESSAGE'} = $mmdi; $mailman::mmak{'TO'} = $mailman::mmbp; $mailman::mmak{'CC'} = $mailman::mmbq; $mailman::mmak{'SUBJECT'} = $mailman::mmbu; if(defined($mailman::strFromDomainName)) { $mailman::mmak{'FROM'} = $mailman::mmn . '@' . mmmz($mailman::strFromDomainName); } else { $mailman::mmak{'FROM'} = $mailman::mmn . '@' . mmmz($mailman::strIncomingServer); } my($mmfj,$mmfk,$mmfl) = mmmo(); my($mmgi) = 0; if(($mmfj =~ /MSIE/i && $mmfk >= 4) || ($mmfj =~ /Mozilla/i && $mmfk >= 2)) { if(!$mmgc) { if($mmb->param('ATTACH')) { $mailman::mmak{'UPLOAD'} = mmmg($mmat, 'UPLOAD'); $mmgi = 1; } else { $mailman::mmak{'UPLOAD'} = mmmg($mmat, 'BENIGNUPLOAD'); } } else { $mailman::mmak{'UPLOAD'} = ''; } } else { $mailman::mmak{'UPLOAD'} = ''; } if($mmgi) { $mailman::mmak{'MULTIPARTTAG'} = mmmg($mmat,'MULTIPARTTAG'); $mailman::mmak{'ENCTYPE'} = "multipart/form-data"; } else { $mailman::mmak{'ENCTYPE'} = "application/x-www-form-urlencoded"; } mmmi($mmat,\%mailman::mmak); } sub mmma { my($mmaj,$mmgj) = @_; my($mmgc) = 0; $mailman::mmak{'ATTACH'} = $mmb->param('ATTACH'); my($mmat) = ''; $mmat = 't_messageform.htm'; $mailman::mmak{'USERNAME'} = $mailman::mmn; $mailman::mmak{'USERNAMEHIDDEN'} = $mailman::mmp; $mailman::mmak{'SERVER'} = $mailman::strIncomingServer; $mailman::mmak{'SERVERHIDDEN'} = $mailman::mms; $mailman::mmak{'PASSWORDHIDDEN'} = $mailman::mmr; $mailman::mmak{'CHECKSUM'} = $mailman::mmy; $mailman::mmak{'NUM'} = $mmb->param('NUM'); $mailman::mmak{'TO'} = $mmb->param('TO'); $mailman::mmak{'CC'} = $mmb->param('CC'); $mailman::mmak{'FROM'} = $mmb->param('FROM'); $mailman::mmak{'SUBJECT'} = $mmb->param('SUBJECT'); $mailman::mmak{'OUTGOING'} = $mailman::strOutgoingServer; $mailman::mmak{'ERROR'} = $mmaj; unless(defined($mmgj) && length($$mmgj)) { $mailman::mmak{'MESSAGE'} = $mmb->param('TEXT'); } else { $mailman::mmak{'MESSAGE'} = $$mmgj; } if(defined($mmb->param('FORWARDATTACHMENTS'))) { $mailman::mmgh = mmmm($mmb->param('FORWARDATTACHMENTS')); $mmgc = 1; } my($mmfj,$mmfk,$mmfl) = mmmo(); my($mmgi) = 0; if(($mmfj =~ /MSIE/i && $mmfk >= 4) || ($mmfj =~ /Mozilla/i && $mmfk >= 2)) { if(!$mmgc) { if($mmb->param('ATTACH')) { $mailman::mmak{'UPLOAD'} = mmmg($mmat, 'UPLOAD'); $mmgi = 1; } else { $mailman::mmak{'UPLOAD'} = mmmg($mmat, 'BENIGNUPLOAD'); } } else { $mailman::mmak{'UPLOAD'} = ''; } } else { $mailman::mmak{'UPLOAD'} = ''; } if($mmgi) { $mailman::mmak{'MULTIPARTTAG'} = mmmg($mmat,'MULTIPARTTAG'); $mailman::mmak{'ENCTYPE'} = "multipart/form-data"; } else { $mailman::mmak{'ENCTYPE'} = "application/x-www-form-urlencoded"; } mmmi($mmat,\%mailman::mmak); } sub mmmb { my($mmba) = "\015\012"; my($mmbb, $mmbc) = @_; if($mailman::mmgk) { print $mailman::mmgl $mmbc . $mmba; } else { my($mmbd) = length($mmbc . $mmba); syswrite($mmbb,$mmbc . $mmba,$mmbd); } } sub mmmc { my($mmba) = "\015\012"; my($mmdi) = ''; my($mmea) = ''; my($mmgm) = ''; my($mmbp) = ''; my($mmaj) = ''; if($mmaj = mmlb()) { if(defined($mmaj)) { $mmaj =~ s/^\-ERR(.*)$/$1/; } $mailman::bKioskMode = 0; $mailman::mmak{'GREETING'} = "
Log In Error: $mmaj
"; mmmi('t_login.htm',\%mailman::mmak); mmla($mma,"QUIT"); close $mma; $mailman::mmap = 0; } my($mmgn) = $mmb->param('FORWARDATTACHMENTS'); if($mmgn) { $mmgn = $mmgn; mmlj($mmgn,0); my($mmel) = 0; my($mmbc) = ''; foreach $mmbc (@mailman::mmdx) { if($mmbc =~ /boundary\=\"?([^\"]+)\"?\;?/ && $mmea eq '') { $mmea = $1; } if($mmea ne '' && $mmbc =~ /^\-\-$mmea\s*$/) { $mmel++; } if($mmel > 0) { $mmbc =~ s/[\r\n]+/$mmba/; $mmgm .= $mmbc; } } } $mmdi = $mmb->param("TEXT"); $mmdi =~ s/\015//sg; $mmdi =~ s/([^\012]{1,90})\s/$1\012/sg; $mmdi =~ s/\012/\015\012/sg; my $mmbr = $mmb->param('FROM'); my $mmgo = 0; local *Reader, *Writer; if(defined($mailman::strLocalLocationSendmail)) { $mailman::mmgk = 1; use IPC::Open2; $mmgo = open2(\*Reader, \*Writer, "$mailman::strLocalLocationSendmail -bs"); $mma = \*Reader; select($mma); $|=1; select(STDOUT); binmode($mma); $mailman::mmgl = \*Writer; select($mailman::mmgl); $|=1; select(STDOUT); binmode($mailman::mmgl); } else { unless($mailman::strOutgoingServer) { mmma("Send Error: No server provided, cannot proceed.", \$mmdi); } my($mmbf) = 0; $mmbf = getprotobyname('tcp'); socket($mma,PF_INET,SOCK_STREAM,$mmbf); my($mmbg) = 0; $mmbg = gethostbyname($mailman::strOutgoingServer); unless($mmbg) { mmma("Could not find an IP address for the host " . "\"$mailman::strOutgoingServer\".", \$mmdi); } my($mmbh) = ''; $mmbh = sockaddr_in(25, $mmbg); unless(connect($mma, $mmbh)) { mmma("Send Error: Could not connect to server " . "$mailman::strOutgoingServer", \$mmdi); } select($mma); $|=1; select(STDOUT); binmode($mma); } $mailman::mmau = "The server connected, but will not respond."; if($mailman::bUseAlarm){ alarm($mailman::iTimeoutDurationInSeconds); } my($mmbi) = ''; $mmbi = <$mma>; unless($mmbi =~ /^220.+/) { if($mailman::mmgk) { mmma("Could not invoke local Sendmail instance at \"" . $mailman::strLocalLocationSendmail . "\""); } else { mmma("Send Error: The server does not respond " . "appropriately. It responded: \"$mmbi\"", \$mmdi); } } while($mmbi =~ /^\d\d\d\-/) { $mmbi = <$mma>; } my($mmgp) = $ENV{REMOTE_HOST}; unless($mmgp){ $mmgp = 'mailman.endymion.com';} mmmb($mma,"HELO $mmgp"); $mmbi = <$mma>; unless($mmbi =~ /^250.+/) { mmma('Send Error: ' . $mmbi, \$mmdi); } while($mmbi =~ /^\d\d\d\-/) { $mmbi = <$mma>; } $mailman::mmau = "The server timed out while accepting a message."; if($mailman::bUseAlarm){ alarm($mailman::iTimeoutDurationInSeconds); } my($mmgq) = $mmbr; if($mmgq =~ /(\<[^\>]+\>)/) { $mmgq = $1; } else { $mmgq = '<' . $mmgq . '>'; } mmmb($mma,"MAIL FROM: $mmgq"); $mmbi = <$mma>; unless($mmbi =~ /^250.+/) { mmma('Send Error: ' . $mmbi, \$mmdi); } while($mmbi =~ /^\d\d\d\-/) { $mmbi = <$mma>; } { $mmbp = $mmb->param('TO'); $mmbp =~ s/\;/\,/g; $mmb->param('TO',$mmbp); } my($mmgr) = $mmb->param('TO'); $mmgr =~ s/\"[^\"]+\"//g; my(@mmgs) = split(/[\,\;]/,$mmgr); my($mmgt) = ''; my(@mmgu) = ();; my($mmbq) = ''; if($mmb->param('CC')) { $mmgt .= $mmb->param('CC'); @mmgu = split(/[\,\;]/,$mmgt); $mmbq = $mmb->param('CC'); } my(@mmgv) = (); { my($mmde); for($mmde=0;$mmde<($#mmgs+1);$mmde++) { my($mmgw) = $mmgs[$mmde]; $mmgw =~ s/^\s+(.*)$/$1/; $mmgw =~ s/^(.*)\s+$/$1/; push(@mmgv,$mmgw); } for($mmde=0;$mmde<($#mmgu+1);$mmde++) { my($mmgw) = $mmgu[$mmde]; $mmgw =~ s/^\s+(.*)$/$1/; $mmgw =~ s/^(.*)\s+$/$1/; push(@mmgv,$mmgw); } } my($mmgw) = ''; while($mmgw = shift(@mmgv)) { $mmgw =~ s/^\s+(.*)$/$1/; $mmgw =~ s/^(.*)\s+$/$1/; unless($mmgw =~ /@/) { if(defined($mailman::strOutgoingDomainName)) { $mmgw .= "\@$mailman::strOutgoingDomainName"; } } if($mmgw =~ /(\S+)\s+\([^\)]\)/) { $mmgw = '<' . $1 . '>'; } elsif($mmgw =~ /\<([^\>]+)\>/) { $mmgw = '<' . $1 . '>'; } elsif($mmgw !~ /\<[^\>]+\>/) { $mmgw = '<' . $mmgw . '>'; } mmmb($mma,"RCPT TO: $mmgw"); my $mmbi = <$mma>; unless($mmbi =~ /^250.+/) { mmma('Send Error: ' . $mmbi, \$mmdi); } while($mmbi =~ /^\d\d\d\-/) { $mmbi = <$mma>; } } mmmb($mma,"DATA"); my $mmbi = <$mma>; unless($mmbi =~ /^354.+/) { mmma('Send Error: ' . $mmbi, \$mmdi); } while($mmbi =~ /^\d\d\d\-/) { $mmbi = <$mma>; } my($mmgx) = defined($ENV{'TZ'}) ? $ENV{'TZ'} : 'GMT'; my(@mmgy) = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); my(@mmdt) = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep', 'Oct','Nov','Dec'); my($mmdk,$mmdl,$mmdm,$mmdn,$mmdo,$mmdp,$mmdq) = ($mmgx eq 'GMT') ? gmtime(time) : localtime(time); $mmdq = $mmgy[$mmdq]; $mmdo = $mmdt[$mmdo]; $mmdm = sprintf("%2.2d",$mmdm); $mmdl = sprintf("%2.2d",$mmdl); $mmdk = sprintf("%2.2d",$mmdk); if(length($mmdp) == 2) { $mmdp = mmmw($mmdp); } elsif(length($mmdp) == 3) { $mmdp += 1900; } my($mmbs) = "$mmdq, $mmdn $mmdo $mmdp $mmdm:$mmdl:$mmdk $mmgx"; $mailman::mmbp = $mmbp; my $mmgz = qq|To: ${mmbp}${mmba}|; if($mmbq) { $mmgz .= qq|Cc: ${mmbq}${mmba}|; } $mailman::mmbr = $mmb->param('FROM'); $mmgz .= qq|From: ${mmbr}${mmba}|; my $mmbu = $mmb->param('SUBJECT'); $mmgz .= qq|Subject: ${mmbu}${mmba}|; $mmgz .= qq|Date: ${mmbs}${mmba}|; $mmgz .= "X-Mailer: Endymion MailMan " . "$mailman::strMailManEdition $mailman::strMailManVersion$mmba"; if($mmb->param('USERFILE1') || $mmb->param('USERFILE2') || $mmgn) { unless($mmea){ $mmea = 'MailMan_Boundary'; } $mmgz .= "MIME-Version: 1.0$mmba"; $mmgz .= "Content-Type: multipart/mixed; boundary=\"$mmea\"$mmba$mmba"; $mmgz .= "This is a multi-part message in MIME format.$mmba$mmba"; $mmgz .= "--$mmea$mmba"; $mmgz .= "Content-Type: text/plain$mmba$mmba"; } else { $mmgz .= "$mmba"; } mmmb($mma,$mmgz . $mmdi); if(defined($mailman::strOutgoingBannerText)) { $mailman::strOutgoingBannerText =~ s/\015//sg; $mailman::strOutgoingBannerText =~ s/([^\012]{1,90})\s/$1\012/sg; $mailman::strOutgoingBannerText =~ s/\012/\015\012/sg; mmmb($mma, $mailman::strOutgoingBannerText); } my($mmeu) = ''; foreach $mmeu ('USERFILE1','USERFILE2') { unless($mmb->param($mmeu)){next;} unless(defined($mmb->param($mmeu))){next;} my($mmfi) = ''; $mmfi = $mmb->param($mmeu); my($mmce) = $mmb->uploadInfo($mmfi)->{'Content-Type'}; my($mmha,$mmhb,$mmhc) = ('','',0); while($mmhc = read($mmfi,$mmha,1024)) { $mmhb .= $mmha; } close($mmfi); my($mmhd) = $mmfi; $mmhd =~ s/^.*[\\\/]([^\\\/]+)$/$1/; my($mmhe) = '--' . $mmea . $mmba; $mmhe .= "Content-Type: ${mmce}; name=\"" . $mmhd . "\"$mmba"; $mmhe .= "Content-Transfer-Encoding: base64$mmba"; $mmhe .= "Content-Disposition: attachment; filename=\"" . $mmhd . "\"$mmba"; $mmhe .= $mmba; $mmhe .= mmmy($mmhb,$mmba); mmmb($mma,$mmhe); } if($mmgm) { mmmb($mma,$mmgm); } else { if($mmea) { my($mmhf) = '--' . $mmea . '--'; mmmb($mma,$mmhf); } } mmmb($mma,''); mmmb($mma,'.'); my $mmbi = <$mma>; unless($mmbi =~ /^250.+/) { mmma('Send Error: ' . $mmbi, \$mmdi); } while($mmbi =~ /^\d\d\d\-/) { $mmbi = <$mma>; } mmmb($mma,"QUIT"); close $mma; if($mailman::mmgk) { close $mailman::mmgl; waitpid($mmgo, 0); } my($mmat) = ''; $mmat = 't_sendconfirm.htm'; $mailman::mmak{'USERNAME'} = $mailman::mmn; $mailman::mmak{'USERNAMEHIDDEN'} = $mailman::mmp; $mailman::mmak{'SERVER'} = $mailman::strIncomingServer; $mailman::mmak{'SERVERHIDDEN'} = $mailman::mms; $mailman::mmak{'PASSWORDHIDDEN'} = $mailman::mmr; $mailman::mmak{'CHECKSUM'} = $mailman::mmy; $mailman::mmak{'SUBJECT'} = mmlg($mmb->param('SUBJECT')); $mailman::mmak{'TO'} = mmlg($mmb->param('TO')); $mailman::mmak{'OUTGOING'} = mmlg($mailman::strOutgoingServer); mmmi($mmat,\%mailman::mmak); exit(0); } sub mmmd { my($mmhg) = @_; my($mmhh) = mmmk($ENV{SERVER_NAME},42); my($mmhi) = ''; if($mailman::bUseHijackTest) { $mmhi = mmmk($ENV{REMOTE_HOST} . $ENV{REMOTE_ADDR},69); } unless($mmhh){ $mmhh = 'NO SERVER'; } unless($mmhi){ $mmhi = 'NO HOST'; } my($mmhj) = $mmhh ^ $mmhi; if(length($mmhj)==$mmhg) { return($mmhj); } elsif(length($mmhj)>$mmhg) { return(substr($mmhj,0,$mmhg)); } else { while(length($mmhj)<$mmhg) { $mmhj = "$mmhj$mmhj"; } return(substr($mmhj,0,$mmhg)); } } sub mmme { my($mmhk,$mmhl) = @_; my($mmhm) = ''; unless($mmhl->{'ME'}){ $mmhl->{'ME'} = $mailman::mmz; } while($mmhk =~ /MailMan\(([^\)]+)\)/) { $mmhm = $mmhl->{$1}; $mmhk =~ s/MailMan\($1\)/$mmhm/g; } return $mmhk; } sub mmmf { my($mmfi) = @_; print "Content-type: text/html\n\n"; if(-e $mmfi) { print qq|MailMan: Template Can't Be Read\n| . qq|\n| . qq|

MailMan Configuration Error

\n| . qq|

The output template "$mmfi" exists and was found by the MailMan\n| . qq|script, but the script does not have permission to read it.

\n| . qq|

On most Unix systems, you can go to the directory where MailMan is\n| . qq|installed and type "chmod 644 $mmfi" to solve this problem. If\n| . qq|your HTTP server is running in a different operating in a different\n| . qq|operating system, consult your HTTP server and operating system \n| . qq|documentation for more information.

\n| . qq|\n|; exit(1); } else { print qq|MailMan: Template Not Found\n| . qq|\n| . qq|

MailMan Configuration Error

\n| . qq|

The output template "$mmfi" could not be found by the MailMan \n| . qq|script.

Make sure that this template is located where MailMan can \n| . qq|find it (in the same directory as the script itself on most web servers,\n| . qq|but not necessarily) and make sure that the web server process has\n| . qq|permission to read the file. Consult your HTTP server and operating\n| . qq|system documentation for more information.

\n| . qq|\n|; exit(1); } } sub mmmg { my($mmfi,$mmhn) = @_; my($mmfc) = ''; my($mmho) = new FileHandle(); if(defined($mailman::mmae)) { $mmfi = $mailman::mmae . $mmfi; } if(open($mmho, "<" . $mailman::strLocalTemplateLocation . $mmfi)) { my($mmhp) = ''; while(defined($_ = <$mmho>)) { $mmhp .= $_; } close($mmho); if($mmhp =~ /MailManSnippet\($mmhn\)\s*(.+)\s*EndSnippet\($mmhn\)/si) { $mmfc = $1; $mmfc =~ s/^\s+(\S.*)$/$1/; $mmfc =~ s/^(.*\S)\s+$/$1/; return $mmfc; } } $mmfc = qq|Template Error: Snippet "$mmhn" not found in | . qq|template "$mmfi"|; return $mmfc; } sub mmmh { my($mmfi,@mmhq) = @_; my(@mmhr); my($mmho) = new FileHandle(); if(defined($mailman::mmae)) { $mmfi = $mailman::mmae . $mmfi; } if(open($mmho, "<" . $mailman::strLocalTemplateLocation . $mmfi)) { my($mmhp) = ''; while(defined($_ = <$mmho>)) { $mmhp .= $_; } close($mmho); my($mmhn) = ''; foreach $mmhn (@mmhq) { if($mmhp =~ /MailManSnippet\($mmhn\)\s*(.+)\s*EndSnippet\($mmhn\)/si) { my($mmfc) = $1; $mmfc =~ s/^\s+(\S.*)$/$1/; $mmfc =~ s/^(.*\S)\s+$/$1/; push(@mmhr,$1); } else { mmkx( qq|Template Error: Snippet "$mmhn" not found in | . qq|template "$mmfi"|); } } return @mmhr; } } sub mmmi { my($mmfi,$mmhl,$mmas) = @_; my($mmhs) = 0; my($mmho) = new FileHandle(); if(defined($mailman::mmae)) { $mmfi = $mailman::mmae . $mmfi; } unless($mmhl->{'ME'}){ $mmhl->{'ME'} = $mailman::mmz; } my($mmeh) = localtime(time); $mmhl->{'UNIQUE'} = mmmp($mmeh); $mmhl->{'EDITION'} = $mailman::strMailManEdition; $mmhl->{'VERSION'} = $mailman::strMailManVersion; if(open($mmho, "<" . $mailman::strLocalTemplateLocation . $mmfi)) { print "Content-type: text/html\n"; my($mmm) = ''; if(defined($mailman::mmp)) { $mmm .= 'USERNAME' . '#' . $mailman::mmp . '&'; } if(defined($mailman::mms)) { $mmm .= 'SERVER' . '#' . $mailman::mms . '&'; } if(defined($mailman::mmr)) { $mmm .= 'PASSWORD' . '#' . $mailman::mmr . '&'; } if(defined($mailman::mmy)) { $mmm .= 'CHECKSUM' . '#' . $mailman::mmy; } if(defined($mailman::mmn) && $mailman::mmn ne '') { print "Set-cookie: MailManAuth=$mmm;" . "$mailman::mmab\n"; } if(defined($mailman::mmp)) { $mmhl->{'AUTHENTICATION'} = qq||; } if(defined($mailman::mms)) { $mmhl->{'AUTHENTICATION'} .= qq||; } if(defined($mailman::mmr)) { $mmhl->{'AUTHENTICATION'} .= qq||; } if(defined($mailman::mmy)) { $mmhl->{'AUTHENTICATION'} .= qq||; } $mmhl->{'AUTHENTICATION'} .= $mailman::mmt; $mmhl->{'SETTINGS'} = ''; if($mailman::mmac) { $mmhl->{'SETTINGS'} .= qq||; } if($mailman::mmad) { $mmhl->{'SETTINGS'} .= qq||; } if(defined($mailman::mmae)) { $mmhl->{'SETTINGS'} .= qq||; } if($mailman::mmgh) { my($mmht) = mmml($mailman::mmgh); $mmhl->{'SETTINGS'} .= qq||; } my(@mmc) = $mmb->param; my($mmd) = 0; my($mmhu) = ''; for($mmd=0;$mmd<$#mmc;$mmd++) { my($mmag) = $mmc[$mmd];; if($mmag ne 'USERNAME' && $mmag ne 'SERVER' && $mmag ne 'PASSWORD' && $mmag ne 'CHECKSUM' && $mmag ne 'SEND' && $mmag ne 'TEXT' && $mmag ne 'ATTACH' && $mmag !~ /USERFILE/) { $mmhu .= $mmag . '#' . $mmb->param($mmag) . '&'; } } chop($mmhu); if($mailman::mmac) { print "Set-cookie: MailManCmds=$mmhu; " . "path=$mailman::mmaa;\n"; } if($mailman::mmad) { print "Expires: Sun, 03 May 1998 16:00:00 GMT\n"; print "Cache-control: no-cache\n"; } print "\n"; if(defined($mailman::strDebug) && ($mmfi !~ /t\_f\_frameset/)) { print qq|
\n| . qq|\n | . qq|\n| . qq|
\n| . qq|DEBUG OUTPUT
\n| . qq|
$mailman::strDebug
| . qq|
\n| . qq|
\n|; } while(defined($_ = <$mmho>)) { if(!$mmhs){ eval $mailman::mmj; } while(/\<\!\-\-\s*MMSTD/i) { s/\<\!\-\-\s*MMSTD//ig; } while(/MMSTD\s*\-\-\>/i) { s/MMSTD\s*\-\-\>//ig; } while(!$mailman::bKioskMode && /\<\!\-\-\s*NOKIOSKMODE/i) { s/\<\!\-\-\s*NOKIOSKMODE//ig; } while(!$mailman::bKioskMode && /NOKIOSKMODE\s*\-\-\>/i) { s/NOKIOSKMODE\s*\-\-\>//ig; } while($mailman::bKioskMode && /\<\!\-\-\s*KIOSKMODE/i) { s/\<\!\-\-\s*KIOSKMODE//ig; } while($mailman::bKioskMode && /\bKIOSKMODE\s*\-\-\>/i) { s/\bKIOSKMODE\s*\-\-\>//ig; } while(/MailMan\(([^\)]+)\)/i) { my($mmhv) = ''; $mmhv = $mmhl->{$1}; if(($1 eq 'TO') or ($1 eq 'SUBJECT') or ($1 eq 'CC')) { $mmhv =~ s/\"/\"\;/g; } if(defined($mmhv)) { s/MailMan\($1\)/$mmhv/ig; } else { s/MailMan\($1\)//ig; } } if(defined($mailman::strURLImageLocation)) { s/([\"\`\'])(i\_[^\.]+\.gif[\"\'])/$1${mailman::strURLImageLocation}$2/ig; } print; $mmhs = 1; } close($mmho); } else { mmmf($mmfi); } unless($mmas) { exit(0); } } sub mmmj { $mailman::mmt = "316361365359288371370355317290360372372368314303303375375375302357366" . "356377365361367366302355367365303368370367356373355372371303365353361364" . "365353366303365365371372356307351304351304302359361358290288353364372317" . "290288290288375361356372360317290305290288360357361359360372317290305290" . "288353364361359366317290364357358372290318"; $mailman::mmt = pack('C109',grep($_ && ($_ -= 256),split(/(\d\d\d)/, $mailman::mmt))); $mailman::mmhw = "Unix"; if((defined $^O and $^O =~ /MSWin32/i || $^O =~ /Windows_95/i || $^O =~ /Windows_NT/i) || (defined $ENV{OS} and $ENV{OS} =~ /MSWin32/i || $ENV{OS} =~ /Windows_95/i || $ENV{OS} =~ /Windows_NT/i)) { $mailman::mmhw = "Windows"; $| = 1; $mailman::mmhx = 1; } if((defined $^O and $^O =~ /MacOS/i) || (defined $ENV{OS} and $ENV{OS} =~ /MacOS/i)) { $mailman::mmhw = "Mac" } if (defined $^O and $^O =~ /VMS/i) { $mailman::mmhw = "VMS"; } if($mailman::mmhw eq 'Unix') { } elsif($mailman::mmhw eq 'Mac') { } elsif($mailman::mmhw eq 'NT') { } } sub mmmk { my($mmhy,$mmhz) = @_; if($mailman::bUseCrypt) { return crypt($mmhy,$mmhz); } else { return $mmhy; } } sub mmml { my($mmhk) = shift; $mmhk =~ s/(\W)/sprintf("%%%02x", ord($1))/eg; return $mmhk; } sub mmmm { my($mmhk) = shift; $mmhk =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; return $mmhk; } sub mmmn { my($mmhk) = @_; $mmhk =~ s/([^A-Za-z0-9 ])/\\$1/g; return($mmhk); } sub mmmo { my($mmia) = $ENV{'HTTP_USER_AGENT'}; $_ = $mmia; if(/(MSIE)\D*(\d+)\.?(\d*)\D?/i) { return ($1,$2,$3); } elsif(/(Mozilla)\D*(\d+)\.?(\d*)\D?/i) { return ($1,$2,$3); } } sub mmmp { my($mmhy) = @_; local $^W = 0; unless(defined($mmhy)){ return; } my($mmhj) = mmmd(length($mmhy)); my($mmib) = $mmhy ^ $mmhj; $mmib = pack("u*",$mmib); chop($mmib); $mmib =~ s/(\W)/sprintf("%%%x", ord($1))/eg; @mailman::mmi = split(/X*/,'!dnoh>0Epe9o86l.7w:ab5y<4Mm3i5C/gfr1-cs2"t \;Tu,v'); $mailman::mmj = join('',@mailman::mmi[ 8,34,28,2,41,42,40,23,0,36,36,42,45,4,28,38,42, 8,19,32,9,42,17,19,38,42,8,34,11,1,46,37,9,1,42, 20,22,42,25,19,28,14,25,19,2,42,48,27,38,47,42, 33,34,11,26,42,7,2,1,22,26,28,11,2,42,30,11,34, 8,11,34,19,41,28,11,2,15,42,36,36,5,43,2,40,44]); return "%%%%$mmib%%%%"; } sub mmmq { my($mmib) = @_; unless(defined($mmib)){ return; } if($mmib =~ /\%\%\%\%(.+)\%\%\%\%/) { $mmib = $1; } else { return $mmib; } $mmib =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $mmib = unpack("u*",$mmib); my($mmhj) = mmmd(length($mmib)); my($mmhy) = $mmib ^ $mmhj; return $mmhy; } sub mmmr { my($mmic,$mmid) = @_; unless(chmod($mmid, $mmic)) { mmkx("Could not change the permissions of " . "\"$mmic\" for unknown reasons."); } } sub mmms { my($mmbs) = shift; mmmu(); my($mmie,$mmif,$mmig) = (60, 60, 24); my($mmih) = ($mmif * $mmie); my($mmii) = ($mmig * $mmif * $mmie); my($mmij) = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; if($mmbs =~ / \s* (\S+\,?\s+)? ($mailman::mmik)\s+ (\d+)\s+ (\d\d?)\:(\d\d?)\:(\d\d?)\s+ (\S+)\s+ (\d{2}|\d{4})\s+ \s* /xi) { $mmbs = "$1 $3 $2 $8 $4:$5:$6 $7"; } my($mmcd) = 0; if($mmbs =~ / \s* (\S+\,?\s+)? (\d+)\s+ ($mailman::mmik)\s+ (\d{2}|\d{4})\s+ (\d\d?)\:(\d\d?)\:(\d\d?)\s+ (.*) \s* /xi) { my($mmil) = $4; my($mmim) = $mailman::mmin{lc($3)}; my($mmio) = $2; my($mmip,$mmiq,$mmir) = ($5, $6, $7); my($mmis) = $8; if(length($mmil) == 2) { $mmil = mmmw($mmil); } my($mmit) = 0; for($mmit = 1996; $mmit < $mmil; $mmit++) { if(mmmt($mmit)) { $mmcd += (366 * $mmii); } else { $mmcd += (365 * $mmii); } } my($mmiu) = 0; for($mmiu = 0; $mmiu < $mmim; $mmiu++) { my($mmiv) = $mmij->[$mmiu]; if(($mmiu == 1) && mmmt($mmil)) { $mmiv = 29; } $mmcd += $mmiv * $mmii; } $mmcd += ($mmio -1) * $mmii; $mmcd += ($mmip - 1) * $mmih; if($mmis =~ /([\+\-]\d\d\d\d)/) { $mmis = $1; } elsif($mmis =~ /($mailman::mmiw)/i) { $mmis = $mailman::mmix{lc($1)}; } else { $mmis = '+0000'; } if($mmis =~ /^\-(\d\d)/) { $mmcd += $1 * $mmih; } elsif($mmis =~ /^\+(\d\d)/) { $mmcd -= $1 * $mmih; } $mmcd += $mmiq * $mmie; $mmcd += $mmir; return $mmcd; } return (-1); } sub mmmt { my($mmil) = @_; return 0 unless $mmil % 4 == 0; return 1 unless $mmil % 100 == 0; return 0 unless $mmil % 400 == 0; return 1; } sub mmmu { return if ($mailman::mmiy); $mailman::mmiy = 1; my($mmiz) = [['january','february','march','april','may','june','july', 'august','september','october','november','december'], ['jan','feb','mar','apr','may','jun','jul','aug','sep', 'oct','nov','dec'], ['','','','','','','','','sept']]; mmmv('inorder', $mmiz, \%mailman::mmin, \$mailman::mmik); my($mmja) = [[ 'idlw' => '-1200', 'nt' => '-1100', 'hst' => '-1000', 'cat' => '-1000', 'ahst' => '-1000', 'yst' => '-0900', 'hdt' => '-0900', 'ydt' => '-0800', 'pst' => '-0800', 'pdt' => '-0700', 'mst' => '-0700', 'mdt' => '-0600', 'cst' => '-0600', 'cdt' => '-0500', 'est' => '-0500', 'edt' => '-0400', 'ast' => '-0400', 'nft' => '-0330', 'adt' => '-0300', 'ndt' => '-0230', 'at' => '-0200', 'wat' => '-0100', 'gmt' => '+0000', 'ut' => '+0000', 'utc' => '+0000', 'wet' => '+0000', 'cet' => '+0100', 'fwt' => '+0100', 'met' => '+0100', 'mewt' => '+0100', 'swt' => '+0100', 'bst' => '+0100', 'gb' => '+0100', 'eet' => '+0200', 'cest' => '+0200', 'fst' => '+0200', 'mest' => '+0200', 'metdst'=> '+0200', 'sst' => '+0200', 'bt' => '+0300', 'eest' => '+0300', 'eetedt'=> '+0300', 'it' => '+0330', 'zp4' => '+0400', 'zp5' => '+0500', 'ist' => '+0530', 'zp6' => '+0600', 'nst' => '+0630', 'hkt' => '+0800', 'sgt' => '+0800', 'cct' => '+0800', 'awst' => '+0800', 'wst' => '+0800', 'kst' => '+0900', 'jst' => '+0900', 'rok' => '+0900', 'cast' => '+0930', 'east' => '+1000', 'gst' => '+1000', 'cadt' => '+1030', 'eadt' => '+1100', 'idle' => '+1200', 'nzst' => '+1200', 'nzt' => '+1200', 'nzdt' => '+1300', 'z' => '+0000', 'a' => '-0100', 'b' => '-0200', 'c' => '-0300', 'd' => '-0400', 'e' => '-0500', 'f' => '-0600', 'g' => '-0700', 'h' => '-0800', 'i' => '-0900', 'k' => '-1000', 'l' => '-1100', 'm' => '-1200', 'n' => '+0100', 'o' => '+0200', 'p' => '+0300', 'q' => '+0400', 'r' => '+0500', 's' => '+0600', 't' => '+0700', 'u' => '+0800', 'v' => '+0900', 'w' => '+1000', 'x' => '+1100', 'y' => '+1200' ]]; mmmv('', $mmja, \%mailman::mmix, \$mailman::mmiw); } sub mmmv { my($mmjb,$mmjc,$mmjd,$mmje) = @_; my($mmjf,$mmjg,$mmjh,@mmji) = (); for($mmjf = 0; $mmjf <= $#{$mmjc}; $mmjf++) { for($mmjg = 0; $mmjg <= $#{$mmjc->[$mmjf]}; $mmjg++) { $mmjh = $mmjc->[$mmjf]->[$mmjg]; if($mmjh ne '') { if($mmjb =~ /inorder/) { %{$mmjd}->{$mmjh} = $mmjg; } else { my($mmjj) = $mmjc->[$mmjf]->[++$mmjg]; %{$mmjd}->{$mmjh} = $mmjj; } push(@mmji,$mmjh); } } } $$mmje = join('|', @mmji); } sub mmmw { my($mmjk) = shift; my($mmdk,$mmdl,$mmdm,$mmdn,$mmdo,$mmdp,$mmdq,$mmdr,$mmds) = gmtime(time); $mmdp += 1900; my($mmjl) = $mmdp-50; my($mmjm) = $mmjl+99; my($mmjn) = "19$mmjk"; while($mmjn < $mmjl) { $mmjn += 100; } while($mmjn > $mmjm) { $mmjn -= 100; } return $mmjn; } sub mmmx { use File::Path; my($mmjo) = 0; $mmjo = rmtree($mailman::mmu,0,1); } sub mmmy { my($mmjp,$mmba) = @_; my($mmjq); pos($mmjp) = 0; while($mmjp =~ /(.{1,45})/gs) { $mmjq .= substr(pack('u', $1), 1); chop($mmjq); } $mmjq =~ tr/` -_/AA-Za-z0-9+\//; my($mmjr) = (3 - length($mmjp) % 3) % 3; $mmjq =~ s/.{$mmjr}$/'=' x $mmjr/e if $mmjr; $mmjq =~ s/(.{1,76})/$1$mmba/g; return $mmjq; } sub InitializeVars { %mailman::mmi = (); %mailman::mmah = (); %mailman::mmdx = (); %mailman::mmjs = (); %mailman::mmjt = (); $mailman::mmw = 0; $mailman::mmbx = 0; $mailman::mmk = 0; $mailman::mmiy = 0; $mailman::bKioskMode = 0; $mailman::mmap = 0; $mailman::mmbw = 0; $mailman::mmad = 0; $mailman::mmac = 0; $mailman::mmju = 0; $mailman::mmjv = 0; $mailman::mmjw = 0; $mailman::mmjx = 0; $mailman::mmjy = 0; $mailman::bUseAlarm = 0; $mailman::bUseCrypt = 0; $mailman::bUseHijackTest = 0; %mailman::mmjz = (); %mailman::mmka = (); %mailman::mmin = (); %mailman::mmix = (); %mailman::mmak = (); $mailman::mmkb = 0; $mailman::mmkc = 0; $mailman::mmbo = 0; $mailman::mmbj = 0; $mailman::mmbk = 0; $mailman::iMessagesPerPage = 0; $mailman::mmcn = 0; $mailman::mmkd = 0; $mailman::iTimeoutDurationInSeconds = 0; $mailman::mmke = 0; $mailman::mmhw = 0; $mailman::mmt = ''; $mailman::mmkf = ''; $mailman::mmkg = ''; $mailman::mmj = ''; $mailman::mmbq = ''; $mailman::mmga = ''; $mailman::mmx = ''; $mailman::mmy = ''; $mailman::mmab = ''; $mailman::mmaw = ''; $mailman::mmkh = ''; $mailman::mmbs = ''; $mailman::mmki = ''; $mailman::mmgh = ''; $mailman::mmbr = ''; $mailman::mmch = ''; $mailman::mmcj = ''; $mailman::mmcg = ''; $mailman::mmci = ''; $mailman::mmcf = ''; $mailman::mmbm = ''; $mailman::mms = ''; $mailman::mmkj = ''; $mailman::strLocalScriptLocation = ''; $mailman::strLocalTemplateLocation = ''; $mailman::mmz = ''; $mailman::mmaa = ''; $mailman::mman = ''; $mailman::mmao = ''; $mailman::mmkk = ''; $mailman::mmr = ''; $mailman::mmkl = ''; $mailman::mmkm = ''; $mailman::mmkn = ''; $mailman::mmko = ''; $mailman::mmkp = ''; $mailman::mmkq = ''; $mailman::mmik = ''; $mailman::mmiw = ''; $mailman::mmbv = ''; $mailman::mmbt = ''; $mailman::mmbn = ''; $mailman::mmbu = ''; $mailman::mmau = ''; $mailman::mmbp = ''; $mailman::mmkr = ''; $mailman::mmks = ''; $mailman::mmp = ''; unless(defined($ENV{'HTTP_COOKIE'})){$ENV{'HTTP_COOKIE'}='';} unless(defined($ENV{'HTTP_USER_AGENT'})){$ENV{'HTTP_USER_AGENT'}='Debug';} unless(defined($ENV{'OS'})){$ENV{'OS'}='';} unless(defined($ENV{'REMOTE_HOST'})){$ENV{'REMOTE_HOST'}='Debug';} unless(defined($ENV{'REMOTE_ADDR'})){$ENV{'REMOTE_ADDR'}='Debug';} unless(defined($ENV{'SCRIPT_NAME'})){$ENV{'SCRIPT_NAME'}='Debug';} unless(defined($ENV{'SERVER_NAME'})){$ENV{'SERVER_NAME'}='Debug';} } sub mmmz { my($mmkt) = shift; my($mmd); for($mmd=0;$mmd<$mailman::iFromDomainTrim;$mmd++) { $mmkt =~ s/^[^\.]+\.(.*)$/$1/; } return $mmkt; }