#--------------------------------------------------------------- # # フォルダの基本設定 # @folder_configs = {} @folder_configs[:LIST_NAME] = @name # 表示名 @folder_configs[:LIST_NAME] = '受信箱' if(@name == 'Inbox') @folder_configs[:LIST_NAME] = '草稿' if(@name == 'Drafts') @folder_configs[:LIST_NAME] = '送信箱' if(@name == 'Outbox') @folder_configs[:LIST_NAME] = '送信済み' if(@name == 'Sent') @folder_configs[:LIST_NAME] = 'ゴミ箱' if(@name == 'Trash') @folder_configs[:LIST_NAME] = 'マニュアル' if(@name == 'Manual') @folder_configs[:LIST_PRIORITY] = 50 # 表示優先度(最高:0-100:最低) @folder_configs[:LIST_PRIORITY] = 10 if(@name == 'Inbox') @folder_configs[:LIST_PRIORITY] = 60 if(@name == 'Drafts') @folder_configs[:LIST_PRIORITY] = 70 if(@name == 'Outbox') @folder_configs[:LIST_PRIORITY] = 80 if(@name == 'Sent') @folder_configs[:LIST_PRIORITY] = 90 if(@name == 'Trash') @folder_configs[:LIST_PRIORITY] = 99 if(@name == 'Manual') @folder_configs[:BIND_PRIORITY] = 50 # 振り分け処理優先度(最高:0-100:最低) @folder_configs[:BIND_PRIORITY] = 99 if(@name == 'Trash') @folder_configs[:BIND_PRIORITY] = 100 if(@name == 'Inbox') @folder_configs[:BIND_PRIORITY] = 999 if(@name == 'Drafts') @folder_configs[:BIND_PRIORITY] = 999 if(@name == 'Outbox') @folder_configs[:BIND_PRIORITY] = 999 if(@name == 'Sent') @folder_configs[:SHORTCUT_HINT] = 'abc' # ショートカットキー(希望順) @folder_configs[:SHORTCUT_HINT] = '0' if(@name == 'Inbox') @folder_configs[:SHORTCUT_HINT] = 'd' if(@name == 'Drafts') @folder_configs[:SHORTCUT_HINT] = 'o' if(@name == 'Outbox') @folder_configs[:SHORTCUT_HINT] = 's' if(@name == 'Sent') @folder_configs[:SHORTCUT_HINT] = 't' if(@name == 'Trash') @folder_configs[:SHORTCUT_HINT] = 'M' if(@name == 'Manual') @folder_configs[:SEND_VIEW] = false # 送信ビュー(一覧表示の送信者表示が、送信元でなく、送信先になる) @folder_configs[:SEND_VIEW] = true if(@name == 'Drafts') @folder_configs[:SEND_VIEW] = true if(@name == 'Outbox') @folder_configs[:SEND_VIEW] = true if(@name == 'Sent') #--------------------------------------------------------------- # # 振り分け設定(フォルダとして所属を要求するなら true を返す) # def bind?(mail, account) # 振り分けデバッグ用 # debug("bind?: [%s] [%s] [%s]" % [@name, nil | ((it = mail.from.decode_mh) =~ /^田中/), it]) # 同一のメールを重複して受信したら捨てる unless(@name == account[:TRASH_FOLDER]) # 重複するメールなら、ゴミ箱宛のマークを付けて、受け取らない mail.binding = 'dup' if(@sq_messageid[mail.message_id]) return(false) if(mail.binding and mail.binding == 'dup') else # ゴミ箱ならば、ゴミ箱中のメールに重複するメール、および、ゴミ箱宛のマークの付いたメールを受け取る return(true) if(@sq_messageid[mail.message_id]) return(true) if(mail.binding and mail.binding == 'dup') end # ディレクトリ新規作成の際に path 名等に置換される ※未実装 # self_dir = '--mave_folder_path--' # インポートの際の振り分け用 ※未実装 # return true if(mail.header['X-mave-import-from'] =~ %r!/--mave_folder_base--/!) # 件名に特定の文字列が含まれれば、取得 # return true if(mail.subject.decode_mh =~ /\[ruby:\n+\]/) # Ruby ML http://www.ruby-lang.org/ja/community/mailing-lists/ # 既存のメールに関連のあるメールなら、取得 mail.each_in_reply_to {|id| return(true) if(@sq_messageid[id]) } mail.each_reference {|id| return(true) if(@sq_messageid[id]) } # 該当せず # false @name == account[:INBOX_FOLDER] # フォルダ名が Inbox なら無条件に要求する end #--------------------------------------------------------------- # # 全文検索設定 # def fulltext_search(query) #----------------------------------------------------------- # # Hyper Estraier 設定例 # # 定期的なインデックス更新のための crontab の設定例 # 15 * * * * cd ~/mave.mails/Inbox; find . -type f -name "*eml" | /usr/local/bin/estcmd gather -cl -fm -cm casket - # `which estcmd >/dev/null 2>&1` if($?.exitstatus == 0 and File.directory?(index_path = '%s/casket' % path)) IO.popen("estcmd search -vh -ord '@mdate NUMD' -max 10 %s '%s' 2>&1" % [index_path, query]) {|stdout| class </dev/null 2>&1` if($?.exitstatus == 0 and File.directory?(index_path = '%s/nmzidx' % path)) IO.popen("LANG=ja_JP.EUC-JP namazu --max 10 --late '%s' %s 2>&1" % [query.kconv(Kconv::EUC, Kconv::UTF8), index_path]) {|stdout| class </ and line =~ /添付|同封|attach|enclose|pdf|doc|xls|ppt/i) halfname = mail.folder.create_mailfile {|fh| fh.write("X-Mave-Confirm-To-Send: NOT confirmed\n") # 確認用ヘッダを追加する MavePseudoMail.new({:CONFIGS => @configs, :MODE => :EDIT, :MAIL => mail}).pseudo_each {|line1| fh.write(line1 + "\n") } } new_mail = MavePseudoMail.new({:CONFIGS => @configs, :FILE => File.new(path + '/' + halfname)}) overwrite_mail(new_mail, mail) delete(halfname) unless(RUBY_PLATFORM =~ /i.86-mswin32/) #### raise(_('Sending aborted. The \'attach\' keyword found. [%s]') % line.chomp.decode_mh) end } end end def postsend(mail) end __END__