Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 4th, 2011  |  syntax: None  |  size: 0.87 KB  |  views: 64  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.   # get list of all incoming mail
  2.     if {[catch {
  3.         set messages [glob "$queue_dir/new/*"]
  4.     } errmsg]} {
  5.         if {[string match "no files matched glob pattern*"  $errmsg ]} {
  6.             ns_log Notice "load_mails: queue dir = $queue_dir/new/*, no messages"
  7.             ns_log Debug "load_mails: queue dir = $queue_dir/new/*, no messages"
  8.         } else {
  9.             ns_log Notice "load_mails: queue dir = $queue_dir/new/ error $errmsg"
  10.             ns_log Error "load_mails: queue dir = $queue_dir/new/ error $errmsg"
  11.         }
  12.         return [list]
  13.     }
  14.  
  15.     ns_log Notice "MSGS: $messages"
  16.  
  17.     # loop over every incoming mail
  18.     foreach msg $messages {
  19.         ns_log Debug "load_mails: opening $msg"
  20.         array set email {}
  21.  
  22.         # This will parse the E-mail and extract the files to the file system
  23.         parse_email -file $msg -array email
  24. ...
  25.  
clone this paste RAW Paste Data