13 years agoRemove tried_at. v3.0.2
Abhijit Menon-Sen [Tue, 14 Oct 2008 11:04:56 +0000 (16:34 +0530)]
Remove tried_at.

13 years agoUpdate version.
Abhijit Menon-Sen [Tue, 14 Oct 2008 04:47:46 +0000 (10:17 +0530)]
Update version.

13 years agosubtransaction errors aren't.
Arnt Gulbrandsen [Mon, 13 Oct 2008 11:23:37 +0000 (13:23 +0200)]
subtransaction errors aren't.

subtransactions fail all the time and all that happens is that we ROLLBACK
TO SAVEPOINT and go on from there. no sense in logging an error.

13 years agoRevert "send NIL for message data we don't have" and friends.
Abhijit Menon-Sen [Mon, 13 Oct 2008 12:34:09 +0000 (18:04 +0530)]
Revert "send NIL for message data we don't have" and friends.

13 years agodon't eat quite so much CPU updating unchanged mailboxes.
Arnt Gulbrandsen [Thu, 2 Oct 2008 19:27:16 +0000 (21:27 +0200)]
don't eat quite so much CPU updating unchanged mailboxes.

two more changes for the future:
1. use the mailboxes.change number suggested in the source
2. use a patricia tree based on full name instead of the child/sibling
   structure (which melts down when a single mailbox has tens of thousands
   of direct children).

13 years agodon't run more than one mailboxreader per 2-3 second period, and don't run
Arnt Gulbrandsen [Mon, 29 Sep 2008 13:09:27 +0000 (15:09 +0200)]
don't run more than one mailboxreader per 2-3 second period, and don't run
more than one at a time.

if the mailboxreader is clogging up pgsql, this should help greatly.

13 years agocompile
Arnt Gulbrandsen [Mon, 22 Sep 2008 19:39:10 +0000 (21:39 +0200)]

13 years agodon't bother updating the mailbox tree if we're shutting down already.
Arnt Gulbrandsen [Mon, 22 Sep 2008 19:29:56 +0000 (21:29 +0200)]
don't bother updating the mailbox tree if we're shutting down already.


13 years agofix selecting newly created views.
Arnt Gulbrandsen [Fri, 10 Oct 2008 12:30:46 +0000 (14:30 +0200)]
fix selecting newly created views.

not one, but several typos prevented selecting a newly created view from
working. also some generic cleanup, done while I was digging around in the
code. maybe some of it is unnecessary or irrelevant, I didn't check.

13 years agoaox show search address asdf@asdf did not produce the right result. fix.
Arnt Gulbrandsen [Fri, 10 Oct 2008 09:04:08 +0000 (11:04 +0200)]
aox show search address asdf@asdf did not produce the right result. fix.

three changes:

1. the parser produced a suboptimal tree.

2. the display logic didn't work for Or.

3. added command line option -s to show the SQL as well, since I needed
   that to verify that the search was correct. undocumented for now, since
   it's a little shady.

13 years agomake tests for absent header fields work
Arnt Gulbrandsen [Thu, 9 Oct 2008 14:00:16 +0000 (16:00 +0200)]
make tests for absent header fields work

ie. 'messages which do not have header field x'

13 years agoallow upper case in aox add user etc.
Arnt Gulbrandsen [Fri, 3 Oct 2008 06:26:07 +0000 (08:26 +0200)]
allow upper case in aox add user etc.

13 years agothe dm_mm index may exist already when upgrade schema is run.
Arnt Gulbrandsen [Wed, 1 Oct 2008 19:37:03 +0000 (21:37 +0200)]
the dm_mm index may exist already when upgrade schema is run.

I chose to do it this way (create unless exists) because the three
alternatives seemed worse:

- requiring aox tune database after upgrade schema would suck
- automatically tuning would require that we store the desired tuning,
  which makes it hard for people to tune by hand
- we could support hand-tuning if we tried to classify the running
  database at upgrade schema time and adjusted the tuning in about the
  right way, but that task is MUCH too vague for me

13 years agoonly unblock imap commands if what we did (might) make a difference
Arnt Gulbrandsen [Wed, 1 Oct 2008 08:39:56 +0000 (10:39 +0200)]
only unblock imap commands if what we did (might) make a difference

this unfucks select, which is really rather fucked all by itself, but not
so much that we can permit it to be broken.

13 years agodetect whether the message is there, take 5,
Arnt Gulbrandsen [Tue, 30 Sep 2008 12:42:33 +0000 (14:42 +0200)]
detect whether the message is there, take 5,

test for header fields if we know those. test for bodies if we know those.
one or the other has to hit in every important case.

13 years agotake 4, or so. if the header contains NO fields, then the message isn't
Arnt Gulbrandsen [Tue, 30 Sep 2008 12:37:53 +0000 (14:37 +0200)]
take 4, or so. if the header contains NO fields, then the message isn't

just looking for From wasn't enough, since we may have retrieved
header_fields rows but not address_fields ones. This test should be... no,
it shouldn't be better. We might have retrieved bodyparys, but nothing

OK, take 5 coming.

13 years agooops. just oops.
Arnt Gulbrandsen [Tue, 30 Sep 2008 12:36:48 +0000 (14:36 +0200)]
oops. just oops.

13 years agobest to make one delivery attempt after expired_at, just in case expired_at
Arnt Gulbrandsen [Tue, 30 Sep 2008 09:39:27 +0000 (11:39 +0200)]
best to make one delivery attempt after expired_at, just in case expired_at
passed while the server was down and the admin was fixing something.

13 years agokeep sessions half-alive until the end of the commands that use them.
Arnt Gulbrandsen [Mon, 29 Sep 2008 13:22:55 +0000 (15:22 +0200)]
keep sessions half-alive until the end of the commands that use them.

this will not lead to bad IMAP, because ImapSession checks the active
Session before sending the response. the only effect is that commands are
permitted to run to completion more often, e.g. when someone sends FETCH
and immediately LOGOUT.

13 years agomove OK [CLOSED] to where it'll be sent whenever needed
Arnt Gulbrandsen [Fri, 26 Sep 2008 16:11:25 +0000 (18:11 +0200)]
move OK [CLOSED] to where it'll be sent whenever needed

13 years agowe can send NIL for a message's various bits if the message has no From.
Arnt Gulbrandsen [Fri, 26 Sep 2008 15:06:23 +0000 (17:06 +0200)]
we can send NIL for a message's various bits if the message has no From.
all unexpunged messages have From.

13 years agoa better try at sending NIL at just the right times; still not quite good
Arnt Gulbrandsen [Fri, 26 Sep 2008 14:53:40 +0000 (16:53 +0200)]
a better try at sending NIL at just the right times; still not quite good

13 years agoif we expunge a message, then we won't be able to emit any news about its
Arnt Gulbrandsen [Fri, 26 Sep 2008 14:39:03 +0000 (16:39 +0200)]
if we expunge a message, then we won't be able to emit any news about its
possible recent flag changes.

13 years agooops, a syntax bug
Arnt Gulbrandsen [Fri, 26 Sep 2008 14:04:03 +0000 (16:04 +0200)]
oops, a syntax bug

13 years agodoc update
Arnt Gulbrandsen [Fri, 26 Sep 2008 13:59:10 +0000 (15:59 +0200)]
doc update

13 years agoa sprinking of paranoia
Arnt Gulbrandsen [Fri, 26 Sep 2008 13:57:52 +0000 (15:57 +0200)]
a sprinking of paranoia

13 years agosend the (modseq) appendage on the SEARCH response if so directed.
Arnt Gulbrandsen [Fri, 26 Sep 2008 13:42:34 +0000 (15:42 +0200)]
send the (modseq) appendage on the SEARCH response if so directed.

accidentally broke this week.

13 years agoexists/recent/uidnext responses are like all others: once sent they've
Arnt Gulbrandsen [Fri, 26 Sep 2008 13:29:04 +0000 (15:29 +0200)]
exists/recent/uidnext responses are like all others: once sent they've
been sent.

this fixes an actual bug in my 1200-line diff from last friday. oh no.

13 years agoteach pop select to work without Session::refresh().
Arnt Gulbrandsen [Fri, 26 Sep 2008 13:15:20 +0000 (15:15 +0200)]
teach pop select to work without Session::refresh().

13 years agothat's rather unusual code, needs to be explained
Arnt Gulbrandsen [Fri, 26 Sep 2008 12:37:56 +0000 (14:37 +0200)]
that's rather unusual code, needs to be explained

13 years agoUnbreak select, which was moderately broken.
Arnt Gulbrandsen [Fri, 26 Sep 2008 12:29:58 +0000 (14:29 +0200)]
Unbreak select, which was moderately broken.

Select used to depend on various moderate breakage in session. session now
uses a new saner approach to sending responses, which apparently took
select by surprise.

In detail:

1. Remove Session::refresh(). Session::emitUpdates() now calls
   IMAP::runCommands(), so refresh() makes no sense for IMAP. (This might
   cause some breakage for POP though, when a nonempty mailbox is opened,
   we'll have to look at that.)

2. Remove callers to refresh(), including Select, which happily no longer
   needed to call it at all, thanks to ImapResponse.

3. Remove some dead code in select.cpp.

13 years agosend NIL for message data we don't have
Arnt Gulbrandsen [Fri, 26 Sep 2008 08:47:07 +0000 (10:47 +0200)]
send NIL for message data we don't have

this is kind of dubious, but I think it's OK. dovecot and cyrus do it, so
who cares about the RFC? ;)

13 years agoa one-day timeout for idle, instead of half an hour or three hours.
Arnt Gulbrandsen [Fri, 26 Sep 2008 08:31:06 +0000 (10:31 +0200)]
a one-day timeout for idle, instead of half an hour or three hours.

outlook remains broken. any timeout shorter than the interval between two
incoming messages will cause breakage with outlook, and a three-hour lull
is easily conceivable.

a 24-hour timeout still lets us flush brokenly broken connections.

13 years agoanother try: make sure DA doesn't lose its space in the SC queue as long
Arnt Gulbrandsen [Thu, 25 Sep 2008 11:05:37 +0000 (13:05 +0200)]
another try: make sure DA doesn't lose its space in the SC queue as long
as it's in the SM list.

the previous try recursed, this one should not.

13 years agolog more.
Arnt Gulbrandsen [Wed, 24 Sep 2008 14:05:01 +0000 (16:05 +0200)]
log more.

logging is good.

13 years agotry to send responses when we have some, just in case we're in idle mode
Arnt Gulbrandsen [Wed, 24 Sep 2008 12:58:45 +0000 (14:58 +0200)]
try to send responses when we have some, just in case we're in idle mode

13 years agokeep mail spooled for delivery for two weeks rather than two days.
Arnt Gulbrandsen [Wed, 24 Sep 2008 12:43:30 +0000 (14:43 +0200)]
keep mail spooled for delivery for two weeks rather than two days.

13 years agorecord the software version in Received, since other software does.
Arnt Gulbrandsen [Wed, 24 Sep 2008 12:18:38 +0000 (14:18 +0200)]
record the software version in Received, since other software does.

13 years agoMake sure we pick the next client off the list as soon as we're available,
Arnt Gulbrandsen [Wed, 24 Sep 2008 12:10:02 +0000 (14:10 +0200)]
Make sure we pick the next client off the list as soon as we're available,
and don't let a single client occur more than once in the list.

13 years agoSeparate the spool manager and the smtp client.
Arnt Gulbrandsen [Wed, 24 Sep 2008 11:48:40 +0000 (13:48 +0200)]
Separate the spool manager and the smtp client.

In the words of RFC 1925:

(5) It is always possible to aglutenate multiple separate problems into a
    single complex interdependent solution. In most cases this is a bad

SmtpClient now manages the connections to the smarthost, and SpoolManager
now manages the spool. The SpoolManager does not get confused if the state
of the spool and that of the smarthost get out of sync. All the code looks
cleaner, IMO, and it's more robust when the smarthost behaves oddly.

The details (somewhat interwoven, so separate commits wasn't possible.)

1. SmtpClient now maintains a queue of EventHandlers wanting attention,
   and an SmtpClient has only one owner. There can be more than one
   SmtpClient: One more is created if no request has been serviced in the
   past seven seconds.

2. Whenever an SmtpClient send()s mail, it gets a new Log ID based on its
   new owner.

3. The SmtpClient keeps track of whether it has sent mail, and the
   DeliveryAgent only shuts down the spool if mail was sent, but the
   database could not be updated accordingly. (Axel Rau is right, we
   shouldn't shut down services.)

4. The DeliveryAgent now starts by locking a message against concurrent
   transmission, then requests or waits for an SmtpClient, then sends

5. The SpoolManager doesn't manage the SmtpClient any more. It just makes
   DeliveryAgents and lets them fend for themselves.

6. The SpoolManager takes some care to create only one DeliveryAgent for a
   particular message at a time. This isn't strictly necessary, but it
   helps reduce the number of concurrent transactions.

7. The SpoolManager doesn't start all DeliveryAgents at the same time.
   Instead, it starts them at one-second intervals. This should help avoid
   transaction contention. Otherwise, servicing a hundred-message backlock
   would create a hundred simultaneous transactions, locking up all the
   backends for a while.

8. The SpoolManager does know about the SmtpClient class in general, but
   only so that it can log better.

13 years agomake it possible to create a Log as child of another Log (easily)
Arnt Gulbrandsen [Wed, 24 Sep 2008 11:47:43 +0000 (13:47 +0200)]
make it possible to create a Log as child of another Log (easily)

13 years agosend recent when we need it, not when we don't
Arnt Gulbrandsen [Tue, 23 Sep 2008 16:19:52 +0000 (18:19 +0200)]
send recent when we need it, not when we don't

13 years agoouch
Arnt Gulbrandsen [Tue, 23 Sep 2008 15:07:52 +0000 (17:07 +0200)]

13 years agoneed to send those first EXISTS responses...
Arnt Gulbrandsen [Tue, 23 Sep 2008 15:01:57 +0000 (17:01 +0200)]
need to send those first EXISTS responses...

13 years agoupdate aox show queue to cope with schema 76
Arnt Gulbrandsen [Tue, 23 Sep 2008 14:53:42 +0000 (16:53 +0200)]
update aox show queue to cope with schema 76

13 years agoif the smtp client can't send now, we might as well give up at once.
Arnt Gulbrandsen [Tue, 23 Sep 2008 14:17:05 +0000 (16:17 +0200)]
if the smtp client can't send now, we might as well give up at once.

in this case the code doesn't set last_attempt, it just gives up. spool
manager will try again in whatever little while seems correct, and this
message can be tried again then.

13 years agothe smtpclient is ready to send a dsn as soon as it's created, not only
Arnt Gulbrandsen [Tue, 23 Sep 2008 14:14:49 +0000 (16:14 +0200)]
the smtpclient is ready to send a dsn as soon as it's created, not only
after receiving hello. this is a policy matter. there can be errors while
it opens the connection, but that's okay, it handles errors.

now that it can start sending in no less than four states, it's not okay
to just set the state any more.

13 years agomake sure we never emit an EXISTS value which includes messages we haven't
Arnt Gulbrandsen [Tue, 23 Sep 2008 11:31:39 +0000 (13:31 +0200)]
make sure we never emit an EXISTS value which includes messages we haven't
been able to expunge, or doesn't include messages we have been able to

ditto recent/uidnext.

highestmodseq would be easy to do in the same manner.

13 years agomake sure we send another EXISTS when a message is expunged and another
Arnt Gulbrandsen [Tue, 23 Sep 2008 10:22:30 +0000 (12:22 +0200)]
make sure we send another EXISTS when a message is expunged and another
then added.

13 years agomake deliver check explicitly whether the message was injected, and set
Arnt Gulbrandsen [Tue, 23 Sep 2008 10:06:36 +0000 (12:06 +0200)]
make deliver check explicitly whether the message was injected, and set
its exit code ONLY according to that.

errors don't matter as long as the message is injected.

13 years agomake deliver -v give explicit feedback about the chosen UID
Arnt Gulbrandsen [Tue, 23 Sep 2008 09:18:17 +0000 (11:18 +0200)]
make deliver -v give explicit feedback about the chosen UID

13 years agoif the db shuts down in the middle of a subtransaction, it ought to be
Arnt Gulbrandsen [Tue, 23 Sep 2008 09:16:57 +0000 (11:16 +0200)]
if the db shuts down in the middle of a subtransaction, it ought to be
enough to tell the subtransaction. but let's tell the parent(s) too. it
won't hurt.

13 years agohave stderrlogger exit with EX_UNAVAILABLE instead of 1, just in case
Arnt Gulbrandsen [Tue, 23 Sep 2008 09:05:27 +0000 (11:05 +0200)]
have stderrlogger exit with EX_UNAVAILABLE instead of 1, just in case
someone treats unknonwn result codes as success.

EX_UNAVAILABLE is supposed to cover a generic "something went wrong, don't
know what", which seems fitting.

13 years agoDon't complain if the MailboxReader is shutdown.
Abhijit Menon-Sen [Tue, 23 Sep 2008 03:10:05 +0000 (08:40 +0530)]
Don't complain if the MailboxReader is shutdown.

13 years agoif the pg server runs out of RAM, we can't do much... but we can perhaps
Arnt Gulbrandsen [Mon, 22 Sep 2008 10:18:01 +0000 (12:18 +0200)]
if the pg server runs out of RAM, we can't do much... but we can perhaps
reconfigure ourselves to be slower and cause less load on pg

13 years agoQuiesce udoc.
Abhijit Menon-Sen [Tue, 23 Sep 2008 02:55:23 +0000 (08:25 +0530)]
Quiesce udoc.

13 years agoa virtual constructor to silence gcc
Arnt Gulbrandsen [Mon, 22 Sep 2008 19:20:20 +0000 (21:20 +0200)]
a virtual constructor to silence gcc

13 years agoSORT too needed a special response class.
Arnt Gulbrandsen [Mon, 22 Sep 2008 11:06:45 +0000 (13:06 +0200)]
SORT too needed a special response class.

13 years agodoc
Arnt Gulbrandsen [Mon, 22 Sep 2008 11:06:22 +0000 (13:06 +0200)]

13 years agonew class ImapSearchResponse, to make sure we don't send obsolete MSNs
Arnt Gulbrandsen [Mon, 22 Sep 2008 10:54:22 +0000 (12:54 +0200)]
new class ImapSearchResponse, to make sure we don't send obsolete MSNs

13 years agoIf ImapResponse::text() returns "" that means "don't send this", so don't.
Arnt Gulbrandsen [Fri, 19 Sep 2008 13:15:19 +0000 (15:15 +0200)]
If ImapResponse::text() returns "" that means "don't send this", so don't.

13 years agoadd a new class explicitly modelling IMAP responses, and use it here and
Arnt Gulbrandsen [Fri, 19 Sep 2008 12:50:51 +0000 (14:50 +0200)]
add a new class explicitly modelling IMAP responses, and use it here and

the new class permits us to update a session's MSN-UID map exactly when we
change it, and reference it exactly when we send an MSN. MSN errors should
be a thing of the past.

MILDLY tested.

13 years agoUpdate client-type list.
Abhijit Menon-Sen [Thu, 25 Sep 2008 10:29:34 +0000 (15:59 +0530)]
Update client-type list.

13 years agosegfaults are no fun and this one could happen if the client abruptly
Arnt Gulbrandsen [Mon, 22 Sep 2008 19:54:27 +0000 (21:54 +0200)]
segfaults are no fun and this one could happen if the client abruptly
closes the connection

13 years agobetter not try to add an int to a string.
Arnt Gulbrandsen [Mon, 22 Sep 2008 19:38:00 +0000 (21:38 +0200)]
better not try to add an int to a string.

I think we ought to block this via a private operator in string.h.

13 years agoCan't delete from threads before thread_members.
Abhijit Menon-Sen [Sun, 21 Sep 2008 12:52:54 +0000 (18:22 +0530)]
Can't delete from threads before thread_members.

aox: update or delete on "threads" violates foreign key constraint "thread_members_thread_fkey" on "thread_members"

13 years agoSchema #76: minor cleanups.
Abhijit Menon-Sen [Thu, 18 Sep 2008 06:00:11 +0000 (11:30 +0530)]
Schema #76: minor cleanups.

This means both the new threading code and the new spoolmanager code
must go into 2.12, which I think is fine.

13 years agobe more careful about what looks like a boundary line and may need qping
Arnt Gulbrandsen [Wed, 17 Sep 2008 19:23:29 +0000 (21:23 +0200)]
be more careful about what looks like a boundary line and may need qping

this should prevent '---- BEGIN PGP BLAH ----' from matching, which is
good, because a certain (inexplicably) well-regarded mail client can't
handle qp'd PGP messages.

13 years agoaccept literals as SASL responses. makes aox almost work with
Arnt Gulbrandsen [Wed, 17 Sep 2008 14:08:29 +0000 (16:08 +0200)]
accept literals as SASL responses. makes aox almost work with

13 years agoMake udoc happy.
Abhijit Menon-Sen [Thu, 18 Sep 2008 03:13:56 +0000 (08:43 +0530)]
Make udoc happy.

13 years agoand note why the function is brokenish
Arnt Gulbrandsen [Wed, 17 Sep 2008 11:21:34 +0000 (13:21 +0200)]
and note why the function is brokenish

13 years agoUpdate VERSION. v3.0.1
Abhijit Menon-Sen [Mon, 15 Sep 2008 09:13:14 +0000 (14:43 +0530)]

13 years agoobey soft-bounce even if the reject comes from a sieve script
Arnt Gulbrandsen [Mon, 15 Sep 2008 07:59:21 +0000 (09:59 +0200)]
obey soft-bounce even if the reject comes from a sieve script

13 years agothe session initialiser does select on dm where mailbox=$1 and modseq>$2
Arnt Gulbrandsen [Sat, 13 Sep 2008 06:21:45 +0000 (08:21 +0200)]
the session initialiser does select on dm where mailbox=$1 and modseq>$2
all the time, so we need an index or that will be dog slow on a large db


13 years agocontinue splitting messages and mailbox_messages.
Arnt Gulbrandsen [Thu, 11 Sep 2008 15:48:26 +0000 (17:48 +0200)]
continue splitting messages and mailbox_messages.

the trivia fetcher conflated the two, which led to strange failures and
race conditions, all very unusual but decidedly buggy.

as a bonus change, the injector now records that the message it caches
contains information. this makes whip happy, not sure why. but from now on
the cache may actually lead to speedups.

13 years agomake the AddressCreator generally more similar to HRC.
Arnt Gulbrandsen [Thu, 11 Sep 2008 09:47:58 +0000 (11:47 +0200)]
make the AddressCreator generally more similar to HRC.

important difference: the AC has an optimisation where it skips using a
savepoint for the first select. because of this, the caller has to look at
whether the AC is done, not just send more queries (or? hm? not sure.
maybe it would work anyway, due to the magic of subtransactions.) and the
AC may have to notify the caller itself, not rely on sub->commit().

13 years agostop saying 'select distinct ...' in the Selector. it bothered too many
Arnt Gulbrandsen [Thu, 11 Sep 2008 09:02:50 +0000 (11:02 +0200)]
stop saying 'select distinct ...' in the Selector. it bothered too many
callers, and I don't think it has been necessary for a while. six months
or so.

update callers.

tweak the Transaction logic in Fetcher so it'll use a Transaction only
when really needed or told to, and lock the messages so a big query won't
accidentally collide with an expunge.

13 years agoaddresscreator must go back to selecting addresses if the copy fails.
Arnt Gulbrandsen [Thu, 11 Sep 2008 09:01:38 +0000 (11:01 +0200)]
addresscreator must go back to selecting addresses if the copy fails.

also initialise a variable that accidentally wasn't.

13 years agodon't send the notify if we only did select, not copy.
Arnt Gulbrandsen [Thu, 11 Sep 2008 08:55:27 +0000 (10:55 +0200)]
don't send the notify if we only did select, not copy.

don't send it even if we do select/copy/rollback/select/release.

13 years agoif a session update makes a command able to proceed, then let it.
Arnt Gulbrandsen [Thu, 11 Sep 2008 08:54:41 +0000 (10:54 +0200)]
if a session update makes a command able to proceed, then let it.

13 years agono point in blocking the flag-update fetch, it'll be set to executing
Arnt Gulbrandsen [Thu, 11 Sep 2008 08:53:25 +0000 (10:53 +0200)]
no point in blocking the flag-update fetch, it'll be set to executing
again in a moment anyway.

13 years agoadd a debug message which we ought to remove again in a few releases, when
Arnt Gulbrandsen [Thu, 11 Sep 2008 08:49:37 +0000 (10:49 +0200)]
add a debug message which we ought to remove again in a few releases, when
it's clear whether slow DNS resolution is why aox sometimes starts slowly.

13 years agobetter error message.
Arnt Gulbrandsen [Thu, 11 Sep 2008 08:47:45 +0000 (10:47 +0200)]
better error message.

there were too many questions about the previous message, so we'd better
make some effort to give a more helpful message. the previous one didn't
give people enough information to report the bug well, hopefully this one

13 years agominor optimisation: avoid sending a query that almost always is a no-op
Arnt Gulbrandsen [Thu, 11 Sep 2008 08:46:47 +0000 (10:46 +0200)]
minor optimisation: avoid sending a query that almost always is a no-op

13 years agomake the fetcher use a transaction if it is to fetch dynamic data, to be
Arnt Gulbrandsen [Wed, 10 Sep 2008 13:33:55 +0000 (15:33 +0200)]
make the fetcher use a transaction if it is to fetch dynamic data, to be
sure that the reported modseq is in sync with the other queries. (I'm not
sure this is sufficient, but I also don't care greatly.)

allow setters to provide a transaction, of which the fetcher will use a
subtransaction (so the fetcher gets exclusive use of the transaction for a
little while).

use the new setter for flag-update fetches, so noone will be able to sneak
in and expunge the message after fetch has found it, but before the
fetcher has retrieved data.

13 years agodon't ask for the current rows while we're trying to add new rows. it
Arnt Gulbrandsen [Wed, 10 Sep 2008 13:31:55 +0000 (15:31 +0200)]
don't ask for the current rows while we're trying to add new rows.  it
might be safe, but we might want to roll back the COPY, and we don't know
that yet.

also use Transaction::restart(). I thought I'd submitted this, but not.

13 years agotell jam where is IN THE RIGHT FORMAT
Arnt Gulbrandsen [Wed, 10 Sep 2008 11:42:16 +0000 (13:42 +0200)]
tell jam where is IN THE RIGHT FORMAT

13 years agoadd new function Transaction::restart(), to roll back and restart a
Arnt Gulbrandsen [Wed, 10 Sep 2008 09:47:45 +0000 (11:47 +0200)]
add new function Transaction::restart(), to roll back and restart a

use it in the callers that expected rollback() to do this.

13 years agoactually startup wipes out the mailbox tree too (sort of), so use the same
Arnt Gulbrandsen [Tue, 9 Sep 2008 14:49:10 +0000 (16:49 +0200)]
actually startup wipes out the mailbox tree too (sort of), so use the same
mechanism to make sure SASL authenticaiton will wait until the server has
started up.

13 years agomake refreshing() return true only if mailboxes might disappear.
Arnt Gulbrandsen [Tue, 9 Sep 2008 14:47:55 +0000 (16:47 +0200)]
make refreshing() return true only if mailboxes might disappear.

refreshing() should now return false always during normal operation, which
fixes a serious race between append and login. Login would never complete.

13 years agoq-p lines that start with "--" or "From "
Arnt Gulbrandsen [Tue, 9 Sep 2008 13:25:00 +0000 (15:25 +0200)]
q-p lines that start with "--" or "From "

If a string includes a line starting with From, but there's no other
reason to q-p it, then we don't q-p it.

13 years agono need to tell the owner that we've been able to begin
Arnt Gulbrandsen [Tue, 9 Sep 2008 12:06:22 +0000 (14:06 +0200)]
no need to tell the owner that we've been able to begin

13 years agoif the HRC failed completely and can't go either forwards or backwards, it
Arnt Gulbrandsen [Tue, 9 Sep 2008 12:03:07 +0000 (14:03 +0200)]
if the HRC failed completely and can't go either forwards or backwards, it
has to release its subtransaction by calling ->commit().

calling the parent transaction's notify() isn't necessary, Transaction
does it itself when the parent can go on.

13 years ago1. make Transaction::subTransaction() just return an object, without
Arnt Gulbrandsen [Tue, 9 Sep 2008 11:57:19 +0000 (13:57 +0200)]
1. make Transaction::subTransaction() just return an object, without
   locking the parent. makes it possible to create lots of subtransactions
   and use them one by one, as Injector does via HRC.

2. lock the parent when control passes to the subtransaction instead. the
   trampoline releases the parent when control passes back.

3. make Transaction::execute() do nothing when the object is blocked.
   Injector accidentally called it.

13 years agoAvoid enqueueing into the blocked parent transaction.
Abhijit Menon-Sen [Mon, 8 Sep 2008 23:26:15 +0000 (04:56 +0530)]
Avoid enqueueing into the blocked parent transaction.

13 years agoUse this->id() when making a SELECT/COPY in any HelperRowCreator.
Abhijit Menon-Sen [Mon, 8 Sep 2008 23:25:06 +0000 (04:55 +0530)]
Use this->id() when making a SELECT/COPY in any HelperRowCreator.

13 years agoFix typo.
Abhijit Menon-Sen [Mon, 8 Sep 2008 22:01:40 +0000 (03:31 +0530)]
Fix typo.

13 years agoedit the Received: format to avoid triggering SA's RCVD_NUMERIC_whatever
Arnt Gulbrandsen [Mon, 8 Sep 2008 14:16:23 +0000 (16:16 +0200)]
edit the Received: format to avoid triggering SA's RCVD_NUMERIC_whatever

13 years agolog authenticated used in the Received line.
Arnt Gulbrandsen [Tue, 26 Aug 2008 14:01:32 +0000 (16:01 +0200)]
log authenticated used in the Received line.

log the address rather than login just in case someone feels the urge to
try password guessing with the login.

13 years agoConvert HelperRowCreator to use subtransactions.
Abhijit Menon-Sen [Mon, 8 Sep 2008 11:34:56 +0000 (17:04 +0530)]
Convert HelperRowCreator to use subtransactions.

Needs a careful once-over.