isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit bf9d7c769503a5418baee936ffa9b0d8d88cdf1a
parent f55f42bdfc13d22b995289b666a30612469fcdf6
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Sun,  9 Mar 2014 16:38:09 +0100

write Sync and Expunge to global section if applicable

makes for leaner Channel sections.

note: the global delete and expunge variables exist so the command line
can override the config file despite the otherwise backwards behavior.

Diffstat:
Msrc/compat/config.c | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/compat/config.c b/src/compat/config.c @@ -344,9 +344,9 @@ write_channel_parm( FILE *fp, config_t *cfg ) fprintf( fp, "MaxSize %d\n", cfg->max_size ); if (cfg->max_messages) fprintf( fp, "MaxMessages %d\n", cfg->max_messages ); - if (!cfg->delete && !delete) - fputs( "Sync New ReNew Flags\n", fp ); - if (cfg->expunge || expunge) + if (cfg->delete && !global.delete && !delete) + fputs( "Sync All\n", fp ); + if (cfg->expunge && !global.expunge && !expunge) fputs( "Expunge Both\n", fp ); fputc( '\n', fp ); } @@ -373,7 +373,12 @@ write_config( int fd ) return; } - fprintf( fp, "SyncState *\n\n" ); + fputs( "SyncState *\n", fp ); + if (!global.delete && !delete) + fputs( "Sync New ReNew Flags\n", fp ); + if (global.expunge || expunge) + fputs( "Expunge Both\n", fp ); + fputc( '\n', fp ); if (local_home || o2o) fprintf( fp, "MaildirStore local\nPath \"%s/\"\nInbox \"%s/INBOX\"\nAltMap %s\n\n", maildir, maildir, tb( altmap > 0 ) );