Commit Graph

985 Commits

Author SHA1 Message Date
Oswald Buddenhagen
f6f2d2461c add comment 2006-05-27 12:44:13 +00:00
Oswald Buddenhagen
21abb22c98 seen messages are eligible for expiration even if they are recent in the
mailbox.
2006-05-27 12:43:03 +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
bdcc285403 unscrew lf=>crlf conversion and tuid insertion 2006-03-21 17:50:57 +00:00
Oswald Buddenhagen
16eaf903db ok, mismerging and not running the reg-tests is lame. unscrew expunging
again.
2006-03-21 17:40:31 +00:00
Oswald Buddenhagen
c7903f8003 don't enter trash loop if not trashing at all. also, move expunge
message where it belongs. not adding info("trashing"), as it will be
replaced in a moment anyway.
2006-03-21 16:03:09 +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
b7389cb36f do not repeatedly get namespace from server. 2006-03-20 20:39:06 +00:00
Oswald Buddenhagen
340bfcc4a8 handle socket() failure and correctly report gethostbyname() failure. 2006-03-20 20:34:32 +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
Oswald Buddenhagen
861dd7468e aggregate all (two ...) drivers in an array instead of naming them in
each (one ...) location explicitly.
2006-03-20 18:36:49 +00:00
Oswald Buddenhagen
492ca8d332 whitespace and code verbosity 2006-03-20 17:21:07 +00:00
Oswald Buddenhagen
31fc41a32c merge imap_t into imap_store_t - there is really no point in having them
separated.
2006-03-20 15:01:48 +00:00
Oswald Buddenhagen
d7126dca5e "fprintf( stderr," => "error(". new functions debugn() and infon()
for messages with missing newline; warn() and error() act upon this.
2006-03-19 11:29:12 +00:00
Oswald Buddenhagen
bb7bbcf5b1 make config parsing more robust against bogus input and report errors
more clearly.
2006-03-19 10:44:53 +00:00
Oswald Buddenhagen
fbbb86738b factor out box selection from sync_boxes to avoid code dupe 2006-02-12 11:42:46 +00:00
Oswald Buddenhagen
bc39f10a1e lock the sync state open the journal before opening the master. this is
a bit ugly for the "SyncState *" case, as we have to create a directory
without making it a maildir right away. however, this makes the code
quite a bit simpler to understand and simpler to parallelize.
2006-02-11 20:28:45 +00:00
Oswald Buddenhagen
7726ce3e0f don't barf at directories with none of {tmp,new,cur}/ and turn them
into maildirs instead. see next commit.
2006-02-11 20:14:31 +00:00
Oswald Buddenhagen
5224b5bc9f don't commit state file when a fatal error occurs 2006-02-11 20:02:06 +00:00
Oswald Buddenhagen
630a04ad3e unbelieveable, but close() can actually fail 2006-02-11 19:52:53 +00:00
Oswald Buddenhagen
d7b8621f05 add copyright + license 2006-02-11 19:48:44 +00:00
Oswald Buddenhagen
1453e61840 update fsf's postal address. i think it's sort of useless nowadays
anyway, but heck ...
2006-02-09 17:44:22 +00:00
Oswald Buddenhagen
4e8fabf7e5 typos 2006-02-05 17:42:22 +00:00
Oswald Buddenhagen
d76c827a45 include run-tests.pl in distribution 2006-02-05 17:38:31 +00:00
Oswald Buddenhagen
e567cc6919 and now don't clobber the mails ... 2006-02-03 23:43:52 +00:00
Oswald Buddenhagen
850addecd5 wrap message storing into transactions. nice side effect: drivers don't
need to deal with line end conversion any move.
2006-02-03 21:33:43 +00:00
Oswald Buddenhagen
19128f1587 major overhaul of flag change propagation and MaxMessages handling:
- wrap message (un)expirations into transactions
- no redundand flag propagations in conjunction with expirations
- better prepared for the upcoming async operation
2006-02-02 17:03:01 +00:00
Oswald Buddenhagen
ab11737b33 crash handler that launches gdb. activated when started with -D option.
simplifies debugging crashes during the reg-tests.
2006-02-02 13:48:02 +00:00
Oswald Buddenhagen
bbc0a877c8 less cluttered debug output 2006-02-02 11:23:57 +00:00
Oswald Buddenhagen
58db1d05ac cosmetics: move around variable declarations and remove obsolete comment 2006-02-02 11:12:30 +00:00
Oswald Buddenhagen
905ded175f versioned journal. the commands and their meanings change all the time,
so better handle that case.
ps: yes, i think not upgrading mbsync between interrupting and resuming
a run is a reasonable requirement.
2006-02-02 11:07:54 +00:00
Oswald Buddenhagen
8728dfdf21 make the sync entry search in the journal replay wrap around at the end
of the list. the "always forward" assumption is violated in some cases.
2006-02-02 10:44:19 +00:00
Oswald Buddenhagen
5e01034aee much improved journal replay testing.
some clenup.
2006-02-02 10:25:07 +00:00
Oswald Buddenhagen
d1c4f8a069 orphan/kill all affected entries after expunge 2006-02-02 10:04:05 +00:00
Oswald Buddenhagen
1a536a3415 M_EXPIRED -> M_EXPIRE 2006-01-30 13:49:46 +00:00
Oswald Buddenhagen
40fc6a6ac8 sanitize S_DEL 2006-01-30 13:11:33 +00:00
Oswald Buddenhagen
e205eb62f5 remove superfluous temporary rflags from sync_boxes 2006-01-30 13:01:35 +00:00
Oswald Buddenhagen
c7d938f965 now that messages know their sync records, M_SYNCES is superfluous. 2006-01-30 11:12:14 +00:00
Oswald Buddenhagen
2277ecefb6 establish bi-directional mapping between mails and sync records. use it
to merge the --renew case into the --new case.
2006-01-30 10:26:04 +00:00
Oswald Buddenhagen
24910e2cdf declaring ex[M] instead of ex[2] is, indeed, no good. long live watchpoints. 2006-01-30 09:33:29 +00:00
Oswald Buddenhagen
a41ea8f9f1 whoops - 'isync -w' would write .mbsyncrc to a wrong directory 2006-01-29 18:40:27 +00:00
Oswald Buddenhagen
c1c7cb6d8e move fetching new messages in front of syncing old entries. this alone
does not buy us a whole lot ...
2006-01-29 15:52:49 +00:00
Oswald Buddenhagen
635b2d7b76 test for journalling and journal replay. 2006-01-29 15:48:24 +00:00
Oswald Buddenhagen
9c6c158ef3 undocumented flag -J to skip committing the new sync state. 2006-01-29 15:46:09 +00:00
Oswald Buddenhagen
a1a5a817bb merge Quiet, Verbose & Debug into DFlags 2006-01-29 14:46:16 +00:00
Oswald Buddenhagen
185769640b M_NOT_SYNCED => M_SYNCED. now that sync records know their messages, it
is simpler to track the positive case.
2006-01-29 11:49:49 +00:00
Oswald Buddenhagen
f4ce961bab move driver options composition below journal replay - it might make
additional actions necessary (it doesn't, yet).
2006-01-29 11:35:22 +00:00
Oswald Buddenhagen
a1c402678c split driver->prepare into ->prepare_opts and ->prepare_paths 2006-01-29 11:22:45 +00:00
Oswald Buddenhagen
4e983506d3 #include limits.h (for INT_MAX)
REF: <a8e45e1b0601241753j1e14cc1cm3fc3c65c7acb0c1b@mail.gmail.com>
2006-01-25 06:35:19 +00:00
Oswald Buddenhagen
1a6ee00d86 less confusing uid ranges in debug 2006-01-13 16:10:42 +00:00
Oswald Buddenhagen
d414d0aae2 solaris 10 fix: use sys/filio.h for FIONREAD. untested.
REF: <20060111215014.GA601@49.180.97-84.rev.gaoland.net>
2006-01-12 06:36:44 +00:00
Oswald Buddenhagen
8b6ac97fe4 adjust to: omit flags other than "deleted" when expunging target. 2006-01-08 19:25:58 +00:00
Oswald Buddenhagen
3c8ee66bfc collect stderr as well. 2006-01-03 09:28:02 +00:00
Oswald Buddenhagen
f6ed69a8d3 don't record we synced flags if we didn't. 2005-12-29 13:08:27 +00:00
Oswald Buddenhagen
2fa54425e7 have to flush debug as well ... 2005-12-28 20:45:01 +00:00
Oswald Buddenhagen
76de0182a2 of course F_DELETED will have been added to expired slave messages, so
don't complain about it.
2005-12-28 20:05:53 +00:00
Oswald Buddenhagen
8c30ec4a25 put message references into the sync records. match up the uids after
opening the boxes instead of "sort-of-on-demand" - this is much simpler.
match from messages to sync records, not the other way round - makes the
debug output shorter, as the separate dump_box() is gone now.
2005-12-28 19:17:40 +00:00
Oswald Buddenhagen
61dfbea617 "reformat" S_EXP_S setting logic for understandability. 2005-12-28 19:10:12 +00:00
Oswald Buddenhagen
808001c0a9 whoops 2005-12-28 11:07:47 +00:00
Oswald Buddenhagen
4ec56f8cf6 - instead of having {m,s}foo, we have foo[2] now, so we can do
everything with loops instead of symmetric function calls
- added some const
2005-12-28 10:02:22 +00:00
Oswald Buddenhagen
f070f3cd72 show debug output on error. 2005-12-27 17:44:31 +00:00
Oswald Buddenhagen
d68dd7369e make the error case output more useful by dumping the entire data set. 2005-12-27 17:31:04 +00:00
Oswald Buddenhagen
549c1cf13e fix error message 2005-12-26 16:02:50 +00:00
Oswald Buddenhagen
716ff82540 add expiration tests 2005-12-26 16:02:08 +00:00
Oswald Buddenhagen
ad5f5aa2b2 add MaxSize tests 2005-12-26 16:01:42 +00:00
Oswald Buddenhagen
ab898f2f5c when dumping mailboxes, sort by uid 1st. 2005-12-26 16:00:04 +00:00
Oswald Buddenhagen
d3faf0d27f detect excess messages after sync 2005-12-26 15:58:12 +00:00
Oswald Buddenhagen
924e1a7f04 sync state reader:
- grok negative uids
- more robust
2005-12-26 15:57:06 +00:00
Oswald Buddenhagen
963f607c81 don't eat array lead-in on empty arrays 2005-12-26 15:54:09 +00:00
Oswald Buddenhagen
4dc23fee7b why would somebody manipulate an expired message? right, he wouldn't:
he would either expunge the mailbox or configure his MUA to hide trashed
messages. consequently don't sync expired message flags, let alone
interpret them in a special way.
one special feature remains, though: if a non-expunged expired message
is flagged on the master, it will be unexpired on the slave. i'm not
sure whether i should remove or document this feature.
2005-12-26 15:02:38 +00:00
Oswald Buddenhagen
9740e7e852 message tweaks 2005-12-26 14:55:19 +00:00
Oswald Buddenhagen
d5a1f5876d more logical order 2005-12-23 10:22:47 +00:00
Oswald Buddenhagen
044d8dfb73 add some regression testing. 2005-12-22 18:06:25 +00:00
Oswald Buddenhagen
5633236ed2 fix sync entries not being purged due to c&p error. 2005-12-22 14:59:59 +00:00
Oswald Buddenhagen
8db5ec1e5e less confusing error message on invalid mailbox. 2005-12-21 13:04:43 +00:00
Oswald Buddenhagen
6d229848a5 it's beyond me what this memset was supposed to do ... 2005-12-18 14:10:40 +00:00
Oswald Buddenhagen
633869d040 trailing whitespace 2005-12-18 13:41:50 +00:00
Oswald Buddenhagen
25db6a3c31 revert 1.8 - what was i smoking?! the CREATE argument is already quoted;
we just extracted it from the previous command.
2005-12-17 13:47:51 +00:00
Oswald Buddenhagen
7710b3dcb5 make flag changes unset "new" status - unless a ghost is acting in the
background, a flag change indicates that the message was at least
noticed.
2005-09-29 21:07:20 +00:00
Oswald Buddenhagen
bf26a663da don't call the driver's set_flags() if the flags did not change at all. 2005-09-29 21:05:05 +00:00
Oswald Buddenhagen
d2753c4188 64-bit cleanness 2005-09-21 16:14:05 +00:00
Oswald Buddenhagen
bf4266eadc quote CREATE argument 2005-03-28 10:43:31 +00:00
Oswald Buddenhagen
02babb0651 fix inverted condition leading to endless loop when message is changed
while isync is running.
2005-03-28 10:26:39 +00:00
Oswald Buddenhagen
c2209c8470 cope with out-of-disk-space halfways gracefully (that is, don't clobber
the sync state including the journal, but exit immediately).
2004-11-13 09:19:36 +00:00
Oswald Buddenhagen
e8c769ea76 ignore user-defined flags (for now).
also, split off the backslash from the "core" flag names.
2004-10-17 15:34:53 +00:00
Oswald Buddenhagen
e75ebf75f6 fix segfault due to wrong pointer being passed to parse_response_code.
inspired by Raimar Döffinger
2004-10-17 09:00:15 +00:00
Oswald Buddenhagen
6741bc94d9 remove spurious crlf during cram auth. not sure that this instance of
socket_write should be (re)moved, but as long as the .cont callback is
used only for this ...
investigation & patch by Mike Delaney.
2004-10-17 08:30:02 +00:00
Oswald Buddenhagen
3f8e820acb use legacy flock() only on linux. at least on OS X flock aliases to
fcntl.
2004-09-20 11:31:55 +00:00
Oswald Buddenhagen
e0cc45044f stdarg.h at the right places 2004-09-20 11:28:33 +00:00
Oswald Buddenhagen
16de402c9e when storing \seen messages, don't set the \recent flag on them. could
well be that this is incorrect, but some mailers need it that way.
when trashing messages, preserve their \recent status as well.
2004-09-15 09:06:36 +00:00
Oswald Buddenhagen
af0b75a5dc stddef.h for offsetof 2004-09-08 16:14:12 +00:00
Oswald Buddenhagen
86d9a3140d first check _both_ bounds, then compare ... 2004-09-08 14:52:22 +00:00
Oswald Buddenhagen
acabdc43b1 print name of mailbox being opened. 2004-09-07 11:59:51 +00:00
Oswald Buddenhagen
1b75236135 fix -C for imap mailboxes:
- SELECT does not return [TRYCREATE]
- fix bit field truncation
2004-08-13 11:03:12 +00:00
Oswald Buddenhagen
b8b4628197 store new UIDVALIDITY immediately after initializing it 2004-05-23 16:39:24 +00:00
Oswald Buddenhagen
918e105b0c old -l is new -l -C 2004-04-27 20:23:22 +00:00
Oswald Buddenhagen
789d5864ca full support for absolute paths in Mailboxes 2004-04-26 14:48:48 +00:00
Oswald Buddenhagen
7ff8eef06c strip $HOME and ~ from Mailbox paths 2004-04-26 14:09:46 +00:00
Oswald Buddenhagen
2e8181a8d8 fix return values of asprintf replacement. 2004-03-29 22:32:40 +00:00
Oswald Buddenhagen
af8c4396fe unscrew --delete by merging it into the config file. merge --expunge as
well for symmetry.
2004-03-29 06:52:50 +00:00
Oswald Buddenhagen
130664b622 The Big Rewrite. too many change to list them all.
as opposed to earlier threats, BerkDB was not entirely dropped; i
suppose the isync 0.7 -> 0.8 change had a reason, so i added an
alternative UID storage scheme.
note that BDB 4.0 is not sufficient, as the db->open function changed in
an incompatible way ...

i updated the debian packaging except for a changelog entry.
note that i removed the upgrade blurb, as upstream now has a smooth
upgrade path down to at least isync 0.4.
2004-03-27 16:07:20 +00:00
Oswald Buddenhagen
5bbe51ee46 portability: don't rely on struct flock layout 2004-02-07 15:36:33 +00:00
Oswald Buddenhagen
e5894bdf04 once again: (slightly) better output.
make maildir flag setting failure non-fatal. maildir sucks ...
2004-02-01 16:27:28 +00:00
Oswald Buddenhagen
a52fd7dde0 more sophisticated CAPABILITY handling. also, don't issue the command if
the initial response already had it in the status code.
2004-01-31 01:01:07 +00:00
Oswald Buddenhagen
3e392b6aa2 don't ask for NAMESPACE if Folder was specified 2004-01-30 23:39:39 +00:00
Oswald Buddenhagen
c2c4490431 following the "screw murphy" principle and commiting untested patch:
obey LOGINDISABLED
2004-01-30 23:35:50 +00:00
Oswald Buddenhagen
0e8455fde1 PREAUTH cannot come out of the blue 2004-01-27 21:01:15 +00:00
Oswald Buddenhagen
a7775798e3 cleanup around parse_fetch 2004-01-27 20:58:54 +00:00
Oswald Buddenhagen
f80f91d98b make Tag int, move it to imap.c 2004-01-27 20:50:49 +00:00
Oswald Buddenhagen
1eb6e35c80 don't use STARTTLS for PREAUTH connections. uw-imap doesn't seem to like
it, and it does not make too much sense anyway - i think - state converse
opinions now.
2004-01-20 01:55:15 +00:00
Oswald Buddenhagen
b5307f0e16 another message output cleanup, still not perfect (info messages will be
interleaved with progress dots).
support specifying -q twice to suppress warnings as well.
2004-01-18 02:22:17 +00:00
Theodore Ts'o
0121220339 Optimized isync by not fetching the sizes of messages if they are
unneeded (i.e., if MaxSize is not specified in the config file).

Patch and idea originally from Nicolas Boullis <nboullis@debian.org>,
modified/polished by Theodore Ts'o per comments by Oswald Buddenhagen.
2004-01-12 01:24:47 +00:00
Oswald Buddenhagen
180f5fa201 sync uid database after every message. this is accompanied by a dbm ->
db4 migration. patch by theodore, with some final polishing by me.
2004-01-12 00:52:14 +00:00
Oswald Buddenhagen
3de16206e7 ignore anything that does not look remotely like a maildir when
collecting mailboxes for OneToOne.
2004-01-09 20:43:36 +00:00
Oswald Buddenhagen
52fb7c085d add trailing space to password prompt 2003-12-07 15:36:38 +00:00
Oswald Buddenhagen
424db34ff2 make imaps: on the command line adjust the port and ssl options as well 2003-12-07 15:34:54 +00:00
Oswald Buddenhagen
228ba6b48b echo the mailbox the password is for 2003-12-02 02:53:14 +00:00
Oswald Buddenhagen
dae086c92f fix crash when syncing multiple mailboxes over a Tunnel 2003-07-02 17:18:48 +00:00
Oswald Buddenhagen
b535af4fc4 - make it work without SSL
- switch from -Ds in Makefile to config.h
- small header cleaup
2003-05-07 00:06:37 +00:00
Oswald Buddenhagen
28e240a36b don't free any config strings - who cares for a few bytes?
this fixes some crashes at exit.
2003-05-05 17:58:28 +00:00
Oswald Buddenhagen
38d46cc03e accumulate status over multiple mailboxes, i.e., don't abort after first
failure
2003-05-05 13:24:03 +00:00
Oswald Buddenhagen
feee93c26d fix imaps: 2003-05-05 12:54:38 +00:00
Oswald Buddenhagen
8fa6cd3346 ignore \Recent, as it is voided by the syncronization run itself. 2003-02-27 18:43:16 +00:00
Oswald Buddenhagen
6f2550117a - update copyrights. 2003 didn't begin yet, but who cares? :) 2002-12-28 15:31:20 +00:00
Oswald Buddenhagen
a4f2725bad - update isyncmaxuid properly 2002-12-28 04:12:07 +00:00
Oswald Buddenhagen
2012aadc5b - fixed two crashes 2002-12-28 04:04:54 +00:00
Oswald Buddenhagen
3327572fd2 - handle bogus search responses more gracefully 2002-12-28 04:02:23 +00:00
Oswald Buddenhagen
39446bbef9 - workaround imap server bug: lock files are no mailboxes 2002-12-28 04:00:23 +00:00
Oswald Buddenhagen
095e3ec92c - improve console output 2002-12-28 03:58:01 +00:00
Oswald Buddenhagen
b10718cf20 - took over maintenance
- moved to sourceforge
- reorganized cvs structure
2002-12-28 03:05:43 +00:00