[commit] isync/src/compat
CVS commit by ossi: compat wrapper: don't crash if neither host nor tunnel are specified. fixes: CCMAIL: [EMAIL PROTECTED] M +4 -1 config.c 1.10 --- isync/src/compat/config.c #1.9:1.10 @@ -247,5 +247,5 @@ write_imap_server( FILE *fp, config_t *c if (cfg->tunnel) nfasprintf( (char **)&cfg->old_server_name, "tunnel%d", ++tunnels ); - else { + else if (cfg->host) { if (sscanf( cfg->host, "%d.%d.%d.%d", &a1, &a2, &a3, &a4 ) == 4) hl = nfsnprintf( buf, sizeof(buf), "%s", cfg->host ); @@ -271,4 +271,7 @@ write_imap_server( FILE *fp, config_t *c cfg->old_servers = 1; gotsrv: ; + } else { + fprintf( stderr, "ERROR: Neither host nor tunnel specified for mailbox %s.\n", cfg->path ); + exit( 1 ); } - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel
[commit] isync/src/compat
CVS commit by ossi: quote user name in generated config. fixes: CCMAIL: [EMAIL PROTECTED] M +1 -1 config.c 1.9 --- isync/src/compat/config.c #1.8:1.9 @@ -306,5 +306,5 @@ write_imap_server( FILE *fp, config_t *c } if (cfg->user) - fprintf( fp, "User %s\n", cfg->user ); + fprintf( fp, "User \"%s\"\n", cfg->user ); if (cfg->pass) fprintf( fp, "Pass \"%s\"\n", cfg->pass ); - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel
[commit] isync/src/compat
CVS commit by ossi: make compat wrapper default to current user for imap login M +6 -0 main.c 1.8 --- isync/src/compat/main.c #1.7:1.8 @@ -23,4 +23,5 @@ #include #include +#include #include #include @@ -168,4 +169,9 @@ main( int argc, char **argv ) /* XXX the precedence is borked: it's defaults < cmdline < file instead of defaults < file < cmdline */ +#ifdef BSD + global.user = getenv( "USER" ); +#else + global.user = getenv( "LOGNAME" ); +#endif global.port = 143; global.box = "INBOX"; - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel
[commit] isync/src/compat
CVS commit by ossi: put INBOX in Maildir M +3 -1 config.c 1.8 --- isync/src/compat/config.c #1.7:1.8 @@ -251,4 +251,5 @@ write_imap_server( FILE *fp, config_t *c hl = nfsnprintf( buf, sizeof(buf), "%s", cfg->host ); else { + /* XXX this does not avoid clashes. add port? */ p = strrchr( cfg->host, '.' ); if (!p) @@ -376,5 +377,6 @@ write_config( int fd ) fprintf( fp, "SyncState *\n\n" ); if (local_home || o2o) - fprintf( fp, "MaildirStore local\nPath \"%s/\"\nAltMap %s\n\n", maildir, tb( altmap > 0 ) ); + fprintf( fp, "MaildirStore local\nPath \"%s/\"\nInbox \"%s/INBOX\"\nAltMap %s\n\n", +maildir, maildir, tb( altmap > 0 ) ); if (local_root) fprintf( fp, "MaildirStore local_root\nPath /\nAltMap %s\n\n", tb( altmap > 0 ) ); - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel
[commit] isync/src/compat
CVS commit by ossi: create more descriptive account names, so password prompts look sane. the channel names follow the old scheme, though - they are used to compose sync state file names, and i don't feel like writing a migrator for this. M +39 -14config.c 1.6 M +2 -0 isync.h 1.5 --- isync/src/compat/config.c #1.5:1.6 @@ -242,14 +242,12 @@ write_imap_server( FILE *fp, config_t *c char *p, *p2; int hl, a1, a2, a3, a4; - char buf[128]; + char buf[128], ubuf[64]; static int tunnels; - if (cfg->tunnel) { - nfasprintf( (char **)&cfg->server_name, "tunnel%d", ++tunnels ); - fprintf( fp, "IMAPAccount %s\nTunnel \"%s\"\n", -cfg->server_name, cfg->tunnel ); - } else { + if (cfg->tunnel) + nfasprintf( (char **)&cfg->old_server_name, "tunnel%d", ++tunnels ); + else { if (sscanf( cfg->host, "%d.%d.%d.%d", &a1, &a2, &a3, &a4 ) == 4) - cfg->server_name = nfstrdup( cfg->host ); + cfg->old_server_name = nfstrdup( cfg->host ); else { p = strrchr( cfg->host, '.' ); @@ -265,12 +263,39 @@ write_imap_server( FILE *fp, config_t *c for (pbox = boxes; pbox != cfg; pbox = pbox->next) if (!memcmp( pbox->server_name, buf, hl + 1 )) { - nfasprintf( (char **)&cfg->server_name, "%s-%d", buf, ++pbox->servers ); + nfasprintf( (char **)&cfg->old_server_name, "%s-%d", buf, ++pbox->old_servers ); goto gotsrv; } - cfg->server_name = nfstrdup( buf ); - cfg->servers = 1; + cfg->old_server_name = nfstrdup( buf ); + cfg->old_servers = 1; gotsrv: ; } + } + + if (cfg->user) + nfsnprintf( ubuf, sizeof(ubuf), "%s@", cfg->user ); + else + ubuf[0] = 0; + if (!cfg->host) + hl = nfsnprintf( buf, sizeof(buf), "%stunnel", ubuf ); + else { + if (cfg->port != (cfg->use_imaps ? 993 : 143)) + hl = nfsnprintf( buf, sizeof(buf), "%s%s_%d", ubuf, cfg->host, cfg->port ); + else + hl = nfsnprintf( buf, sizeof(buf), "%s%s", ubuf, cfg->host ); + } + if (boxes) /* !o2o */ + for (pbox = boxes; pbox != cfg; pbox = pbox->next) + if (!memcmp( pbox->server_name, buf, hl + 1 )) { + nfasprintf( (char **)&cfg->server_name, "%s-%d", buf, ++pbox->servers ); + goto ngotsrv; + } + cfg->server_name = nfstrdup( buf ); + cfg->servers = 1; + ngotsrv: ; + fprintf( fp, "IMAPAccount %s\n", cfg->server_name ); + if (cfg->tunnel) + fprintf( fp, "Tunnel \"%s\"\n", cfg->tunnel ); + else { if (cfg->use_imaps) fprintf( fp, "Host imaps:%s\n", cfg->host ); @@ -297,7 +322,7 @@ write_imap_store( FILE *fp, config_t *cf { if (cfg->stores > 1) - nfasprintf( (char **)&cfg->store_name, "%s-%d", cfg->server_name, cfg->stores ); + nfasprintf( (char **)&cfg->store_name, "%s-%d", cfg->old_server_name, cfg->stores ); else - cfg->store_name = cfg->server_name; + cfg->store_name = cfg->old_server_name; fprintf( fp, "IMAPStore %s\nAccount %s\n", cfg->store_name, cfg->server_name ); --- isync/src/compat/isync.h #1.4:1.5 @@ -42,5 +42,7 @@ typedef struct config { const char *server_name; + const char *old_server_name; int servers; + int old_servers; char *host; int port; ___ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel
[commit] isync/src/compat
CVS commit by ossi: enable the old account naming scheme to deal with duplicated ip addresses. this is not incompatible - previously, it would just create garbage. M +10 -10config.c 1.7 --- isync/src/compat/config.c #1.6:1.7 @@ -249,5 +249,5 @@ write_imap_server( FILE *fp, config_t *c else { if (sscanf( cfg->host, "%d.%d.%d.%d", &a1, &a2, &a3, &a4 ) == 4) - cfg->old_server_name = nfstrdup( cfg->host ); + hl = nfsnprintf( buf, sizeof(buf), "%s", cfg->host ); else { p = strrchr( cfg->host, '.' ); @@ -260,4 +260,5 @@ write_imap_server( FILE *fp, config_t *c hl = sprintf( buf, "%s", p2 + 1 ); } + } if (boxes) /* !o2o */ for (pbox = boxes; pbox != cfg; pbox = pbox->next) @@ -270,5 +271,4 @@ write_imap_server( FILE *fp, config_t *c gotsrv: ; } - } if (cfg->user) ___ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel
[commit] isync/src/compat
CVS commit by ossi: whoops - 'isync -w' would write .mbsyncrc to a wrong directory M +2 -2 main.c 1.6 --- isync/src/compat/main.c #1.5:1.6 @@ -332,6 +332,6 @@ main( int argc, char **argv ) if (*de->d_name == '.') continue; - nfsnprintf( path1, sizeof(path1), "%s/%s/cur", xmaildir, de->d_name ); - if (stat( path1, &st ) || !S_ISDIR( st.st_mode )) + nfsnprintf( path2, sizeof(path2), "%s/%s/cur", xmaildir, de->d_name ); + if (stat( path2, &st ) || !S_ISDIR( st.st_mode )) continue; global.path = de->d_name; --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel