Oswald Buddenhagen
926788f3ae
supplement open_box() with box existence information from list_store()
...
there is no point in trying to open a non-existing box before trying to
create it.
2015-01-11 15:05:29 +01:00
Oswald Buddenhagen
fb19d644f7
split off open_box() from select_box()
...
aka prepare_paths() reloaded. we'll need it in a moment.
2015-01-11 15:05:29 +01:00
Oswald Buddenhagen
9982e7bf08
make some driver function names more descriptive
2015-01-11 15:05:29 +01:00
Oswald Buddenhagen
b730f66f7d
Merge branch 'isync_1_1_branch' into HEAD
...
Conflicts:
src/socket.c
2015-01-11 14:32:15 +01:00
Oswald Buddenhagen
9eba3d8cd9
don't leave 2nd store in limbo if opening 1st store fails synchronously
...
we can't leave the store FRESH, as otherwise the error handling code
will assume it is still being opened and will return to the main loop.
depending on the config this would cause an immediate termination or an
indefinite wait.
2015-01-02 11:29:51 +01:00
Oswald Buddenhagen
f377e7b696
introduce FieldDelimiter and InfoDelimiter options
...
... for windows fs compatibility.
the maildir-specific InfoDelimiter inherits the global FieldDelimiter
(which affects SyncState), based on the assumption that if the sync
state is on a windows FS, the mailboxes certainly will be as well, while
the inverse is not necessarily true (when running on unix, anyway).
REFMAIL: <CA+m_8J1ynqAjHRJagvKt9sb31yz047Q7NH-ODRmHOKyfru8vtA@mail.gmail.com>
2014-10-25 17:42:48 +02:00
Oswald Buddenhagen
4f383a8074
stop abusing memcmp()
...
memcmp() is unfortunately not guaranteed to read forward byte-by-byte,
which means that the clever use as a strncmp() without the pointless
strlen()s is not permitted, and can actually misbehave with
SSE-optimized string functions.
so implement proper equals() and starts_with() functions. as a bonus,
the calls are less cryptic.
2014-10-04 18:37:34 +02:00
Oswald Buddenhagen
31ba8375b0
fix segfault on passing --{create,expunge}-{master,slave}
...
stupid copy&pasto.
found by coverity.
2014-04-12 15:16:22 +02:00
Oswald Buddenhagen
03b3b566f1
reshuffle sources a bit
...
split header and move some code to more logical places.
2013-12-08 23:19:12 +01:00
Oswald Buddenhagen
92b892d247
tag verbose output when channel links two verbose stores
...
otherwise it's pure guesswork to assign the output to particular stores.
2013-12-08 23:14:34 +01:00
Oswald Buddenhagen
0b32734693
remove own_store() function from driver model
...
the drivers which support it can abstract it inside open_store() just
fine.
2013-12-08 23:14:34 +01:00
Oswald Buddenhagen
cf0f32f800
allow prefixes to Patterns
...
this makes it possible to "rename" a "namespace" while syncing.
2013-12-08 11:12:18 +01:00
Oswald Buddenhagen
6c6ad9710c
less spaghetti
2013-12-08 11:12:18 +01:00
Oswald Buddenhagen
decc33c2cf
factor out sync_listed_boxes()
2013-12-08 11:12:18 +01:00
Oswald Buddenhagen
f485d69332
refuse box list overrides if Channel has no Patterns
...
as the named boxes are the same on both sides, they logically make
sense only when the channel is in that mode anyway, which is the case
when using patterns.
2013-12-08 11:12:17 +01:00
Oswald Buddenhagen
c6f08b8f17
treat manually specified box list the same as one coming from Patterns
2013-12-08 11:12:17 +01:00
Oswald Buddenhagen
c0ba0c7ecf
replace global_* with a channel_conf_t instance
...
this makes the (growing) list of getopt_helper()'s parameters
manageable. the few wasted bytes are worth it.
2013-12-08 11:12:09 +01:00
Oswald Buddenhagen
1e427f5cd5
do not unnecessarily use bitfields
...
they don't save much (if any) space in our usage, while they make the
machine code more bloated and slow.
2013-12-08 11:12:09 +01:00
Oswald Buddenhagen
62a60997c3
make use of strptime() portable
...
it does not (officially) support the %z conversion, so re-implement that
part by hand.
2013-12-01 13:36:26 +01:00
Oswald Buddenhagen
32def5dc0a
add/fix comments and improve debug messages
2013-12-01 13:36:26 +01:00
Oswald Buddenhagen
0b59ee0df3
support multi-character path separators
...
this applies to both the IMAP PathDelimiter (which is needed by Lotus
Domino), as well as the Flatten-ed separators.
2013-08-11 10:20:02 +02:00
Oswald Buddenhagen
406e967430
don't let wildcards match INBOX, unless it lives under Path
...
it's counter-intuitive to have '*' match the (always present) INBOX
when the rest of the mailboxes lives in a different namespace.
2013-04-13 19:58:50 +02:00
Oswald Buddenhagen
d1900941f4
introduce -DC option to only install a crash handler
2013-03-29 16:54:45 +01:00
Oswald Buddenhagen
c23d251092
consider hierarchy delimiter flattening when deciding what to list
...
flattened sub-folders of INBOX actually end up in Path, so list that
instead.
REFMAIL: 6c0ecbff0d025387020281c5d2f5e6e8@smallsys.org
2012-09-16 13:06:07 +02:00
Oswald Buddenhagen
66895f9cce
try harder to list all necessary boxes
...
the pattern "INB*" may or may not refer to something in the INBOX. even
just "*" may. so list both the INBOX and the Path in case of
uncertainty.
2012-09-16 12:34:07 +02:00
Oswald Buddenhagen
f11504aa07
update copyrights
...
make the wrapper's help string also mention copyrights pertaining only
to the actual syncer, as this is the only string many people will ever
see.
2012-09-01 21:15:53 +02:00
Oswald Buddenhagen
d4c786823d
replace FSF address with something more ... contemporary
2012-09-01 21:15:53 +02:00
Oswald Buddenhagen
dfd7516b9a
introduce ability to flatten the hierarchy of Stores
2012-09-01 21:15:52 +02:00
Oswald Buddenhagen
2585dd3324
add support for hierarchical mailboxes
2012-09-01 21:15:18 +02:00
Oswald Buddenhagen
28cccf4b35
fix error handling of invalid SyncState *
...
when we find that the store is incompatible with in-store sync state,
we want to fail the whole channel. however, we must not claim that the
store died, otherwise it won't be disposed of properly.
2012-09-01 21:15:08 +02:00
Oswald Buddenhagen
233f563569
deal with concurrent maildir modifications during listing
...
files may be renamed (due to new -> cur transition or flag changes),
which may lead to two effects if ignored:
- we see both the old and the new name, so we report a spurious
duplicate UID
- we see neither name, so we report a spurious deletion
as countermeasure, record and compare directory modification times. upon
mismatch, we just start over - as usual.
2012-09-01 21:15:07 +02:00
Oswald Buddenhagen
2aae866e80
remove Ontty flag
...
i can't figure out why i added it in the first place. it doesn't seem to
make any sense ...
2012-09-01 21:15:07 +02:00
Oswald Buddenhagen
7867eb9009
add simple mainloop implementation
...
not used so far
2012-09-01 16:03:36 +02:00
Oswald Buddenhagen
b0bbd23512
replace DRV_STORE_BAD with a separate bad_callback()
...
that way we don't have to piggy-back (possibly asynchronous) fatal
errors to particular commands.
internally, the drivers still use synchronous return values as well,
so they don't try to access the invalidated store after calling back.
2012-07-30 01:21:31 +02:00
Oswald Buddenhagen
d2e13f147c
de-duplicate code a bit
2012-07-22 17:27:40 +02:00
Oswald Buddenhagen
c66afdc0a8
move setting of ctx->listed outside the drivers
...
it's essentially an external state flag
2012-07-07 18:00:47 +02:00
Oswald Buddenhagen
4afd31a457
avoid preprocessor warnings on missing features: #if => #ifdef
2011-03-27 12:06:41 +02:00
Oswald Buddenhagen
9e10e871fd
don't hang if store cannot be opened asynchronously
2011-03-27 11:54:48 +02:00
Oswald Buddenhagen
e6a356ffc7
add extra verbose mode which dumps the message contents
...
i needed that to debug the line ending issues. maybe it will find other
uses as well ...
2010-02-06 10:49:57 +01:00
Oswald Buddenhagen
2f62a7f608
don't overlook 2nd and later single-letter options in last argument.
...
reported by fedora
-REF: <1197916586.13945.120.camel@localhost.localdomain>
2008-02-23 09:18:42 +00:00
Oswald Buddenhagen
42ca262e39
#ifdef __linux__ for the crash handler. it compiles on other platforms,
...
but the functionality is bound to linux' /proc structure.
2007-04-04 16:19:47 +00:00
Oswald Buddenhagen
6800f1636e
initialize mvars->t[1] to 1. helps enormously ... :}
2006-12-04 17:47:55 +00:00
Oswald Buddenhagen
8a748d046d
no/empty mailbox name means INBOX
2006-03-21 20:05:48 +00:00
Oswald Buddenhagen
168e5f3282
make the driver model, sync_chans() and sync_boxes() fully async.
...
async drivers to follow ...
2006-03-21 20:03:21 +00:00
Oswald Buddenhagen
b5d70aa596
async merge: aggregate most variables of main() & sync_boxes() in
...
main_vars_t resp. sync_vars_t.
also some minor var renames, whitespace, comments.
2006-03-21 15:53:43 +00:00
Oswald Buddenhagen
f90b290650
split box list preparation from "consumption".
2006-03-21 10:38:30 +00:00
Oswald Buddenhagen
72a2d4b690
info() about opening of stores
2006-03-21 10:30:45 +00:00
Oswald Buddenhagen
3e3cf3ac9a
update copyrights
2006-03-20 20:16:22 +00:00
Oswald Buddenhagen
7f9ece8e7e
move whole responsibility for recycling open stores/server connections
...
to the drivers.
2006-03-20 19:38:20 +00:00
Oswald Buddenhagen
47e592b603
keep the result of driver->list() and a flag whether it is valid in the store.
2006-03-20 19:27:38 +00:00