Abhijit Menon-Sen [Mon, 3 Nov 2008 09:39:21 +0000 (15:09 +0530)]
Syntax.
Arnt Gulbrandsen [Wed, 29 Oct 2008 12:13:45 +0000 (13:13 +0100)]
*OUCH* flush even if we don't have anything to write NOW
we might have written something earlier, that we want cryptlib to flush.
also log the exact error message as info, not error, since it isn't
necessarily an error. most commonly it's just a timeout.
Arnt Gulbrandsen [Wed, 29 Oct 2008 11:05:54 +0000 (12:05 +0100)]
logging the cryptlib error only when everything's okay makes little sense.
I think that was what the code did. so let's try it differently.
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
(Edit: Integrated with some changes: 2.x has no Granter, and no DbSchema
support. -- AMS)
Abhijit Menon-Sen [Tue, 14 Oct 2008 11:04:56 +0000 (16:34 +0530)]
Remove tried_at.
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.
Abhijit Menon-Sen [Mon, 3 Nov 2008 07:32:45 +0000 (13:02 +0530)]
Make the DeliveryAgent work without tried_at.
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.
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.
Arnt Gulbrandsen [Tue, 26 Aug 2008 10:59:54 +0000 (12:59 +0200)]
send \noselect when a client asks for the separator
Arnt Gulbrandsen [Tue, 26 Aug 2008 13:34:03 +0000 (15:34 +0200)]
pattern a*b may match children of a/c.
Arnt Gulbrandsen [Sun, 7 Sep 2008 15:22:08 +0000 (17:22 +0200)]
do lsub correctly. 2.12 fodder, (assuming that anyone ever cares about odd
lsub behaviour).
Arnt Gulbrandsen [Sun, 24 Aug 2008 11:08:57 +0000 (13:08 +0200)]
that _is_ an error, so log it like that
Arnt Gulbrandsen [Sun, 24 Aug 2008 10:48:59 +0000 (12:48 +0200)]
roll back a transaction if something throws Invariant while processing it
Abhijit Menon-Sen [Sun, 24 Aug 2008 07:06:09 +0000 (12:36 +0530)]
Be careful to not hold locks and die.
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.
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 <ams@oryx.com>
Arnt Gulbrandsen [Tue, 15 Jul 2008 10:40:57 +0000 (12:40 +0200)]
permit two bodyparts to have the same MD5 hash.
the injector has accepted hash duplications for a few weeks, and we don't
use the hash for anything except speeding up injection, so this is now
okay.
Abhijit Menon-Sen [Fri, 22 Aug 2008 12:55:41 +0000 (18:25 +0530)]
Fix some URLs.
Arnt Gulbrandsen [Fri, 22 Aug 2008 10:34:30 +0000 (12:34 +0200)]
authenticate can also contains passwords (base64-encoded, but still)
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.
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.
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. blah@example.com and Boris Lah
<blah@example.com>).
Abhijit Menon-Sen [Wed, 13 Aug 2008 09:37:21 +0000 (15:07 +0530)]
Fix comment.
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.
Abhijit Menon-Sen [Wed, 13 Aug 2008 08:56:08 +0000 (14:26 +0530)]
Spelling fix.
Arnt Gulbrandsen [Mon, 11 Aug 2008 21:18:19 +0000 (23:18 +0200)]
support MAIL FROM:<...> AUTH=<...>
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.
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.
Abhijit Menon-Sen [Thu, 7 Aug 2008 21:48:07 +0000 (03:18 +0530)]
Another warning.
Abhijit Menon-Sen [Thu, 7 Aug 2008 21:36:00 +0000 (03:06 +0530)]
Fix g++ 4.3 warning reported by Simon.
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.
Arnt Gulbrandsen [Tue, 6 May 2008 11:51:50 +0000 (13:51 +0200)]
new function Address::lpdomain(), and caller updates.
Arnt Gulbrandsen [Wed, 23 Apr 2008 12:31:04 +0000 (12:31 +0000)]
String::replace(), untested and so on. both this and prepend() need
unit tests.
p4raw-id: //oryx/src/main@55139
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.
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
itself.
Arnt Gulbrandsen [Tue, 29 Jul 2008 20:58:07 +0000 (22:58 +0200)]
accept this:
From: a@b, c@d, e@f
Sender: a@b, c@d
Arnt Gulbrandsen [Tue, 29 Jul 2008 20:13:13 +0000 (22:13 +0200)]
accept Sender which is a straight copy of From, even if From contains more
than one address.
Arnt Gulbrandsen [Tue, 29 Jul 2008 12:40:25 +0000 (14:40 +0200)]
require needs capability names to be quoted
Arnt Gulbrandsen [Tue, 29 Jul 2008 11:56:16 +0000 (13:56 +0200)]
text/html; charset=iso-8859-1 has to have charset=
Yes, 8859-1 is the default for html, but we have to specify this. Not
doing it requires too much code to agree, and it WILL surprise someone who
uses ASCII as default, as the MIME RFC says to.
Arnt Gulbrandsen [Mon, 28 Jul 2008 14:07:39 +0000 (16:07 +0200)]
text/html has a default charset of iso-8859-1. if we see a charsetless
text/html bodypart in the db, we'd better assume that it's 8895-1.
Arnt Gulbrandsen [Fri, 25 Jul 2008 13:47:47 +0000 (15:47 +0200)]
calling List::count() where isEmpty() will do is sloooow
Arnt Gulbrandsen [Thu, 24 Jul 2008 13:18:26 +0000 (15:18 +0200)]
don't bother checking that a script actually uses the extensions it
'requires'. noone else checks and the RFC doesn't ask us to (I think I
added the checking because of wording in a draft).
Arnt Gulbrandsen [Thu, 24 Jul 2008 12:35:19 +0000 (14:35 +0200)]
move the From workaround that depends on this host's hostname so we try
everything else first.
move the Reply-To workaround that depends on From to after all the Froms.
Arnt Gulbrandsen [Thu, 24 Jul 2008 11:58:43 +0000 (13:58 +0200)]
content-type seems to suffer from more errors than other fields.
there's some general code which works around from::::: a@example.org, but
it only does anything when the field can't be parsed as it should be.
since c-t is suffers from clueless spammers, c-t can parse almost
anything, and often doesn't fail.
therefore, c-t now gets its own colon-skipping code. feh.
Arnt Gulbrandsen [Thu, 24 Jul 2008 11:38:35 +0000 (13:38 +0200)]
be properly case insensitive. thanks to simon heimlicher and the
squirrelmail developers, who like upper case.
Arnt Gulbrandsen [Thu, 24 Jul 2008 11:34:59 +0000 (13:34 +0200)]
make the reject and fileinto extensions magic, in that they can be used
without being declared.
Arnt Gulbrandsen [Thu, 24 Jul 2008 11:34:21 +0000 (13:34 +0200)]
$#@$!. I commited the wrong thing.
this allows empty scripts provided they have nonzero length.
Arnt Gulbrandsen [Thu, 24 Jul 2008 11:32:16 +0000 (13:32 +0200)]
accept empty scripts provided the length is nonzero
Arnt Gulbrandsen [Thu, 24 Jul 2008 10:55:50 +0000 (12:55 +0200)]
if we have to guess the content-type based on filename, then preserve the
original garbage for possible human inspection.
Arnt Gulbrandsen [Thu, 24 Jul 2008 10:47:25 +0000 (12:47 +0200)]
Accept garbage like this:
Content-Type: multipart/mixed; boundary=\"asdf\"
Spammers must die.
Arnt Gulbrandsen [Thu, 24 Jul 2008 10:31:27 +0000 (12:31 +0200)]
be kind to avelsieve, which wants the capabilities in a given order
Arnt Gulbrandsen [Thu, 24 Jul 2008 09:44:20 +0000 (11:44 +0200)]
accept a whitespace-only script as valid
Arnt Gulbrandsen [Thu, 24 Jul 2008 09:40:37 +0000 (11:40 +0200)]
Accept Sieve scripts containing bare LFs.
The RFC demands CRLF, but smartsieve and avelsieve sometimes send LF.
Arnt Gulbrandsen [Thu, 24 Jul 2008 07:17:11 +0000 (09:17 +0200)]
accept a string argument to reject
Arnt Gulbrandsen [Wed, 23 Jul 2008 10:47:11 +0000 (12:47 +0200)]
typo2
Arnt Gulbrandsen [Tue, 22 Jul 2008 19:10:31 +0000 (21:10 +0200)]
typo
Arnt Gulbrandsen [Tue, 22 Jul 2008 12:24:57 +0000 (14:24 +0200)]
when we add a Received field, wrap it properly
and add a for clause if appropriate (or a comment)
Arnt Gulbrandsen [Tue, 22 Jul 2008 11:09:03 +0000 (13:09 +0200)]
uh, 'From ' should happen only for RFC822 headers, so handle only that
Arnt Gulbrandsen [Tue, 22 Jul 2008 10:09:03 +0000 (12:09 +0200)]
handle "From " lines correctly, even if they come in via SMTP.
this is suboptimal; we could look for the address, store it, and use it to
salvage some From: fields. but it's OK.
this change also moves the " Mar " code to work around Courier into the
Courier-specific code, where it ought to have been all the time.
Arnt Gulbrandsen [Mon, 21 Jul 2008 14:30:35 +0000 (16:30 +0200)]
accept and ignore "To: Valued Customer <>"
Abhijit Menon-Sen [Fri, 18 Jul 2008 02:05:22 +0000 (07:35 +0530)]
Make jam clean and git status play nicely.
Arnt Gulbrandsen [Wed, 16 Jul 2008 12:23:12 +0000 (14:23 +0200)]
HeaderField::ContentBase has to go. this has been a bug for ages.
should go into 2.11.
Arnt Gulbrandsen [Wed, 16 Jul 2008 09:59:26 +0000 (11:59 +0200)]
latest DNS TLD list. this goes into 2.11, woo hoo.
Arnt Gulbrandsen [Thu, 3 Jul 2008 19:51:45 +0000 (21:51 +0200)]
mutf7 MUST end in ascii mode. '&' is not legal, '&-' is (since - toggles
back to ascii mode)
Arnt Gulbrandsen [Thu, 3 Jul 2008 13:25:26 +0000 (15:25 +0200)]
add a plan b for malformed boundaries.
if we can't parse the parameters but the boundary seems to be there and we
need it, then try _really_ hard to dig it out of the nonsense.
Arnt Gulbrandsen [Thu, 3 Jul 2008 09:58:35 +0000 (11:58 +0200)]
fetch the recipients for each delivery in a predictable, easily testable
order.
Arnt Gulbrandsen [Wed, 2 Jul 2008 20:58:15 +0000 (22:58 +0200)]
try again quickly (then slowly) if the smarthost doesn't answer
Arnt Gulbrandsen [Sat, 28 Jun 2008 17:03:27 +0000 (19:03 +0200)]
lock the mailbox before deleting it. fixes all races.
Arnt Gulbrandsen [Fri, 27 Jun 2008 12:30:40 +0000 (14:30 +0200)]
call commit() instead of rollback() in expunge if we discover that we
don't need to do anything, and haven't done anything either.
the rollback would finish late sometimes and I'd check whether it was okay
or a timeout.
Abhijit Menon-Sen [Fri, 27 Jun 2008 07:34:31 +0000 (13:04 +0530)]
Fetch (use)names as text.
Abhijit Menon-Sen [Fri, 22 Aug 2008 04:07:50 +0000 (09:37 +0530)]
name another possible error in a sensible way.
maybe we could use the codes too. 23505 is always a UNIQUE violation.
Arnt Gulbrandsen [Thu, 26 Jun 2008 08:29:33 +0000 (10:29 +0200)]
ignore parse errors in mime field parameters silently and stop parsing the
parameters (with two exceptions - we keep looking for charset and
boundary). the variety of errors in parameters is too great and the value
of the errant data is too low to care.
Arnt Gulbrandsen [Wed, 25 Jun 2008 13:39:46 +0000 (15:39 +0200)]
I'm being stubborn. "any header contains ''" is true.
Arnt Gulbrandsen [Wed, 25 Jun 2008 10:09:53 +0000 (12:09 +0200)]
change the table comments so they'll read acceptably (not perfectly) in
the table list on aox.org/db/
Abhijit Menon-Sen [Wed, 25 Jun 2008 09:40:00 +0000 (15:10 +0530)]
Fix typo.
Abhijit Menon-Sen [Wed, 25 Jun 2008 08:35:50 +0000 (14:05 +0530)]
Activate schema #73.
Abhijit Menon-Sen [Wed, 25 Jun 2008 08:35:34 +0000 (14:05 +0530)]
Code to upgrade to schema #73.
Abhijit Menon-Sen [Wed, 25 Jun 2008 08:08:56 +0000 (13:38 +0530)]
Revision #73: Store client address and port separately.
Abhijit Menon-Sen [Wed, 25 Jun 2008 03:35:58 +0000 (09:05 +0530)]
Don't listen on :: if use-ipv6 is false.
If no listen address was specified for a service, we would try to listen
first on :: and then on 0.0.0.0. Now we do the first only if use-ipv6 is
true. (We ignore use-ipv4 for this case, but it doesn't really matter.)
Thanks to Ron Peterson for reporting the problem.
Arnt Gulbrandsen [Tue, 17 Jun 2008 11:55:54 +0000 (13:55 +0200)]
Scope x( (Log*)0 ) should not overwrite parent's log.
Arnt Gulbrandsen [Mon, 16 Jun 2008 11:55:56 +0000 (13:55 +0200)]
if we want to close, and the client closes, that's ok. no point in logging
that.
Arnt Gulbrandsen [Fri, 13 Jun 2008 14:02:50 +0000 (16:02 +0200)]
Accept (and throw away) To: @host.na.me
Arnt Gulbrandsen [Fri, 13 Jun 2008 13:55:51 +0000 (15:55 +0200)]
parse content-type: charset=us-ascii
Arnt Gulbrandsen [Fri, 13 Jun 2008 13:38:58 +0000 (15:38 +0200)]
accept c-t-e: 64bit, 9bit and various other deformed names spammers use
Arnt Gulbrandsen [Fri, 13 Jun 2008 13:35:59 +0000 (15:35 +0200)]
trim trailing whitespace from all subject fields
Arnt Gulbrandsen [Fri, 13 Jun 2008 13:35:25 +0000 (15:35 +0200)]
accept c-t-e: "quoted-printable" as well as quoted-printable. wrong, but
feh.
Arnt Gulbrandsen [Thu, 12 Jun 2008 13:48:45 +0000 (15:48 +0200)]
some people place far too many '"' characters in their mime fields. skip
some harmless ones.
Arnt Gulbrandsen [Thu, 12 Jun 2008 13:42:44 +0000 (15:42 +0200)]
the previous commit could loop infinitely. oops.
Arnt Gulbrandsen [Thu, 12 Jun 2008 13:35:39 +0000 (15:35 +0200)]
parse 'Name: : : : value' as though it were 'Name: value' if that succeeds
and the original fails.
Arnt Gulbrandsen [Thu, 12 Jun 2008 13:35:13 +0000 (15:35 +0200)]
now that ContentType does this, Header doesn't need to
Arnt Gulbrandsen [Thu, 12 Jun 2008 13:24:49 +0000 (15:24 +0200)]
stop parsing a mime field if there's a parse error, and it seems to be
because a second field is glued to the end of this, e.g.
Content-Type: text/plain; charset=x; Subject: y
Arnt Gulbrandsen [Thu, 12 Jun 2008 12:59:54 +0000 (14:59 +0200)]
remove the charset in "text/plain; charset=us-ascii" as part of parsing the
field instead of as fixing the header. this makes a difference when the
message has more than one c-t fields.
do the same for html/latin1.
fix the charset's name if it differs from the correct name other than in
case (so iSO_8859_1 becomes iso-8859-1).
Arnt Gulbrandsen [Thu, 12 Jun 2008 12:49:17 +0000 (14:49 +0200)]
if the message does not contain any sensible mime type, but does contains
a suggested file name, then we try to guess the mime type based on the
file name.
Arnt Gulbrandsen [Mon, 2 Jun 2008 12:05:44 +0000 (14:05 +0200)]
press the start button to stop the computer.
split Subscribe into two and have Unsubscribe do its own work.
Subscribe used to prevent insertion of duplicate subscriptions rows. the
code didn't work, not sure why. it did have a race condition, but surely
we didn't hit that on kalyani? anyway, this version doesn't try quite so
hard, and expects the database constraint to do the rest.
Arnt Gulbrandsen [Thu, 29 May 2008 12:36:26 +0000 (14:36 +0200)]
get rid of Retired Commands before letting anyone look at the list of
commands.
There was just too many spots that called command and immediately skipped
over the Retired ones.
Arnt Gulbrandsen [Wed, 21 May 2008 11:22:06 +0000 (13:22 +0200)]
we deleted that function
Arnt Gulbrandsen [Sat, 10 May 2008 07:36:48 +0000 (09:36 +0200)]
some more response codes based on draft-gulbrandsen-imap-response-codes
Abhijit Menon-Sen [Thu, 8 May 2008 19:37:02 +0000 (01:07 +0530)]
Make CRAM-MD5 correctly deal with spaces in the username (again).
Since we don't support login names with spaces in them, the error in the
previously submitted code is not important; nevertheless, since it broke
an example from some RFC, I chose to fix it rather than change the test.
Abhijit Menon-Sen [Tue, 29 Jul 2008 21:38:55 +0000 (03:08 +0530)]
Cast relname to text when fetching.