[Xfce4-commits] <postler:master> Add a 'prefix' field applied to IMAP folders

Christian Dywan noreply at xfce.org
Fri Jun 18 00:04:01 CEST 2010


Updating branch refs/heads/master
         to d29fe02452b294d7304f4c128acdc1567661d87e (commit)
       from d475cea6d42ba8775cc210c5d0a5c8050d7f1f35 (commit)

commit d29fe02452b294d7304f4c128acdc1567661d87e
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Jun 16 23:01:19 2010 +0200

    Add a 'prefix' field applied to IMAP folders
    
    In practise the prefix is usually empty or 'INBOX'.

 postler/postler-accounts.vala |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/postler/postler-accounts.vala b/postler/postler-accounts.vala
index ea1ef0d..6d1d422 100644
--- a/postler/postler-accounts.vala
+++ b/postler/postler-accounts.vala
@@ -25,6 +25,7 @@ namespace Postler {
         public string receive;
         public string username;
         public string password;
+        public string prefix;
         public string path;
         public string certificate;
         public string sync;
@@ -110,6 +111,8 @@ public class Postler.Accounts : GLib.Object {
                         info.username = keyfile.get_string (group, "username");
                     if (keyfile.has_key (group, "password"))
                         info.password = keyfile.get_string (group, "password");
+                    if (keyfile.has_key (group, "prefix"))
+                        info.prefix = keyfile.get_string (group, "prefix");
                     if (keyfile.has_key (group, "receive"))
                         info.receive = keyfile.get_string (group, "receive");
                     if (keyfile.has_key (group, "certificate"))
@@ -205,6 +208,7 @@ public class Postler.Accounts : GLib.Object {
                    Host %s
                    User %s
                    Pass %s
+                   Path %s
                    UseIMAPS yes
                    CertificateFile %s
                    %s %s
@@ -216,12 +220,17 @@ public class Postler.Accounts : GLib.Object {
                Channel local-remote
                    Master :remote:
                    Slave :local:
-                   Patterns % *
+                   Patterns %% * !INBOX
+
+               Group mirror
+                   Channel local-remote:INBOX
+                   Channel local-remote
                """.
                printf (
                    info.receive,
                    info.username,
                    info.password,
+                   info.prefix != null ? info.prefix + "." : "",
                    certificate_file,
                    certificate != null ? "CertificateFile" : "",
                    certificate != null ? certificate : "",
@@ -253,7 +262,7 @@ public class Postler.Accounts : GLib.Object {
             string filename = get_tool_configuration_filename (info);
             string command;
             if (info.type == AccountType.IMAP)
-                command = "mbsync -c %s -a --pull%s".printf (
+                command = "mbsync -c %s --pull%s mirror".printf (
                     filename, info.sync == "full" ? " --push" : "");
             else
                 continue;



More information about the Xfce4-commits mailing list