Commit Graph

68 Commits

Author SHA1 Message Date
Oswald Buddenhagen
9554026443 make drv->cancel()'s callback have no status code
this function is not going to actually execute any commands, so it
makes no sense for the callback to have a status code.
2012-07-29 12:25:24 +02:00
Oswald Buddenhagen
57444e9df9 don't decode aux pointer on DRV_CANCELED
the aux data was already free()d by the error callback by the time we
get this status code.
2012-07-22 20:19:20 +02:00
Oswald Buddenhagen
7bab2d6d94 de-duplicate error paths
makes the code more compact. yay for gotos.
2012-07-07 18:00:47 +02:00
Oswald Buddenhagen
61d98c5a1d fix a bunch of warnings 2012-07-07 18:00:47 +02:00
Oswald Buddenhagen
058d01f179 don't compare find_old_done with find_new_total
this didn't have any effect as no async drivers currently exist.
2011-03-27 11:54:48 +02:00
Oswald Buddenhagen
296ac0364c add CR after TUID during LF => CRLF conversion 2011-03-27 11:54:02 +02:00
Oswald Buddenhagen
8df1ebaf40 fix (another) out-of-bounds access in CRLF conversion
if the header contained no CRs but the body (or the post-TUID part of
the header) did, the TUID insertion would add an excess CR, thus
overflowing the buffer by one byte.
2011-03-27 11:54:02 +02:00
Oswald Buddenhagen
d94dadbaeb fix line ending conversion logic
imap may very well store messages with LF line endings. only RFC2822
requires CRLF.
consequently, preserve the line endings as much as possible unless the
mailbox format does not support it (this would be the case for unix mbox
- i actually have no idea about maildir).
2010-02-06 10:49:57 +01:00
Oswald Buddenhagen
09dfddb36b some more error reporting relating malformed messages 2010-02-06 10:49:06 +01:00
Oswald Buddenhagen
92914b37cc deal with UIDVALIDITY of 0 properly.
-REF: 20080822094543.GA3528@ugly.local
2008-08-23 07:54:00 +00:00
Oswald Buddenhagen
023d3ee577 fix error paths wrt sync drivers 2006-12-09 10:39:30 +00:00
Oswald Buddenhagen
9b657a46a0 fix bug in newline conversion causing buffer overflows.
this leads to segfaults and has some security impact.
2006-08-10 07:01:02 +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
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
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
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
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
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
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
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
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
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
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
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
1a6ee00d86 less confusing uid ranges in debug 2006-01-13 16:10:42 +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
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