Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2452|回复: 0
打印 上一主题 下一主题

邮件存储 压缩方案

[复制链接]

388

主题

602

帖子

2218

积分

金牌会员

Rank: 6Rank: 6

积分
2218
跳转到指定楼层
楼主
发表于 2016-3-13 20:39:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
n mbox file   和 .msf文件
the mbox file (the text file named after the folder that contains all of the messages for that folder) and figure out where every message begins and ends. Thunderbird can't use the so-called index file (folder_name.msf)

有时候文件夹索引文件(.msf)被损坏并且出现邮件丢失或者已删除的邮件又重新出现的现象,修复此文件夹可以修复这类问题。

Inbox.sbd   子文件夹相关




http://kb.mozillazine.org/Compacting_folders

When you delete messages in an email client such as Thunderbird they aren't physically deleted. Even emptying the Trash does not get rid of them. Instead they are marked for deletion and hidden from view. They are not physically removed until you "compact" the folder. This is a tradeoff done to improve performance in large folders.
"Compacting" a folder has nothing to do with compressing or zipping a file. Compressing/zipping only changes how data is stored; compacting changes the actual data. Compacting a folder frees wasted space but the main reason to do it regularly is because its a type of preventative maintenance. If you don't compact your folders regularly performance can slow to a crawl, you can't store new messages anymore, start losing parts of messages or have deleted messages resurrected. If you notice a message has a date of 1969 that is due to it losing the Date: header in the message.
Corrupt folders tend to occur when you have lots of messages in a folder, many of them are deleted, and you don't compact often enough. This is usually only a problem for the inbox folder as while other folders may get very large you typically don't delete messages in them often. Its recommended that you keep the number of messages in your inbox small, and move any you want to permanently keep to other folders/child folders.


删除只是做了标志不在视图中显示,没有真正物理删除,只有执行压缩后,才真正删除
thunderbird中压缩的操作
选中文件夹 右键压缩
先中账号 文件->压缩文件夹 (压缩账号下的所有文件夹)

自动压缩Tools -> Options -> Advanced -> Network & Disk Space -> "Compact folders when it will save over X MB"
automatically enabled and defaults to 20MB.

mail.prompt_purge_threshhold   是否启动压缩   需要节省空间时压缩全部文件夹

mail.purge_threshhold_mb  启用压缩的空间大小 阈值 默认20M这个值越大压缩间隔越长,同时压缩时间也越长。1M是个最小值 以防止已经删除的邮件在邮件存储文件中占用比例过大,造成文件损坏。

mail.purge.ask  压缩时是否提示   自动压缩邮件夹前总是询问

IMAP中对压缩的特有选项
Tools -> Account Settings -> Server Settings ->
退出时清除收件箱  mail.server.%serverkey%.cleanup_inbox_on_exit
退出时清空“废件箱”  mail.server.%serverkey%.empty_trash_on_exit
选中后退出程序会执行压缩

只删除附件:
删除附件不会减小mbox file大小,反而增加,直到执行压缩才真正减小
删除附件不是真正的物理删除,只是把原邮件标记为删除,并创建一个没有附件的拷贝,只不过这个拷贝记录了曾经有个附件的事实,这就是mbox增大的原因
You only see the copy because messages marked for deletion are automatically hidden from view.
When you compact the folder the original message is physically deleted, and only the copy without the attachment is left. This reduces the size of the mbox file.



只有在离线情况下才会执行 自动压缩
AutoCompact(aMsgWindow);

class AutoCompactEvent : public nsRunnable
{
public:
  AutoCompactEvent(nsIMsgWindow *aMsgWindow, nsMsgDBFolder *aFolder)
    : mMsgWindow(aMsgWindow), mFolder(aFolder)
  {}

  NS_IMETHOD Run()
  {
    if (mFolder)
      mFolder->HandleAutoCompactEvent(mMsgWindow);
    return NS_OK;
  }

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|firemail ( 粤ICP备15085507号-1 )

GMT+8, 2024-11-26 08:45 , Processed in 0.059991 second(s), 19 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表