:mk_global_import_mail => method(:import_mail),
:mk_global_fetch_mail_pop => method(:fetch_mail_pop),
:mk_global_send_mail_smtp => method(:send_mail_smtp),
+ :mk_global_toggle_what_scache => method(:toggle_what_scache),
:mk_global_toggle_what_charset => method(:toggle_what_charset),
:mk_global_kill_mave => method(:kill_mave),
@models[:FOLDERS].each(:BIND_PRIORITY) {|folder|
if(folder.bind?(mail, account))
- folder.add_mail(mail)
+ sq = folder.add_mail(mail)
+ (it = mail.cc) and it.index(account.mail_from) and folder.ccyou(sq)
+ (it = mail.to) and it.index(account.mail_from) and folder.toyou(sq)
@models[:FOLDERS].unred(folder)
break
end
@models[:STATUS].log([_('Failed to imported mail. file=[%s] reason=[%s]'), target, $!.message.split(/\r?\n/)[0]])
end
}
- @models[:STATUS].log([_('%1$s mail%2$s imported.'), (it = m_mail) == 0 ? 'no' : it.to_s, it == 1 ? '' : 's'])
+ result_message = (it = m_mail) != 0 ? '%1$s mail%2$s imported.' : 'no mails imported.'
+ @models[:STATUS].log([_(result_message), it.to_s, it == 1 ? '' : 's'])
@models[:FOLDERS].dirty # メール数の再表示
end
debug('Subject: %s' % mail.subject.decode_mh) if(debug = false) # 振り分けのデバッグ
@models[:FOLDERS].each(:BIND_PRIORITY) {|folder|
- debug(' %5s %3d: %s' % [folder.bind?(mail, account), folder.configs[:BIND_PRIORITY], folder.name]) if(debug)
+ debug(' %5s %3d: [%s] %s [%s]' % [folder.bind?(mail, account), folder.configs[:BIND_PRIORITY], mail.binding, folder.name, account[:TRASH_FOLDER]]) if(debug)
if(folder.bind?(mail, account))
- folder.add_mail(mail)
+ sq = folder.add_mail(mail)
+ (it = mail.cc) and it.index(account.mail_from) and folder.ccyou(sq)
+ (it = mail.to) and it.index(account.mail_from) and folder.toyou(sq)
@models[:FOLDERS].unred(folder)
@pop_directory.delete(halfname) unless(RUBY_PLATFORM =~ /i.86-mswin32/) ####
break
@models[:STATUS].log([_('Failed to pop mail. reason=[%s]'), $!.message.split(/\r?\n/)[0]])
end
}
- @models[:STATUS].log([_('%1$s mail%2$s popped.'), (it = m_mail) == 0 ? 'no' : it.to_s, it == 1 ? '' : 's'])
+ result_message = (it = m_mail) != 0 ? '%1$s mail%2$s popped.(%3$s)' : 'no mails popped.(%3$s)'
+ @models[:STATUS].log([_(result_message), it.to_s, it == 1 ? '' : 's', Time.now.myexectime])
@models[:FOLDERS].dirty # メール数の再表示
end
#
def send_mail_smtp
m_mail = 0
- @models[:ACCOUNTS].each {|account|
- next unless(account.smtp_server)
+ account = @models[:ACCOUNTS].regular
+ if(account.smtp_server)
begin
n_mail = 0; max_n_mail = 9999
outbox_folder = @models[:FOLDERS].open_folder(account[:OUTBOX_FOLDER])
rescue
@models[:STATUS].log([_('Failed to send mail. reason=[%s]'), $!.message.split(/\r?\n/)[0]])
end
- }
- @models[:STATUS].log([_('%1$s mail%2$s sent.'), (it = m_mail) == 0 ? 'no' : it.to_s, it == 1 ? '' : 's'])
+ end
+ result_message = (it = m_mail) != 0 ? '%1$s mail%2$s sent.(%3$s)' : 'no mails sent.(%3$s)'
+ @models[:STATUS].log([_(result_message), it.to_s, it == 1 ? '' : 's', Time.now.myexectime])
@models[:FOLDERS].dirty # メール数の再表示
end
unless(@configs[:VIEWER_TYPE] == 'forkexec') # 一旦 Curse を閉じて、ビューアアプリを起動する場合
@views.close
system(@configs[:VIEWER] % (@pop_directory.path + '/' + params[:HALFNAME]))
+# pickup_file_force
@pop_directory.delete(params[:HALFNAME]) unless(RUBY_PLATFORM =~ /i.86-mswin32/) ####
@views.reopen
else # 別途ウィンドウで、ビューアアプリを起動する場合
create_new_relations(mail, editfile[:MAIL].folder) # 新規関連ファイル作成処理
extract_attachments(mail, editfile[:MAIL].folder) # 添付ファイル展開処理
editfile[:MAIL].folder.overwrite_mail(mail, editfile[:MAIL])
+ editfile[:MAIL].folder.delete_abstract(editfile[:MAIL].sq)
@models[:STATUS].log([_('The message was overwrited.')])
else
create_new_relations(mail, editfile[:MAIL].folder) # 新規関連ファイル作成処理
end
elsif(editfile[:FOLDER])
if(editfile[:SOURCEHASH] == editfile[:FOLDER].md5) # (編集前 == 現在)?
- @models[:FOLDERS].overwrite_folder_configs(editfile[:FOLDER], File.new(@pop_directory.path + '/' + editfile[:HALFNAME]))
- @models[:STATUS].log([_('Folder configs ware overwrited.')])
+ folder = @models[:FOLDERS].overwrite_folder_configs(editfile[:FOLDER], File.new(@pop_directory.path + '/' + editfile[:HALFNAME]))
+ @views[:SUMMARY].tie(folder)
+ @views[:FOLDERLIST].list_items; @views[:FOLDERLIST].target_cursor(folder)
+ @models[:STATUS].log([_('Folder configs were overwrited.')])
else
# editfile[:FOLDER].folder.add_mail(mail) #### 別名で保存しておく
- @models[:STATUS].log([_('Folder configs ware discarded (edit collision was detected).')])
+ @models[:STATUS].log([_('Folder configs were discarded (edit collision was detected).')])
end
else
@models[:STATUS].log([_('The file was discarded (unexpected type).')])
end
else
@models[:STATUS].log([_('The message was discarded.')]) if(editfile[:MAIL])
- @models[:STATUS].log([_('Folder configs ware discarded.')]) if(editfile[:FOLDER])
+ @models[:STATUS].log([_('Folder configs were discarded.')]) if(editfile[:FOLDER])
end
@pop_directory.delete(editfile[:HALFNAME]) unless(RUBY_PLATFORM =~ /i.86-mswin32/) ####
@models[:FOLDERS].dirty # メール数の再表示
+ @views[:PREVIEW].untie
end
#-----------------------------------------------------------
unless(@configs[:FILE_MANAGER_TYPE] == 'forkexec')
@views.close
system(@configs[:FILE_MANAGER] % target_dir)
+# pickup_file_force
@views.reopen
else
pid = fork {
#-----------------------------------------------------------
#
+ # メールの概要キャッシュ(インクリメンタルサーチ用)表示、切り替え
+ #
+ def toggle_what_scache
+ state = MaveFolder.toggle_what_scache
+ @models[:STATUS].log(['what search cache: %s', state.to_s])
+ @views[:SUMMARY].list_items
+ end
+
+ #-----------------------------------------------------------
+ #
# キャラクタセット情報の表示、切り替え(デバッグ用)
#
def toggle_what_charset
@models[:STATUS].log([_('%1$d editor%2$s alive.'), it, it == 1 ? ' is' : 's are'])
@force_kill = true
else
+ @models[:FOLDERS].close
@models[:ACCOUNTS].close
+ @models[:ADDRESS_BOOK].close
+ @pop_directory.close if(@pop_directory)
raise 'Full stop.'
end
end