13 years agoAvoid excessively long timeout. v3.0.0
Abhijit Menon-Sen [Sun, 24 Aug 2008 11:07:21 +0000 (16:37 +0530)]
Avoid excessively long timeout.

(Submitted by accident with an earlier change.)

13 years agothat _is_ an error, so log it like that
Arnt Gulbrandsen [Sun, 24 Aug 2008 11:08:57 +0000 (13:08 +0200)]
that _is_ an error, so log it like that

13 years agoroll back a transaction if something throws Invariant while processing it
Arnt Gulbrandsen [Sun, 24 Aug 2008 10:48:59 +0000 (12:48 +0200)]
roll back a transaction if something throws Invariant while processing it

13 years agoBe careful to not hold locks and die.
Abhijit Menon-Sen [Sun, 24 Aug 2008 07:06:09 +0000 (12:36 +0530)]
Be careful to not hold locks and die.

13 years agoCure the symptoms of the /3.0.0foo disease.
Abhijit Menon-Sen [Fri, 22 Aug 2008 12:43:28 +0000 (18:13 +0530)]
Cure the symptoms of the /3.0.0foo disease.

13 years agobe slightly more flexible about guessing content-type:
Arnt Gulbrandsen [Fri, 22 Aug 2008 10:42:14 +0000 (12:42 +0200)]
be slightly more flexible about guessing content-type:

if we have to guess, we first set a default, then try to guess something,
and if we can't guess, we don't touch the default.

13 years agoauthenticate can also contains passwords (base64-encoded, but still)
Arnt Gulbrandsen [Fri, 22 Aug 2008 10:34:30 +0000 (12:34 +0200)]
authenticate can also contains passwords (base64-encoded, but still)

13 years agothe code to not close listeners only caught one of the two instances. this
Arnt Gulbrandsen [Fri, 22 Aug 2008 10:15:12 +0000 (12:15 +0200)]
the code to not close listeners only caught one of the two instances. this
catches the other.

also closes the connection instead of just forgetting it.

also forgets about connections even if they're already closed.

13 years agobuild an actual, working query for aox tune database
Arnt Gulbrandsen [Thu, 21 Aug 2008 12:14:13 +0000 (14:14 +0200)]
build an actual, working query for aox tune database

this also is prettier. we like =any($x) much better than building long
boolean chains.

13 years agopg versions differ in how the indexdef is returned, so use the name more and
Arnt Gulbrandsen [Thu, 21 Aug 2008 12:06:19 +0000 (14:06 +0200)]
pg versions differ in how the indexdef is returned, so use the name more and
the defintion less

13 years agoThe sender's copy is delivered through the smarthost.
Abhijit Menon-Sen [Wed, 20 Aug 2008 11:12:50 +0000 (16:42 +0530)]
The sender's copy is delivered through the smarthost.

13 years agodon't try to use tsearch2 on pg 8.1 or 8.2
Arnt Gulbrandsen [Wed, 20 Aug 2008 10:33:29 +0000 (12:33 +0200)]
don't try to use tsearch2 on pg 8.1 or 8.2

13 years agoFix typos.
Abhijit Menon-Sen [Wed, 20 Aug 2008 10:15:26 +0000 (15:45 +0530)]
Fix typos.

13 years agoAdd missing newline.
Abhijit Menon-Sen [Wed, 20 Aug 2008 10:09:52 +0000 (15:39 +0530)]
Add missing newline.

13 years agoteach the sieve about remote recipients.
Arnt Gulbrandsen [Wed, 20 Aug 2008 08:39:29 +0000 (10:39 +0200)]
teach the sieve about remote recipients.

remote recipients bypass the entire sieve machinery and go straight to the
deliveries table. make smtp use that.

this makes the logging much clearer, and perhaps makes
submit-copy-to-sender work (it works afterwards anyway).

13 years agoorder RCPT TO commands more comprehensibly
Arnt Gulbrandsen [Wed, 20 Aug 2008 08:36:27 +0000 (10:36 +0200)]
order RCPT TO commands more comprehensibly

the old order was stable, but that wasn't easy to see. now it orders them
by domain,localpart.

13 years agoSelect indexes by name, not definition.
Abhijit Menon-Sen [Wed, 20 Aug 2008 07:36:31 +0000 (13:06 +0530)]
Select indexes by name, not definition.

The definition may just vary wrt. whitespace, quotes, etc. between
versions. The names are stable.

13 years agoFix definition of ald.
Abhijit Menon-Sen [Wed, 20 Aug 2008 07:31:22 +0000 (13:01 +0530)]
Fix definition of ald.

13 years agoMerge branch 'p4/src/main' of ssh://down/oryx/oryx into p4/src/main
Arnt Gulbrandsen [Wed, 20 Aug 2008 07:25:59 +0000 (09:25 +0200)]
Merge branch 'p4/src/main' of ssh://down/oryx/oryx into p4/src/main

13 years agomake a gin index in advanced-search
Arnt Gulbrandsen [Wed, 20 Aug 2008 07:25:18 +0000 (09:25 +0200)]
make a gin index in advanced-search

13 years agoFix query syntax error: '(or indexdef=...'
Abhijit Menon-Sen [Wed, 20 Aug 2008 06:46:57 +0000 (12:16 +0530)]
Fix query syntax error: '(or indexdef=...'

Introduced inadvertently when I added the schemaname to the query.

13 years agoDon't look at bodyparts that cause to_tsvector to break.
Abhijit Menon-Sen [Wed, 20 Aug 2008 05:47:05 +0000 (11:17 +0530)]
Don't look at bodyparts that cause to_tsvector to break.

This is unsatisfactory, but good enough for 3.0.0. It means you can
create a partial GIN index on the bodyparts table, and this query
will use it for BODY searches.

13 years agoaox delete alias would fail if there were several rows in the addresses
Arnt Gulbrandsen [Tue, 19 Aug 2008 19:39:48 +0000 (21:39 +0200)]
aox delete alias would fail if there were several rows in the addresses
table with that localpart and domain (e.g. and Boris Lah

13 years agoRemember the index definition and use it later.
Abhijit Menon-Sen [Tue, 19 Aug 2008 11:23:50 +0000 (16:53 +0530)]
Remember the index definition and use it later.

13 years agoMerge branch 'p4/src/main' of ssh://down/oryx/oryx
Abhijit Menon-Sen [Sat, 16 Aug 2008 16:50:31 +0000 (22:20 +0530)]
Merge branch 'p4/src/main' of ssh://down/oryx/oryx

13 years agosupport writing files >2GB in size, provided O_LARGEFILE is available on
Arnt Gulbrandsen [Sat, 16 Aug 2008 16:40:21 +0000 (18:40 +0200)]
support writing files >2GB in size, provided O_LARGEFILE is available on
the OS.

this may or may not do anything on OSes other than linux. of course such
OSes may work anyway.

13 years agoMerge branch 'p4/src/main' of ssh://down/oryx/oryx
Abhijit Menon-Sen [Sat, 16 Aug 2008 01:48:56 +0000 (07:18 +0530)]
Merge branch 'p4/src/main' of ssh://down/oryx/oryx

13 years agoMerge branch 'p4/src/main' of ssh:// into p4/src/main
Arnt Gulbrandsen [Fri, 15 Aug 2008 22:55:02 +0000 (00:55 +0200)]
Merge branch 'p4/src/main' of ssh:// into p4/src/main

13 years agoavoid creating a Session. creating a Session is too expensive.
Arnt Gulbrandsen [Fri, 15 Aug 2008 22:50:04 +0000 (00:50 +0200)]
avoid creating a Session. creating a Session is too expensive.

as a hack, borrow information from the current session if there is one.
3501 isn't too clear on that. mrc thinks issuing status on such mailboxes
isn't legal in the first place, but 3501 doesn't seem to say any such

13 years agoRemove temporary logging.
Abhijit Menon-Sen [Thu, 14 Aug 2008 10:33:20 +0000 (16:03 +0530)]
Remove temporary logging.

13 years agoFix comment.
Abhijit Menon-Sen [Wed, 13 Aug 2008 09:37:21 +0000 (15:07 +0530)]
Fix comment.

13 years agoDon't close Listeners.
Abhijit Menon-Sen [Wed, 13 Aug 2008 09:33:45 +0000 (15:03 +0530)]
Don't close Listeners.

We have no good way to identify the Connection that originated a query
in Query::notify(), but we can be pretty sure that a Listener isn't it
while we're looking for parents of the query's owner's log.

13 years agoSpelling fix.
Abhijit Menon-Sen [Wed, 13 Aug 2008 08:56:08 +0000 (14:26 +0530)]
Spelling fix.

13 years agofuck me.
Arnt Gulbrandsen [Mon, 11 Aug 2008 21:24:15 +0000 (23:24 +0200)]
fuck me.

13 years agosupport MAIL FROM:<...> AUTH=<...>
Arnt Gulbrandsen [Mon, 11 Aug 2008 21:18:19 +0000 (23:18 +0200)]
support MAIL FROM:<...> AUTH=<...>

13 years agoMake authentication less noisy.
Abhijit Menon-Sen [Fri, 8 Aug 2008 11:49:20 +0000 (17:19 +0530)]
Make authentication less noisy.

13 years agoAvoid writing plaintext LOGIN passwords to the log file.
Abhijit Menon-Sen [Fri, 8 Aug 2008 11:06:35 +0000 (16:36 +0530)]
Avoid writing plaintext LOGIN passwords to the log file.

Done this way on the basis that it fixes the obvious case (a login x y),
and that login is an unlikely source of problems that we'd desperately
need the first line to debug anyway. Suppressing the line seems better
than trying to find and obscure the password (cf. "a login x {7}").

Doesn't do anything about AUTHENTICATE initial-response etc.

13 years agoFix another warning.
Abhijit Menon-Sen [Thu, 7 Aug 2008 22:09:09 +0000 (03:39 +0530)]
Fix another warning.

A stupid one, this time. g++ doesn't realise that i cannot be > 5, and
it complains about the array subscript being out of bounds.

13 years agoAnother warning.
Abhijit Menon-Sen [Thu, 7 Aug 2008 21:48:07 +0000 (03:18 +0530)]
Another warning.

13 years agoFix g++ 4.3 warning reported by Simon.
Abhijit Menon-Sen [Thu, 7 Aug 2008 21:36:00 +0000 (03:06 +0530)]
Fix g++ 4.3 warning reported by Simon.

13 years agoEstablish a proper override order for configuration variables.
Abhijit Menon-Sen [Thu, 7 Aug 2008 12:38:12 +0000 (18:08 +0530)]
Establish a proper override order for configuration variables.

Another bugbear. Values from the command-line should trump those from
the configuration file, which should override compile-time defaults.
But the earlier code didn't always get it right.

13 years agoMake it possible to override DBNAME in the installer.
Abhijit Menon-Sen [Thu, 7 Aug 2008 11:23:28 +0000 (16:53 +0530)]
Make it possible to override DBNAME in the installer.

Something I've always wanted to do.

13 years agoTweak.
Abhijit Menon-Sen [Thu, 7 Aug 2008 11:09:16 +0000 (16:39 +0530)]

13 years agoDon't pass '"aox"' to the Granter.
Abhijit Menon-Sen [Thu, 7 Aug 2008 11:04:13 +0000 (16:34 +0530)]
Don't pass '"aox"' to the Granter.

13 years agoSet db-schema to "public" by default.
Abhijit Menon-Sen [Thu, 7 Aug 2008 10:45:26 +0000 (16:15 +0530)]
Set db-schema to "public" by default.

Coping with an empty schema, especially in catalog queries, was just not
worth the trouble. Anyone who wants to create a separate Archiveopteryx
schema by hand can just deal with its not being named "public".

13 years agocreateSchema() isn't the end of the installer's work.
Abhijit Menon-Sen [Thu, 7 Aug 2008 10:02:38 +0000 (15:32 +0530)]
createSchema() isn't the end of the installer's work.

13 years agoSet db-schema in connectToDb.
Abhijit Menon-Sen [Thu, 7 Aug 2008 09:52:20 +0000 (15:22 +0530)]
Set db-schema in connectToDb.

13 years agoOutput tweak.
Abhijit Menon-Sen [Thu, 7 Aug 2008 09:51:13 +0000 (15:21 +0530)]
Output tweak.

13 years agoRestore search_path setting in createSchema().
Abhijit Menon-Sen [Thu, 7 Aug 2008 09:47:14 +0000 (15:17 +0530)]
Restore search_path setting in createSchema().

If we specify search_path=foo as a startup parameter and the schema foo
does not exist (yet), it doesn't provoke an error, but it also ignores
the assignment. So we have to restore it after we create the schema.

Makes sense, really.

13 years agoImplement the innards of Granter.
Abhijit Menon-Sen [Thu, 7 Aug 2008 09:33:24 +0000 (15:03 +0530)]
Implement the innards of Granter.

No comment.

13 years agoSome Jam magic to run privilege-list.
Abhijit Menon-Sen [Thu, 7 Aug 2008 09:31:08 +0000 (15:01 +0530)]
Some Jam magic to run privilege-list.

13 years agoA script that can turn annotations into
Abhijit Menon-Sen [Thu, 7 Aug 2008 09:15:26 +0000 (14:45 +0530)]
A script that can turn annotations into

Prints a line like this:

    { "tablename", true, false, true, false },

for each table in, indicating what privileges (s/i/u/d) it
should have.

13 years agoAdd grant annotations.
Abhijit Menon-Sen [Mon, 4 Aug 2008 19:30:14 +0000 (01:00 +0530)]
Add grant annotations.

13 years agoOops.
Abhijit Menon-Sen [Thu, 7 Aug 2008 06:00:04 +0000 (11:30 +0530)]

13 years agoMake db-schema available to Schema::execute.
Abhijit Menon-Sen [Thu, 7 Aug 2008 05:43:39 +0000 (11:13 +0530)]
Make db-schema available to Schema::execute.

13 years agoAnother one.
Abhijit Menon-Sen [Thu, 7 Aug 2008 05:09:01 +0000 (10:39 +0530)]
Another one.

13 years agoMake queries against pg_* respect db-schema.
Abhijit Menon-Sen [Thu, 7 Aug 2008 04:51:59 +0000 (10:21 +0530)]
Make queries against pg_* respect db-schema.

13 years agohas_schema_privilege() lets us use a smaller hammer.
Abhijit Menon-Sen [Thu, 7 Aug 2008 03:47:53 +0000 (09:17 +0530)]
has_schema_privilege() lets us use a smaller hammer.

We just need to write the select in this way to avoid errors on a schema
that doesn't exist (it'll return 0 rows in that case).

13 years agoSet the search_path per-connection, not per-user.
Abhijit Menon-Sen [Thu, 7 Aug 2008 03:28:08 +0000 (08:58 +0530)]
Set the search_path per-connection, not per-user.

Since we now have a record of which schema we're installed into, we can
set the search_path as a connection parameter. This removes the need for
a scary "you may hide all your database objects" warning that would need
some surgery to correct: if you hide your objects, just reset the change
to db-schema, and you have them back again.

This is safe to do because, as far as I can tell, specifying a schema
that does not exist in your search_path does not provoke an error when
you do it as a connection parameter. Otherwise we would have to jump
through some hoops to avoid specifying it in the installer (where we
may need to create the schema in the first place).

13 years agoGet rid of grant-privileges.
Abhijit Menon-Sen [Thu, 7 Aug 2008 03:14:07 +0000 (08:44 +0530)]
Get rid of grant-privileges.

13 years agoAdd a new db-schema configuration variable.
Abhijit Menon-Sen [Thu, 7 Aug 2008 02:38:32 +0000 (08:08 +0530)]
Add a new db-schema configuration variable.

1. DBSCHEMA in Jamsettings, empty by default.
2. Set DBSCHEMA in EngraveConfig and two Jamfiles.
3. (Terse) Documentation for the new config variable.
4. The installer takes the default value from Jamsettings, allows it to
   be overriden from the command line (-S); and if no value was given,
   it uses the value from the configuration file, if present.

I thought this was unnecessary, but changed my mind after much thought.

For one thing, "aox grant privileges" and the like need to know if they
are dealing with objects in a particular schema, but if we just set the
search_path and forget about it, we can't know. This is a problem also
because objects in other schemata always show up in the catalog tables.

Besides that, however, changing the search_path was easy, but ultimately
not sensible behaviour. Something that requires us to put dire warnings
in the manpages is suspicious at best.

This will require follow-up changes to set the search_path for each
connection instead of by default. But, once done, that will be much
more predictable and sensible: It makes _sense_ that if you change
the db-schema value, you are using a different schema; and you can
change it back to undo the change. And you always know which schema
is going to be used when the server is started.

13 years agoEnter stage left: Granter.
Abhijit Menon-Sen [Wed, 6 Aug 2008 19:37:07 +0000 (01:07 +0530)]
Enter stage left: Granter.

1. Add a new class to check and grant/revoke privileges as needed.
2. Alter the three callers: installer's grantPrivileges(), aox
   grant privileges, and Schema::execute() (which now rechecks
   privileges at the end of each upgrade).

(The Granter is just a stub right now.)

13 years agoOutput tweak.
Abhijit Menon-Sen [Wed, 6 Aug 2008 07:18:33 +0000 (12:48 +0530)]
Output tweak.

13 years agoIt should be safe to set db-user in connectToDb.
Abhijit Menon-Sen [Wed, 6 Aug 2008 07:02:06 +0000 (12:32 +0530)]
It should be safe to set db-user in connectToDb.

Since we use the three-argument form of Database::setup, the only
relevant code that uses DbUser at all is Schema, which is exactly
what we want to influence anyway.

Untested, but if it doesn't work it's a bug elsewhere.

13 years agoFiddle.
Abhijit Menon-Sen [Tue, 5 Aug 2008 15:23:45 +0000 (20:53 +0530)]

13 years agoSchema #75: Restore index on bodyparts.hash.
Abhijit Menon-Sen [Mon, 4 Aug 2008 12:24:52 +0000 (17:54 +0530)]
Schema #75: Restore index on bodyparts.hash.

Signed-off-by: Abhijit Menon-Sen <>
13 years agoMerge branch 'p4/src/main' of ssh://down/oryx/oryx into p4/src/main
Arnt Gulbrandsen [Mon, 4 Aug 2008 09:11:19 +0000 (11:11 +0200)]
Merge branch 'p4/src/main' of ssh://down/oryx/oryx into p4/src/main

13 years agoif an IMAP command needs a session and doesn't have one, then something
Arnt Gulbrandsen [Mon, 4 Aug 2008 09:09:41 +0000 (11:09 +0200)]
if an IMAP command needs a session and doesn't have one, then something
really bad is happening. this can happen if the client closes the
connection abruptly and the close isn't quite handled.

this change adds code to throw an exception if that happens, which will
close the IMAP connection without deliberation. bang.

probably should go into 2.11.

13 years agoMake sure schema.cpp sees the right db-user.
Abhijit Menon-Sen [Sat, 2 Aug 2008 02:08:09 +0000 (07:38 +0530)]
Make sure schema.cpp sees the right db-user.

connectToDb resets the configuration, so ::text( DbUser ) would return
the default value (aox) and grants would fail if the user was set to
something else in the configuration file.

13 years agoDon't recurse forever in checkOwnership().
Abhijit Menon-Sen [Sat, 2 Aug 2008 01:00:53 +0000 (06:30 +0530)]
Don't recurse forever in checkOwnership().

13 years agoMake splitPrivileges work.
Abhijit Menon-Sen [Sat, 2 Aug 2008 00:21:28 +0000 (05:51 +0530)]
Make splitPrivileges work.

13 years agoMake sure we're looking for the right mailstore table.
Abhijit Menon-Sen [Fri, 1 Aug 2008 06:41:03 +0000 (12:11 +0530)]
Make sure we're looking for the right mailstore table.

13 years agoThis is what needs to be done to the installer.
Abhijit Menon-Sen [Fri, 1 Aug 2008 05:08:43 +0000 (10:38 +0530)]
This is what needs to be done to the installer.

After installing 1.0 and running the new installer, it's clear that the
privilege separation step must be run before upgradeSchema, because the
schema upgrade code expects to be able to access things as aoxsuper.

Besides that, we add an "aox grant privileges"-alike step at the end.

13 years agoMerge branch 'p4/src/main' of ssh:// into p4/src/main
Arnt Gulbrandsen [Fri, 1 Aug 2008 13:49:48 +0000 (15:49 +0200)]
Merge branch 'p4/src/main' of ssh:// into p4/src/main

13 years agoUpdate our refuse-reject implementation to match that which becomes RFC.
Arnt Gulbrandsen [Fri, 1 Aug 2008 13:47:33 +0000 (15:47 +0200)]
Update our refuse-reject implementation to match that which becomes RFC.

Really simple, but it doesn't make MDNs. I'm not sure how to decide
whether to issue an MDN or a DSN. The information is avaiable at the
start, but not at the end of Sieve processing, and the MDN/DSN has to
be made at the end...

This may or may not go into 3.0.0.

13 years agoMerge branch 'p4/src/main' of ssh://down/oryx/oryx into p4/src/main
Arnt Gulbrandsen [Fri, 1 Aug 2008 09:13:48 +0000 (11:13 +0200)]
Merge branch 'p4/src/main' of ssh://down/oryx/oryx into p4/src/main

13 years ago3.0.0 release on 2008-08-18. postponed because there was a mysterious
Arnt Gulbrandsen [Fri, 1 Aug 2008 09:13:00 +0000 (11:13 +0200)]
3.0.0 release on 2008-08-18. postponed because there was a mysterious
crash two days ago.

13 years agoDetect permissions correctly.
Abhijit Menon-Sen [Fri, 1 Aug 2008 04:19:01 +0000 (09:49 +0530)]
Detect permissions correctly.

13 years agoMore output tweaks.
Abhijit Menon-Sen [Fri, 1 Aug 2008 04:09:29 +0000 (09:39 +0530)]
More output tweaks.

13 years agoMinor output fixes.
Abhijit Menon-Sen [Fri, 1 Aug 2008 02:09:14 +0000 (07:39 +0530)]
Minor output fixes.

13 years agoAvoid another type warning.
Abhijit Menon-Sen [Fri, 1 Aug 2008 02:09:02 +0000 (07:39 +0530)]
Avoid another type warning.

13 years agoFriendly, but firm.
Abhijit Menon-Sen [Fri, 1 Aug 2008 01:46:03 +0000 (07:16 +0530)]
Friendly, but firm.

13 years agoA friendly warning about -S.
Abhijit Menon-Sen [Fri, 1 Aug 2008 01:43:40 +0000 (07:13 +0530)]
A friendly warning about -S.

13 years agoAdd a little note.
Abhijit Menon-Sen [Fri, 1 Aug 2008 01:28:33 +0000 (06:58 +0530)]
Add a little note.

13 years agoAdd a function to grant usage on schema $x to $dbuser.
Abhijit Menon-Sen [Fri, 1 Aug 2008 01:22:55 +0000 (06:52 +0530)]
Add a function to grant usage on schema $x to $dbuser.

13 years agoThe bug referred to in the earlier commit message wasn't a bug.
Abhijit Menon-Sen [Fri, 1 Aug 2008 00:38:01 +0000 (06:08 +0530)]
The bug referred to in the earlier commit message wasn't a bug.

But my experiments did show that we need to GRANT USAGE on the schema
too. Coming up.

13 years agoOverhaul the installer's database() function.
Abhijit Menon-Sen [Fri, 1 Aug 2008 00:09:34 +0000 (05:39 +0530)]
Overhaul the installer's database() function.

1. Split the work of database() up into several functions, each
   corresponding to one clearly-defined task, and all written in
   execute() style.

2. Control the proliferation of DbStates: each function corresponds
   to a single state now.

3. Move ownership checks to before we create the database objects; and
   if a schema is specified, we no longer need to insist on owning the
   containing database.

4. If -S is specified, create the given namespace if necessary; and
   set the default search_path appropriately.

This really ought to have been split up, but I started by trying to make
the schema creation stuff work, and doing that needed other things to be
cleaned up, and before I knew it, I had a 1000-line diff. Oops.

(As it is, I am submitting with the privilege separation code #ifdef'ed
out, because I want something to diff against. The privilege separation
code is a big lump of dead code. I'll resurrect it after the rest works

Tested, but there is at least one bug: upgradeSchema can't find the
mailstore table even with the right search_path set. Works nicely

13 years agoMerge branch 'p4/src/main' of ssh:// into p4/src/main
Arnt Gulbrandsen [Thu, 31 Jul 2008 10:17:55 +0000 (12:17 +0200)]
Merge branch 'p4/src/main' of ssh:// into p4/src/main

13 years agoUse a faster query to see whether a mailbox is really empty.
Arnt Gulbrandsen [Thu, 31 Jul 2008 10:15:56 +0000 (12:15 +0200)]
Use a faster query to see whether a mailbox is really empty.

This also should evade a type problem: count(*) returned a bigint
for Simon Heimlicher in the previous version of this query, so I
cast it to bigint in case there's a version discrepancy and then
use getBigint() to retrieve it.

13 years agoone thing is slow, at least
Arnt Gulbrandsen [Wed, 30 Jul 2008 14:34:07 +0000 (16:34 +0200)]
one thing is slow, at least

13 years agomake sure Bodypart::header() returns what it ought to.
Arnt Gulbrandsen [Wed, 30 Jul 2008 14:28:12 +0000 (16:28 +0200)]
make sure Bodypart::header() returns what it ought to.

If a Message has a single child and isn't a multipart, the the Message's
Header also acts as the child's Header. This is the case that corresponds
to a simple text/plain message: no separate mime header.

this change makes that happen, in a not terribly intuitive way. when we
read the header fields from the db, and can infer that the message has a
single child, then we make sure the child exists, and when we look up that
child, it has no header and it ought to have one, we link it to the
Message's header.

I'm sure this could be done cleaner. Perhaps we could use something like
  Header * Bodypart::actingHeader() const
which returns its own or the surrounding Message's.

13 years agostuff to do during 3.x
Arnt Gulbrandsen [Wed, 30 Jul 2008 13:27:18 +0000 (15:27 +0200)]
stuff to do during 3.x

13 years agofething the modseq of a single cached message would break. fix it.
Arnt Gulbrandsen [Wed, 30 Jul 2008 12:50:12 +0000 (14:50 +0200)]
fething the modseq of a single cached message would break. fix it.

the Fetcher would assume that since the db id was cached, it's better to
fetch without reference to the mailbox_messages table. but we need that
table to get the modseq. we can still fetch without reference to mm if
fetching e.g. only addresses or only body.

13 years agoFix typo, and remember to set search_path for psql too.
Abhijit Menon-Sen [Wed, 30 Jul 2008 12:33:42 +0000 (18:03 +0530)]
Fix typo, and remember to set search_path for psql too.

13 years ago-S is better than one --option.
Abhijit Menon-Sen [Wed, 30 Jul 2008 12:28:46 +0000 (17:58 +0530)]
-S is better than one --option.

13 years agoAdd a --schema option to the installer.
Abhijit Menon-Sen [Wed, 30 Jul 2008 12:23:38 +0000 (17:53 +0530)]
Add a --schema option to the installer.

This will allow Axel Rau to specify the search_path for his installation
so that he can share a database between development and production.

13 years agoimprove the error message; I think the new text is more likely to be
Arnt Gulbrandsen [Wed, 30 Jul 2008 12:07:20 +0000 (14:07 +0200)]
improve the error message; I think the new text is more likely to be
correctly interpreted by J. Clueful User.

13 years agoMerge branch 'p4/src/main' of ssh:// into p4/src/main
Arnt Gulbrandsen [Wed, 30 Jul 2008 11:58:04 +0000 (13:58 +0200)]
Merge branch 'p4/src/main' of ssh:// into p4/src/main

13 years agoso how could this ever pass a single test? unsubscribe has to execute its
Arnt Gulbrandsen [Wed, 30 Jul 2008 11:57:13 +0000 (13:57 +0200)]
so how could this ever pass a single test? unsubscribe has to execute its
query, it can't just hope and pray that the query magically resolve

13 years agoCast relname to text when fetching.
Abhijit Menon-Sen [Tue, 29 Jul 2008 21:38:55 +0000 (03:08 +0530)]
Cast relname to text when fetching.