procmail/0040775000567100000120000000000007500622422012351 5ustar jcameronwheelprocmail/down.cgi0100775000567100000120000000032207474677460014027 0ustar jcameronwheel#!/usr/local/bin/perl # down.cgi # Move a recipe down in the file require './procmail-lib.pl'; &ReadParse(); @conf = &get_procmailrc(); &swap_recipes($conf[$in{'idx'}], $conf[$in{'idx'} + 1]); &redirect(""); procmail/edit_env.cgi0100775000567100000120000000245607474677066014671 0ustar jcameronwheel#!/usr/local/bin/perl # edit_env.cgi # Edit an environment variable setting require './procmail-lib.pl'; &ReadParse(); if ($in{'new'}) { &header($text{'env_title1'}, ""); } else { &header($text{'env_title2'}, ""); @conf = &get_procmailrc(); $env = $conf[$in{'idx'}]; } print "
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'env_header'}
\n"; print "\n"; printf "\n", &html_escape($env->{'name'}); print "\n"; printf "\n", &html_escape($env->{'value'}); print "
$text{'env_name'}
$text{'env_value'}
\n"; # Show save buttons print "\n"; if ($in{'new'}) { print "\n"; } else { print "\n"; print "\n"; } print "
\n"; print "
\n"; &footer("", $text{'index_return'}); procmail/edit_recipe.cgi0100775000567100000120000000711007532676200015320 0ustar jcameronwheel#!/usr/local/bin/perl # edit_receipe.cgi # Display a form for editing or creating a procmail receipe require './procmail-lib.pl'; &ReadParse(); if ($in{'new'}) { &header($text{'edit_title1'}, ""); $block++ if ($in{'block'}); } else { &header($text{'edit_title2'}, ""); @conf = &get_procmailrc(); $rec = $conf[$in{'idx'}]; $block++ if (defined($rec->{'block'})); } print "
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; # Show action section print "\n"; print "\n"; print "
$text{'edit_header1'}
\n"; if ($block) { # Start of a conditional block print "\n"; print "\n"; } else { # Simple action ($t, $a) = &parse_action($rec); print "\n"; print "\n", &html_escape($a); } $i = 0; foreach $f (@known_flags) { print "\n" if ($i%2 == 0); print "\n"; print "\n" if ($i%2 == 1); $i++; } print "\n", &html_escape($rec->{'lockfile'}); print "
$text{'edit_block'}
$text{'edit_action'}\n"; printf "
\n"; printf " %s\n", $f, &indexof($f, @{$rec->{'flags'}}) >= 0 ? "checked" : "", $text{"edit_flag_$f"}; print "
$text{'edit_lockfile'} \n"; printf " %s\n", $rec->{'lockfile'} ? "" : "checked", $text{'default'}; printf "\n", $rec->{'lockfile'} ? "checked" : ""; printf "

\n"; # Show conditions section print "\n"; print "\n"; print "
$text{'edit_header2'}
\n"; print "$text{'edit_conddesc'}

\n"; $i = 0; foreach $c (@{$rec->{'conds'}}, [ '-' ], [ '-' ] ) { print "\n"; printf "
\n", &html_escape($c->[1]); $i++; } print "

\n"; # Show save buttons print "\n"; if ($in{'new'}) { print "\n"; } else { print "\n"; print "\n"; } print "
\n"; print "
\n"; &footer("", $text{'index_return'}); procmail/images/0040775000567100000120000000000007474566752013645 5ustar jcameronwheelprocmail/images/up.gif0100644000567100000120000000014707474565777014763 0ustar jcameronwheelGIF89arrr!Made with GIMP! ,& |'Io|b%eRG;Ssf;procmail/images/down.gif0100644000567100000120000000015407474565777015304 0ustar jcameronwheelGIF89arrr!Made with GIMP! ,+@"IUieJbA I m.dN;procmail/images/gap.gif0100644000567100000120000000011107474565777015075 0ustar jcameronwheelGIF89a!Made with GIMP! ,ڋ>;procmail/images/.xvpics/0040755000567100000120000000000007474566752015235 5ustar jcameronwheelprocmail/images/.xvpics/icon.gif0100664000567100000120000000450207474566752016654 0ustar jcameronwheelP7 332 #IMGINFO:48x48 RGB (1526 bytes) #END_OF_COMMENTS 48 48 255 I$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$II۶I$ڷڶIڶ۶ImIInmmihH\ڶ۶۶niMmi(EI۶۶ۑImmmNMe<5\(E)mHE)$IIHڒڷrQX%HIIۍHDۖhQ5IiqnmmiNImnmmImnmm۶ֻIۑۑmnmnhNmڒmnnMmm IH۶ڷڶmJmmiNmmۍMۑImm$ֺJmmmmmnmImnmnmmImImI%HImmmnmmH%HJmH%I۶ڶ%HI%ֺ$IHIj(IIIIHJIH%۶ڷ$IHIڶ$IHIHIIEm%HIIڒmֻ ۺIIڒmmے۶ImIڷmInHnM۶ImIڷmH۶ۑۑmڒmmiI)H%mmmnmHmm$IEmm۶׺ڶmmIIiH)EII۶DֶI$II۶IH%I۶%H%Iֺ%HEIֺ%HIEۺEֺI$II۶IH%I۶%H!(i۶E(IE۶%H)I׺%qַI$II۶IH%I۶%HI$H׺%HEIֺE(IEۺmmIrֶ۶I$II۶%H%I۶ڶn MH׻HE)Iڷ(I()DII۶I$II۶%H%I۶ڶ%$Iֺ%HIIڶImIֶL(EI(۶I$II۶%H%I۶ڶ%H%$IEMh%$nHj(IDh$EH)I۶I$II۶%H%I۶ڶ%HII(IIiIIH@Ihm۶$IIEI$II۶IH%I۶%HI%۶ڶmmnmmmDEhHiI)۶I$II۶IH%I۶%HI%۶ڶ%HIIIIIIH%i$d(@rIֻI$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶DHE$$I׺ַI$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶ID$@ֻ۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$I$@He(%IH۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$IDDiDm%HI۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$ImE$dhIIIH۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$IIm DHe$)DI$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$dIH׺I$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$DEhHI$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$DDEhHI$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$iDDIhh۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶HDiDi۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶e$hD۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶$DD۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶H DHprocmail/images/icon.gif0100664000567100000120000000276607474566752015274 0ustar jcameronwheelGIF89a00fffti_?vka0//~~~~~[<ccc:( ___ NNN333+  TRQ<]D*&&& ```tttnnn璏xww_G/"""}xsssrxqj{{{mmm\H3( m[I* E4#wnesss2(wk### tjaYOEiiiA7-/"zzz jO5FFFjZKyiZIII9+vvvmcX444[SLWQKMMMTPMUQNx XTP8,o_NDDDcZRVVV?,qqqAAA888e]T555S3'''|ws% Y2 -8   }t*.ti_*]=B/Y9dP=U5oT9C$!,00 HÇ#J0ŋ3jQ)2Ȏ Xi⁗/q 8$PA D0L*̬)&ɑ%qZ!4lʡ/"Y1F!D\ADF NHq@Ҳf/XqE .^pͼc00FK\ w#Ρ$EB MM/HAH 8@HH۵sBpjڤ,<>IH0w&, &#"կ#  ^"oǐS6 F}!TJV؇rWDłX\Ԡ0Q hj[E\@l]XxҊ+z!}a""q!F!ّc# 9@QyVjDFf8ّg!3C;Q%GkŜs8trnnGa&ṟtD*餏 Pħwhy ԇW?r Z!\B!F"(#` )L[E"$ ,AJ@%\u &ZlB '+_'`eUm(ȫ( "T) *J +",JK-`KdzBIȸ+r\./z.֬)/2' "D't20C'mP02;0,K,;procmail/index.cgi0100775000567100000120000000540207511725627014162 0ustar jcameronwheel#!/usr/local/bin/perl # index.cgi # Display the current list of procmail recipes require './procmail-lib.pl'; if ($minfo{'usermin'}) { &header($text{'index_title'}, "", undef, 0, 1); } else { &header($text{'index_title'}, "", undef, 1, 1); } print "
\n"; @conf = &get_procmailrc(); print &text('index_desc', "$procmailrc"),"

\n"; if (@conf) { print "\n"; print " ", " ", "\n"; foreach $c (@conf) { print "\n"; if ($c->{'name'}) { # Environment variable assignment print "\n"; print "\n"; } print "
$text{'index_action'}$text{'index_conds'}$text{'index_move'}
"; print "", &text('index_env', "".&html_escape($c->{'name'})."", "".&html_escape($c->{'value'}).""), "\n"; } else { # Procmail recipe print ""; print ""; local ($t, $a) = &parse_action($c); print &text('index_act'.$t, "".&html_escape($a).""); print ""; local @c = @{$c->{'conds'}}; if (!@c) { print $text{'index_noconds'}; } else { foreach $n (@c) { local $he ="".&html_escape($n->[1]). ""; if ($n->[0] eq '') { print &text('index_re', $he); } elsif ($n->[0] eq '!') { print &text('index_nre', $he); } elsif ($n->[0] eq '$') { print &text('index_shell', $he); } elsif ($n->[0] eq '?') { print &text('index_exit', $he); } elsif ($n->[0] eq '<') { print &text('index_lt', $n->[1]); } elsif ($n->[0] eq '>') { print &text('index_gt', $n->[1]); } print "
\n"; } } } print "
\n"; if ($c eq $conf[@conf-1] || $c->{'file'} ne $conf[$c->{'index'}+1]->{'file'}) { print ""; } else { print "", ""; } if ($c eq $conf[0] || $c->{'file'} ne $conf[$c->{'index'}-1]->{'file'}) { print ""; } else { print "", ""; } print "
\n"; } else { print "$text{'index_none'}

\n"; } print "$text{'index_add'}  \n"; print "$text{'index_badd'}  \n"; print "$text{'index_eadd'}

\n"; print "


\n"; &footer("/", $text{'index'}); procmail/lang/0040775000567100000120000000000007531600343013274 5ustar jcameronwheelprocmail/lang/ca0100644000567100000120000000645107514662140013607 0ustar jcameronwheelindex_title=Filtre de Correu Procmail index_desc=Les accions de procmail de $1 a sota s'aplicaran a tot el correu lliurat als usuaris del sistema. No obstant, noms s'utilitzaran si procmail est installat i la caracterstica local_procmail de Sendmail est activada. index_action=Acci a prendre index_conds=Condicions index_move=Desplaa index_act5=Executa un bloc condicional index_act4=Dona'l com a entrada del programa $1 index_act3=Reenvia'l a $1 index_act2=Grava'l al directori de correu $1 index_act1=Grava'l a la carpeta MH $1 index_act0=Afegeix-lo al fitxer $1 index_noconds=Executa sempre l'acci index_re=Coincideix amb l'expressi regular $1 index_nre=No coincideix amb l'expressi regular $1 index_shell=Avalua l'ordre $1 index_exit=Estat de sortida de l'ordre $1 index_lt=La mida s < $1 index_gt=La mida s > $1 index_add=Afegeix una nova acci de filtratge index_eadd=Afegeix un nou valor de variable index_badd=Afegeix un nou bloc condicional index_none=Encara no s'ha configurat cap acci de procmail. index_return=a la llista d'accions index_env=Estableix la variable $1 a $2 edit_title2=Edici d'Acci edit_title1=Creaci d'Acci edit_header1=Detalls de l'acci de lliurament edit_header2=Condicions de l'acci edit_action=Mode de lliurament edit_block=Codi procmail a executar edit_amode_0=Afegeix a fitxer edit_amode_1=Grava en una carpeta MH edit_amode_2=Grava en un directori de correu edit_amode_3=Reenvia a l'adrea edit_amode_4=Dna com a entrada a un programa edit_flag_H=Aplica les condicions a les capaleres edit_flag_B=Aplica les condicions al cos edit_flag_D=Recerca sensible a caixa edit_flag_h=Envia les capaleres a la destinaci edit_flag_b=Envia el cos a la destinaci edit_flag_c=Continua processant encara que es compleixin les condicions edit_flag_w=Espera que el programa de l'acci acabi, i llavors comprova'n el resultat edit_flag_W=Espera que el programa de l'acci acabi, per ignora'n el resultat edit_flag_i=Ignora els errors d'escriptura en el lliurament edit_flag_r=Escriu el correu en mode pelat edit_lockfile=Fitxer de blocatge del lliurament edit_cmode_re=Coincideix amb l'expressi regular edit_cmode_nre=No coincideix amb l'expressi regular edit_cmode_shell=Avalua la sortida de l'ordre edit_cmode_exit=Comprova l'estat de sortida de l'ordre edit_cmode_lt=El correu s ms petit de edit_cmode_gt=El correu s ms gran de edit_conddesc=Per tal de portar a terme l'acci de sobre, cal que es compleixin totes les condicions de sota. Si no hi ha cap condici, l'acci s'executar sempre. save_err=No he pogut desar l'acci save_eaction_0=Hi falta el fitxer on afegir save_eaction_1=Hi falta la carpeta MH per gravar-hi save_eaction_2=Hi falta el directori de correu per gravar-hi save_eaction_3=Hi falta l'adrea de reenviament save_eaction_4=Hi falta el programa que l'ha d'acceptar com a entrada save_elockfile=Hi falta el nom del fitxer de blocatge save_esize=Hi falta la mida del correu de la condici $1 save_ere=Hi falta l'expressi regular de la condici $1 save_eshell=Hi falta l'ordre de la condici $1 env_title1=Creaci de Variable env_title2=Edici de Variable env_header=Variable d'entorn procmail env_name=Nom de la variable env_value=Valor env_err=No he pogut desar la variable env_ename=Hi falta el nom de la variable o b s invlid config_eline=Lnia $1 desconeguda a $2: $3 procmail/lang/en0100664000567100000120000000545607506063443013636 0ustar jcameronwheelindex_title=Procmail Mail Filter index_desc=The procmail actions below from $1 will apply to all email delivered to users on your system. However, they will only be used if procmail is installed and the Sendmail local_procmail feature is enabled. index_action=Action to take index_conds=Conditions index_move=Move index_act5=Execute conditional block index_act4=Feed to progam $1 index_act3=Forward to $1 index_act2=Write to maildir $1 index_act1=Write to MH folder $1 index_act0=Append to file $1 index_noconds=Always execute action index_re=Match regexp $1 index_nre=Don't match regexp $1 index_shell=Evaluate command $1 index_exit=Exit status of command $1 index_lt=Size is < $1 index_gt=Size is > $1 index_add=Add a new filter action index_eadd=Add a new variable setting index_badd=Add a new conditional block index_none=No Procmail actions have been configured yet. index_return=actions list index_env=Set variable $1 to $2 edit_title2=Edit Action edit_title1=Create Action edit_header1=Delivery action details edit_header2=Action conditions edit_action=Delivery mode edit_block=Procmail code to execute edit_amode_0=Append to file edit_amode_1=Write to MH folder edit_amode_2=Write to maildir edit_amode_3=Forward to address edit_amode_4=Feed to program edit_flag_H=Apply conditions to headers edit_flag_B=Apply conditions to body edit_flag_D=Case-sensitive matching edit_flag_h=Feed headers to destination edit_flag_b=Feed body to destination edit_flag_c=Continue processing even if conditions match edit_flag_w=Wait for action program to finish, and check result edit_flag_W=Wait for action program to finish, but ignore result edit_flag_i=Ignore write errors on delivery edit_flag_r=Write out mail in raw mode edit_lockfile=Delivery lock file edit_cmode_re=Matches regular expression edit_cmode_nre=Doesn't match regular expression edit_cmode_shell=Evaluate output of command edit_cmode_exit=Check exit status of command edit_cmode_lt=Mail is smaller than edit_cmode_gt=Mail is bigger than edit_conddesc=For the above action to be carried out, all the conditions below must match. If there are no conditions, the action will always be executed. save_err=Failed to save action save_eaction_0=Missing file to append to save_eaction_1=Missing MH folder to write to save_eaction_2=Missing maildir to write to save_eaction_3=Missing address to forward to save_eaction_4=Missing program to feed to save_elockfile=Missing lock file name save_esize=Missing or invalid mail size for condition $1 save_ere=Missing regular expression for condition $1 save_eshell=Missing command for condition $1 env_title1=Create Variable env_title2=Edit Variable env_header=Procmail environment variable env_name=Variable name env_value=Value env_err=Failed to save variable env_ename=Missing or invalid variable name config_eline=Unknown line $1 in $2 : $3 procmail/lang/es0100664000567100000120000000616507516023310013627 0ustar jcameronwheelindex_title=Filtro de Correo Procmail index_desc=Las acciones de procmail debajo, desde $1, se aplicarn a todo el correo entregado a usuarios de tu sistema. Sin embargo, slo se usarn si procmail est instaldo y la caracterstica de local_procmail de Sendmail est activada. index_action=Accin a tomar index_conds=Condiciones index_move=Mover index_act5=Ejecutar bloque condicional index_act4=Alimentar a programa $1 index_act3=Remitir a $1 index_act2=Escribir en maildir $1 index_act1=Escribir en carpeta MH $1 index_act0=Aadir a archivo $1 index_noconds=Siempre ejecutar accin index_re=Coincidir con regexp $1 index_nre=No coincidir con regexp $1 index_shell=Evaluar comando $1 index_exit=Estado de salida del comando $1 index_lt=La medida es < $1 index_gt=La medida es > $1 index_add=Aadir una nueva accin de filtro index_eadd=Aadir un nuevo valor de variable index_badd=Aadir un nuevo bloque condicional index_none=No se han configurado acciones de Procmail an. index_return=lista de acciones index_env=Poner variable $1 a $2 edit_title2=Editar Accin edit_title1=Crear Accin edit_header1=Detalles de accin de entrega edit_header2=Condiciones de accin edit_action=Modo de entrega edit_block=Cdigo de procmail a ejecutar edit_amode_0=Aadir a archivo edit_amode_1=Escribir en carpeta MH edit_amode_2=Escribir en maildir edit_amode_3=Remitir a direccin edit_amode_4=Alimentar programa edit_flag_H=Aplicar condiciones a cabeceras edit_flag_B=Aplicar condiciones a cuerpo edit_flag_D=Coincidencia sensible a maysculas edit_flag_h=Alimentar cabeceras a destino edit_flag_b=Alimentar cuerpo a destino edit_flag_c=Continuar proceso incluso si las condiciones coinciden edit_flag_w=Esperar por programa de accin hasta que acabe y revisar resultado edit_flag_W=Esperar por programa de accin hasta que acabe pero ignorar el resultado edit_flag_i=Ignorar errores de escritura en entrega edit_flag_r=Escribir correo en modo sin bfer edit_lockfile=Archivo de bloqueo de entrega edit_cmode_re=Que coincida con expresin regular edit_cmode_nre=Que no coincida con expresin regular edit_cmode_shell=Evaluar salida de comando edit_cmode_exit=Revisar estado de salida de comando edit_cmode_lt=El correo es menor de edit_cmode_gt=El correo es mayor que edit_conddesc=Para llevar a cabo la acccin de arriba, todas las condiciones de abajo deben de coincidir. Si no hay condiciones, la accin siempre se ejecutar. save_err=No pude salvar accin save_eaction_0=Falta el archivo donde aadir save_eaction_1=Falta la capeta MH donde escribir save_eaction_2=Falta el maildir donde escribir save_eaction_3=Falta la direccin a donde remitir save_eaction_4=Falta el programa a alimentar save_elockfile=Falta el nombre del archivo de bloqueo save_esize=La medida de correo para condicin $1 falta o es invlida save_ere=Falta expresin regular para condicin $1 save_eshell=Falta comando para condicin $1 env_title1=Crear Variable env_title2=Editar Variable env_header=Variable de entorno de Procmail env_name=Nombre de Variable env_value=Valor env_err=No pude salvar variable env_ename=Nombre de variable falta o es invlido config_eline=Lnea desconocida $1 en $2: $3 procmail/module.info0100664000567100000120000000011607532676353014527 0ustar jcameronwheelname=Procmail desc=Procmail Mail Filter category=mail usermin=1 version=0.947 procmail/procmail-lib.pl0100664000567100000120000001260307511725364015272 0ustar jcameronwheel# procmail-lib.pl # Functions for parsing the .procmailrc file do '../web-lib.pl'; &init_config(); %minfo = &get_module_info($module_name); if ($minfo{'usermin'}) { &switch_to_remote_user(); $procmailrc = "$remote_user_info[7]/.procmailrc"; } else { $procmailrc = $config{'procmailrc'}; } # get_procmailrc() # Parses the .procmailrc file into recipes sub get_procmailrc { return &parse_procmail_file($procmailrc); } # parse_procmail_file(file) sub parse_procmail_file { local (@rv, $rec, $_); local $lnum = 0; local $fh = $_[0]; open($fh, $_[0]); while(<$fh>) { local $slnum = $lnum; s/\s+$//; while(s/\\$//) { local $cont = <$fh>; $cont =~ s/\s+$//; $cont =~ s/^\s+//; $_ .= $cont; $lnum++; } if (!/^\*/) { s/#.*$//; s/\s+$//; } if (/^\s*([^\s=]+)\s*=\s*"(.*)"$/ || /^\s*([^\s=]+)\s*=\s*'(.*)'$/ || /^\s*([^\s=]+)\s*=\s*(.*)$/) { if ($1 eq "INCLUDERC") { # Including another file local @inc = &parse_procmail_file( &make_absolute("$2", $procmailrc)); map { $_->{'index'} += scalar(@rv) } @inc; push(@rv, @inc); } elsif ($1 eq "SWITCHRC") { # Change to another file local @inc = &parse_procmail_file( &make_absolute("$2", $procmailrc)); map { $_->{'index'} += scalar(@rv) } @inc; push(@rv, @inc); last; } else { # Environment variable assignment local $env = { 'index' => scalar(@rv), 'file' => $_[0], 'line' => $slnum, 'eline' => $lnum, 'name' => $1, 'value' => $2 }; push(@rv, $env); } } elsif (/^:0\s*(\S*)\s*:\s*(.*)$/ || /^:0\s*(\S*)/) { # Start of a new recipe $rec = { 'index' => scalar(@rv), 'file' => $_[0], 'line' => $slnum, 'eline' => $lnum, 'lockfile' => $2, 'flags' => [ split(//, $1) ] }; push(@rv, $rec); } elsif (/^\*\s*(\!|\$|\?|<|>|)(.*)$/) { # A condition for a recipe push(@{$rec->{'conds'}}, [ $1, $2 ]); $rec->{'eline'} = $lnum; } elsif (/^\{\s*$/) { # A conditional action .. read till the end local $nest = 1; $rec->{'block'} = ""; while(<$fh>) { $lnum++; if (/^\{\s*$/) { $nest++; } elsif (/^\}\s*$/) { last if (!--$nest); } $rec->{'block'} .= $_; } $rec->{'eline'} = $lnum; } elsif (/^\{(.*)\}\s*$/) { # A single-line conditional action .. $rec->{'block'} = $1; $rec->{'eline'} = $lnum; } elsif (/^(\!|\|)\s*(.*)$/) { # The action for a recipe $rec->{'type'} = $1; $rec->{'action'} = $2; $rec->{'eline'} = $lnum; } elsif (/\S/) { if ($rec->{'action'}) { # Unknown line &error(&text('config_eline', $slnum+1, $procmailrc, "$_")); } else { # File delivery action $rec->{'type'} = undef; $rec->{'action'} = $_; $rec->{'eline'} = $lnum; } } $lnum++; } close($fh); return @rv; } # create_recipe(&recipe) sub create_recipe { local $lref = &read_file_lines($procmailrc); push(@$lref, &recipe_lines($_[0])); &flush_file_lines(); } # delete_recipe(&recipe) sub delete_recipe { local $lref = &read_file_lines($_[0]->{'file'}); splice(@$lref, $_[0]->{'line'}, $_[0]->{'eline'} - $_[0]->{'line'} + 1); &flush_file_lines(); } # modify_recipe(&recipe) sub modify_recipe { local $lref = &read_file_lines($_[0]->{'file'}); splice(@$lref, $_[0]->{'line'}, $_[0]->{'eline'} - $_[0]->{'line'} + 1, &recipe_lines($_[0])); &flush_file_lines(); } # swap_recipes(&recipe1, &recipe2) sub swap_recipes { local $lref0 = &read_file_lines($_[0]->{'file'}); local $lref1 = &read_file_lines($_[1]->{'file'}); local @lines0 = @$lref0[$_[0]->{'line'} .. $_[0]->{'eline'}]; local @lines1 = @$lref1[$_[1]->{'line'} .. $_[1]->{'eline'}]; if ($_[0]->{'line'} < $_[1]->{'line'}) { splice(@$lref1, $_[1]->{'line'}, $_[1]->{'eline'} - $_[1]->{'line'} + 1, @lines0); splice(@$lref0, $_[0]->{'line'}, $_[0]->{'eline'} - $_[0]->{'line'} + 1, @lines1); } else { splice(@$lref0, $_[0]->{'line'}, $_[0]->{'eline'} - $_[0]->{'line'} + 1, @lines1); splice(@$lref1, $_[1]->{'line'}, $_[1]->{'eline'} - $_[1]->{'line'} + 1, @lines0); } &flush_file_lines(); } sub recipe_lines { if ($_[0]->{'name'}) { # Environment variable local $v = $_[0]->{'value'} =~ /^\`/ ? $_[0]->{'value'} : $_[0]->{'value'} =~ /^\S+$/ ? $_[0]->{'value'} : $_[0]->{'value'} =~ /"/ ? "'$_[0]->{'value'}'" : "\"$_[0]->{'value'}\""; return ( $_[0]->{'name'}."=".$v ); } else { # Recipe with conditions and action local (@rv, $c); push(@rv, ":0".join("", @{$_[0]->{'flags'}})); if ($_[0]->{'lockfile'}) { $rv[0] .= ":".$_[0]->{'lockfile'}; } foreach $c (@{$_[0]->{'conds'}}) { push(@rv, "* ".$c->[0].$c->[1]); } if (defined($_[0]->{'block'})) { push(@rv, "{", split(/\n/, $_[0]->{'block'}), "}"); } elsif ($_[0]->{'type'}) { push(@rv, $_[0]->{'type'}." ".$_[0]->{'action'}); } else { push(@rv, $_[0]->{'action'}); } return @rv; } } # parse_action(&recipe) sub parse_action { if ($_[0]->{'type'} eq '|') { return (4, $_[0]->{'action'}); } elsif ($_[0]->{'type'} eq '!') { return (3, $_[0]->{'action'}); } elsif (defined($_[0]->{'block'})) { return (5); } elsif ($_[0]->{'action'} =~ /^(.*)\/$/) { return (2, $1); } elsif ($_[0]->{'action'} =~ /^(.*)\/\.$/) { return (1, $1); } else { return (0, $_[0]->{'action'}); } } # make_absolute(file, basefile) sub make_absolute { return $_[0] if ($_[0] =~ /^\//); $_[1] =~ /^(.*)\/[^\/]+$/; return "$1/$_[0]"; } @known_flags = ('H', 'B', 'D', 'h', 'b', 'c', 'w', 'W', 'i', 'r'); 1; procmail/save_env.cgi0100775000567100000120000000110607474676534014670 0ustar jcameronwheel#!/usr/local/bin/perl # save_env.cgi # Create, update or delete an environment setting require './procmail-lib.pl'; &ReadParse(); @conf = &get_procmailrc(); $env = $conf[$in{'idx'}] if (!$in{'new'}); if ($in{'delete'}) { # Just delete the variable &delete_recipe($env); } else { # Validate inputs &error_setup($text{'env_err'}); $in{'name'} =~ /^[^\s=]+$/ || &error($text{'env_ename'}); $env->{'name'} = $in{'name'}; $env->{'value'} = $in{'value'}; # Save the receipe if ($in{'new'}) { &create_recipe($env); } else { &modify_recipe($env); } } &redirect(""); procmail/save_recipe.cgi0100775000567100000120000000360607506476723015350 0ustar jcameronwheel#!/usr/local/bin/perl # save_recipe.cgi # Create, update or delete a procmail recipe require './procmail-lib.pl'; &ReadParse(); @conf = &get_procmailrc(); $rec = $conf[$in{'idx'}] if (!$in{'new'}); if ($in{'delete'}) { # Just delete the recipe &delete_recipe($rec); } else { # Validate inputs &error_setup($text{'save_err'}); if ($in{'block'}) { # Conditional code block $in{'bdata'} =~ s/\r//g; $rec->{'block'} = $in{'bdata'}; } else { # Normal action $in{'action'} =~ /\S/ || &error($text{'save_eaction_'.$in{'amode'}}); delete($rec->{'type'}); if ($in{'amode'} == 0) { $rec->{'action'} = $in{'action'}; } elsif ($in{'amode'} == 1) { $rec->{'action'} = $in{'action'}."/."; } elsif ($in{'amode'} == 2) { $rec->{'action'} = $in{'action'}."/"; } elsif ($in{'amode'} == 3) { $rec->{'type'} = "!"; $rec->{'action'} = $in{'action'}; } else { $rec->{'type'} = "|"; $rec->{'action'} = $in{'action'}; } } map { $flag{$_}++ } split(/\0/, $in{'flag'}); @flags = @{$rec->{'flags'}}; foreach $f (@known_flags) { if ($flag{$f}) { push(@flags, $f); } else { @flags = grep { $_ ne $f } @flags; } } $rec->{'flags'} = [ &unique(@flags) ]; if ($in{'lockfile_def'}) { delete($rec->{'lockfile'}); } else { $in{'lockfile'} =~ /\S/ || &error($text{'save_elockfile'}); $rec->{'lockfile'} = $in{'lockfile'}; } for($i=0; defined($m = $in{"cmode_$i"}); $i++) { next if ($m eq '-'); $c = $in{"cond_$i"}; if ($m eq '<' || $m eq '>') { $c =~ /^\d+$/ || &error(&text('save_esize', $i+1)); } elsif ($m eq '$' || $m eq '?') { $c =~ /\S/ || &error(&text('save_eshell', $i+1)); } else { $c =~ /\S/ || &error(&text('save_ere', $i+1)); } push(@conds, [ $m, $c ]); } $rec->{'conds'} = \@conds; # Save the receipe if ($in{'new'}) { &create_recipe($rec); } else { &modify_recipe($rec); } } &redirect(""); procmail/up.cgi0100775000567100000120000000031607474677440013505 0ustar jcameronwheel#!/usr/local/bin/perl # up.cgi # Move a recipe up in the file require './procmail-lib.pl'; &ReadParse(); @conf = &get_procmailrc(); &swap_recipes($conf[$in{'idx'}], $conf[$in{'idx'} - 1]); &redirect(""); procmail/ulang/0040775000567100000120000000000007500622441013460 5ustar jcameronwheelprocmail/ulang/en0100664000567100000120000000042607500622441014004 0ustar jcameronwheelindex_desc=This module allows you to configure filtering for email send to your address on this server. However, it will only work if your system administrator has installed Procmail globally, or if you have setup delivery to the Procmail program in the Mail Forwarding module.