解決的辦法有兩個:
1.讓Roundcube直接建立預設的資料夾
編輯Roundcube目錄下config資料夾下的config.inc.php檔案,在最下方加入
$config['create_default_folders'] = True;
存檔後使用者再重新登入roundcube即可!
mail_plugins = $mail_plugins autocreate
在20-imap.conf檔案的最後加上以下內容:
plugin {
autocreate = Trash
autocreate2 = Junk
autocreate3 = Drafts
autocreate4 = Sent
autosubscribe = Trash
autosubscribe2 = Junk
autosubscribe3 = Drafts
autosubscribe4 = Sent
}
存檔後重新啟動dovecot即可!
PS:若dovecot是2.2以上版本,以上設定會導致/var/log/mail.log下出現:
Warning: autocreate plugin is deprecated, use mailbox { auto } setting
這樣的警告訊息!這個警告訊息不影響dovecot的正常運作!
依照Dovecot網頁文件的說法(http://wiki2.dovecot.org/MailboxSettings),dovecot 2.1之後的版本在mail_plugins = 後方不需要autocreate
,所有的autocreate = 和 autosubscribe = 都需要移除,並加入下列內容:
namespace inbox {
#prefix = INBOX. # the namespace prefix isn't added again to the mailbox names.
# ...
mailbox Trash {
auto = no
special_use = \Trash
}
mailbox Drafts {
auto = no
special_use = \Drafts
}
mailbox Sent {
auto = subscribe # autocreate and autosubscribe the Sent mailbox
special_use = \Sent
}
mailbox "Sent Messages" {
auto = no
special_use = \Sent
}
mailbox Spam {
auto = create # autocreate Spam, but don't auto subscribe
special_use = \Junk
}
mailbox virtual/All {# if you have a virtual "All messages" mailbox
auto = no
special_use = \All
}
}
所以修改完的內容應該如下:
mail_plugins = $mail_plugins
mailbox_list_index=yes
namespace inbox {
#prefix = INBOX. # the namespace prefix isn't added again to the mailbox names.
# ...
mailbox Trash {
auto = no
special_use = \Trash
}
mailbox Drafts {
auto = no
special_use = \Drafts
}
mailbox Sent {
auto = subscribe # autocreate and autosubscribe the Sent mailbox
special_use = \Sent
}
mailbox "Sent Messages" {
auto = no
special_use = \Sent
}
mailbox Spam {
auto = create # autocreate Spam, but don't auto subscribe
special_use = \Junk
}
mailbox virtual/All {# if you have a virtual "All messages" mailbox
auto = no
special_use = \All
}
}
存檔後重新啟動dovecot即可讓dovecot支援自動產生資料夾的功能!但這個做法在目前的roundcube(1.1.4)上並沒有生效!所以建議使用第一個方式來根本解決!