commit 2c34ea6cdd80257e6c4581dfcd21911d79522c03
parent 862d7aa56627184a7063b279397a78cf3d9a73e9
Author: Damien Leone <damien.leone@fensalir.fr>
Date: Sat, 26 Feb 2011 17:12:40 +0100
sup-sync-back-maildir: merging is now optional
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/bin/sup-sync-back-maildir b/bin/sup-sync-back-maildir
@@ -21,6 +21,9 @@ have an e-mail file like this: foo_bar:2,FRS (flags are favorite,
replied, seen) and its Xapian entry has labels 'starred', the merge
operation will add the 'replied' label to the Xapian entry.
+If you choose not to merge you will lose information because in the
+previous example the file will be renamed to foo_bar:2,FS.
+
Running this script is *strongly* recommanded when setting the
"sync_back_to_maildir" option from false to true.
@@ -33,6 +36,7 @@ behavior is to sync back all Maildir sources.
Options include:
EOS
opt :no_confirm, "Don't ask for confirmation before synchronizing", :default => false, :short => "n"
+ opt :no_merge, "Don't merge new supported Maildir flags (R and P)", :default => false, :short => "m"
opt :list_sources, "List your Maildir sources and exit", :default => false, :short => "l"
end
@@ -80,7 +84,10 @@ begin
infos.each do |info|
print "\rSynchronizing '#{s.uri}'... #{((counter += 1)/infos.size.to_f*100).to_i}%"
index.each_message({:location => [s.id, info]}, false) do |m|
- m.merge_labels_from_locations [:replied, :forwarded]
+ if opts[:no_merge] == false
+ m.merge_labels_from_locations [:replied, :forwarded]
+ end
+
index.save_message m
end
end