############################################################
### general
############################################################
PAGE general
  COMMAND com_mailDir "~/Mail"
  ENTRY loginName "blackie@homenet.dk"
  COMMAND getLogin "blackie@homenet.dk"
  CHECKBOX extlog "1"
  CHECKBOX logabstract "0"
############################################################
### backup
############################################################
PAGE backup
  COMMAND com_all_file "~/Mail/backup"
  FILLOUT delivered_file {
    TEXT "backup-delivered-"
    FILLOUTELM delivered_date {
      RADIO delivered_digit "4"
    }
    TEXT "-"
    FILLOUTELM delivered_date {
      RADIO delivered_dateInfo "Month"
      RADIO delivered_monthFormat "August"
    }
    TEXT ""
  }
  FILLOUT undelivered_file {
    TEXT "backup-undelivered-"
    FILLOUTELM undelivered_date {
      RADIO undelivered_digit "4"
    }
    TEXT "-"
    FILLOUTELM undelivered_date {
      RADIO undelivered_dateInfo "Month"
      RADIO undelivered_monthFormat "August"
    }
    TEXT ""
  }
############################################################
### recipes
############################################################
PAGE recipes
  EXTENTRY recipes
  {
    ENTRY recipeName "[-] Procmail mailing list"
    EXTENTRY conditions
    {
      COMBOBOX cond_head "Sendmail from"
      ENTRY cond_pattern "procmail-request@informatik.RWTH-Aachen.DE"
      FILLOUT cond_com_file {
        TEXT ""
      }
    }
    CHECKBOX predesigned_filter_act "1"
    EXTENTRY filter_delheads
    {
      COMBOBOX filter_delhead "resent-from:"
    }
    {
      COMBOBOX filter_delhead "resent-date:"
    }
    {
      COMBOBOX filter_delhead "to:"
    }
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    FILLOUT reply_message_file {
      TEXT ""
    }
    CHECKBOX save_act "1"
    EXTENTRY save_files
    {
      FILLOUT save_file {
        TEXT "Lists/Procmail"
      }
    }
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    LABEL filter_label "Changes by this filter will only have effect within this recipe"
    CHECKBOX enable "0"
    TEXTBOX description "This recipe save all mail from the procmail mailing list to the file called Procmail in the direcoty Lists, which is  located in the directory specified on the page caled \"General Setup\".

Note how I remove the headers resent-from, resent-date and to,
since all these headers all say that the mail was recent at once, and 
is from the procmail mailling list (ie. no new information). 
I remove these headers as they make it harder to  browse quickly
though the mail (looking at the subjects) when these headers are
there."
  }
  {
    ENTRY recipeName "[-] Dotfile mailing list"
    EXTENTRY conditions
    {
      COMBOBOX cond_head "TO"
      ENTRY cond_pattern "dotfile@imada.sdu.dk"
      FILLOUT cond_com_file {
        TEXT ""
      }
    }
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    FILLOUT reply_message_file {
      TEXT ""
    }
    CHECKBOX save_act "1"
    EXTENTRY save_files
    {
      FILLOUT save_file {
        TEXT "Lists/dotfile-"
        FILLOUTELM save_date {
        }
        TEXT ""
      }
      CHECKBOX save_gzip "1"
    }
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    CHECKBOX cont "1"
    CHECKBOX enable "0"
    TEXTBOX description "This recipe save all mail from the Dotfile Generator mailing list to the file called Lists/dotfile-<year>, where year is expaned to the current year. The file is kept as a gziped file, since it is only for backup purpose. Note that the check button \"Continue after this match\" is enabled, so that I get the mail to my incomming folder too."
  }
  {
    ENTRY recipeName "[-] Modify subject header"
    EXTENTRY conditions
    {
      COMBOBOX cond_head "Sendmail from"
      ENTRY cond_pattern "sslug-list.slug.dk"
      FILLOUT cond_com_file {
        TEXT ""
      }
    }
    CHECKBOX predesigned_filter_act "1"
    EXTENTRY filter_appHeader
    {
      COMBOBOX filter_headname "subject:"
      FILLOUT filter_file {
        FILLOUTELM filter_header {
          COMBOBOX filter_field "subject:"
          LABEL filter_dateLabel "Year"
          TEXTBOX filter_pipe "sed 's/^ *\\(RE:\\)* *\\[SSLUG\\] *//'"
        }
        TEXT ""
      }
    }
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    FILLOUT reply_message_file {
      TEXT ""
    }
    CHECKBOX save_act "1"
    EXTENTRY save_files
    {
      FILLOUT save_file {
        TEXT "Lists/sslug"
      }
    }
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    LABEL filter_label "Changes by this filter will only have effect within this recipe"
    CHECKBOX enable "0"
    TEXTBOX description "This example shows how a header field my be modified.
In this example, all mail from the mailling list \"sslug\" is prefixed with
the text [SSLUG] by the mailling list software. This recipe removes
this prefix (if it exists), and save the mail to the folder Lists/sslug."
  }
  {
    ENTRY recipeName "[-] Avoid bomb (save to file)"
    EXTENTRY conditions
    {
      CHECKBOX cond_neg "1"
      ENTRY cond_size "1000000"
      FILLOUT cond_com_file {
        TEXT ""
      }
    }
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    FILLOUT reply_message_file {
      TEXT ""
    }
    CHECKBOX save_act "1"
    EXTENTRY save_files
    {
      FILLOUT save_file {
        TEXT "BOMBS"
      }
    }
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    CHECKBOX cont "1"
    CHECKBOX enable "0"
    TEXTBOX description "This is the first part of a bomb filter. It saves the letter to a file if the size of the letter is greater than 1Mb. The next recipe will send a letter to myself, telling that I recieved a bomb."
  }
  {
    ENTRY recipeName "[-] Avoid bomb (mail myself)"
    EXTENTRY conditions
    {
      CHECKBOX cond_neg "1"
      ENTRY cond_size "1000000"
      FILLOUT cond_com_file {
        TEXT ""
      }
    }
    EXTENTRY filter_appHeader
    {
      COMBOBOX filter_headname "subject:"
      FILLOUT filter_file {
        TEXT "BOMB: "
        FILLOUTELM filter_header {
          COMBOBOX filter_field "subject:"
        }
        TEXT ""
      }
      RADIO filter_exists "Rename old header by prepending Old-"
    }
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    CHECKBOX handmade_filter_act "1"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT "echo You received a bomb from \\\""
      FILLOUTELM filter_comBody_header {
        COMBOBOX filter_comBody_field "from:"
      }
      TEXT "\\\". It has been saved to the file called BOMBS

"
    }
    FILLOUT reply_message_file {
      TEXT ""
    }
    CHECKBOX forw_act "1"
    EXTENTRY forwards
    {
      ENTRY forward "myemail@myhome.com"
    }
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    LABEL filter_label "Changes by this filter will only have effect within this recipe"
    CHECKBOX enable "0"
    TEXTBOX description "This is the second part of the bomb filter. This part remove the body of the letter, and send it to me (ie a new letter) with the subject: \"BOMB: \" prepended to the old subject.
Please note how I cat stdin to /dev/null in the filter. If I do not do that, procmail will think that the letter was not removed, and continue with it, as if this recipe didn't deliver. "
  }
  {
    ENTRY recipeName "[-] backup all incomming letters"
    EXTENTRY conditions
    {
      ENTRY cond_size "100000"
      FILLOUT cond_com_file {
        TEXT ""
      }
    }
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    FILLOUT reply_message_file {
      TEXT ""
    }
    CHECKBOX save_act "1"
    EXTENTRY save_files
    {
      FILLOUT save_file {
        TEXT "backupDir/"
        FILLOUTELM save_date {
        }
        TEXT "-"
        FILLOUTELM save_header {
          COMBOBOX save_field "from:"
          CHECKBOX save_address "1"
        }
        TEXT ""
      }
    }
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    CHECKBOX cont "1"
    CHECKBOX enable "0"
    TEXTBOX description "This recipe backup all mail, with size smaller than 100Kb, to a file called backupDir/<Year>-<from>, wher Year is replaced with the current year, and from is replace with the email addres of the sender."
  }
  {
    ENTRY recipeName "[-] Reply to sender, that I am on holyday"
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    CHECKBOX reply_act "1"
    FILLOUT reply_message_file {
      TEXT "Dear "
      FILLOUTELM reply_message_header {
        COMBOBOX reply_message_field "from:"
        CHECKBOX reply_message_address "1"
        RADIO reply_message_whichPart "real name"
        ENTRY reply_message_alt "sender"
        LABEL reply_message_dateLabel "Year"
      }
      TEXT "

I'm on hollyday right now, and will not read your letter before 
Juli the 17 2015

To see where I went, send me a letter, with a header field called X-WhereAreYou
"
    }
    CHECKBOX reply_sig "1"
    CHECKBOX reply_advertisment "1"
    RADIO reply_period "if it is longer than"
    INT reply_howOld "30"
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    CHECKBOX cont "1"
    CHECKBOX enable "0"
    TEXTBOX description "This recipe will send a letter back to the sender, telling him, that I am on holyday. The letter will be send if it is more that one moth ago since last letter. "
  }
  {
    ENTRY recipeName "[-] Send the advertisment for my holyday"
    EXTENTRY conditions
    {
      COMBOBOX cond_head "X-WhereAreYou"
      FILLOUT cond_com_file {
        TEXT ""
      }
    }
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    CHECKBOX reply_act "1"
    FILLOUT reply_message_file {
      TEXT "Hi. Here's the information about my hollyday:
"
    }
    CHECKBOX reply_sig "1"
    ENTRY reply_sigfile "~/holidayInfo"
    CHECKBOX reply_advertisment "1"
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    CHECKBOX enable "0"
    TEXTBOX description "This is an alternativ example of what the reply mechanism can be used for. "
  }
  {
    ENTRY recipeName "[-] Strip signatures"
    CHECKBOX predesigned_filter_act "1"
    CHECKBOX filter_removeSig "1"
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    FILLOUT reply_message_file {
      TEXT ""
    }
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    LABEL filter_label "Changes by this filter will have effect in the rest of the recipes"
    CHECKBOX enable "0"
    TEXTBOX description "This recipe will strip the signature of letters. This will be done by
comparing the letter with a known signature, from the user. This
signature has to be save in a file with the name of the users email
adresse locate in the directory ~/Mail/signatures"
  }
  {
    ENTRY recipeName "[-] Keep a compressed log file of received mail "
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    FILLOUT reply_message_file {
      TEXT ""
    }
    CHECKBOX pipe_act "1"
    CHECKBOX pipe_lock "1"
    FILLOUT pipe_pipe_file {
      TEXT "echo "
      FILLOUTELM pipe_pipe_count {
        RADIO pipe_pipe_size "Lines in body (incl blanks)"
      }
      TEXT " lines, "
      FILLOUTELM pipe_pipe_date {
        RADIO pipe_pipe_dateInfo "Day"
      }
      TEXT "/"
      FILLOUTELM pipe_pipe_date {
        RADIO pipe_pipe_dateInfo "Month"
      }
      TEXT "/"
      FILLOUTELM pipe_pipe_date {
      }
      TEXT ", "
      FILLOUTELM pipe_pipe_time {
        RADIO pipe_pipe_timeInfo "Hour"
        RADIO pipe_pipe_hourFormat "24"
      }
      TEXT ":"
      FILLOUTELM pipe_pipe_time {
        RADIO pipe_pipe_timeInfo "Minute"
      }
      TEXT ", "
      FILLOUTELM pipe_pipe_header {
        COMBOBOX pipe_pipe_field "from:"
      }
      TEXT ", "
      FILLOUTELM pipe_pipe_header {
        COMBOBOX pipe_pipe_field "subject:"
      }
      TEXT " | gzip >> log.gz
"
    }
    CHECKBOX cont "1"
    CHECKBOX enable "0"
    TEXTBOX description "This recipe will keep a log file of all incomming messages. The file
will be kept as as a compressed gzip file. You may wish to read 
http://www.imada.sdu.dk/Technical/Howto/howto_lesspipe.html
for information on how to setup 'less' to view gziped files."
  }
  {
    ENTRY recipeName "[-] Important mail"
    EXTENTRY conditions
    {
      COMBOBOX cond_head "Body of letter"
      ENTRY cond_pattern "important|urgent|beer"
      FILLOUT cond_com_file {
        TEXT ""
      }
    }
    CHECKBOX predesigned_filter_act "1"
    EXTENTRY filter_appHeader
    {
      COMBOBOX filter_headname "X-Status:"
      FILLOUT filter_file {
        TEXT "F"
      }
    }
    COMMAND com_filter_sigDir "~/Mail/signatures"
    COMMAND com_filter_logfile "~/Mail/signatures/log"
    FILLOUT filter_comHead_file {
      TEXT ""
    }
    FILLOUT filter_comBody_file {
      TEXT ""
    }
    FILLOUT reply_message_file {
      TEXT ""
    }
    FILLOUT pipe_pipe_file {
      TEXT ""
    }
    LABEL filter_label "Changes by this filter will have effect in the rest of the recipes"
    CHECKBOX enable "0"
    TEXTBOX description "If you use pine, this recipe may be of interest. What it does is to
append a header, which make pine think that the letter has been
marked as important, which will be shown with an asteriks."
  }
