You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Danny Angus <da...@thought.co.uk> on 2001/09/18 17:15:55 UTC
Fw: I think I just spotted a bug in the news server
I spotted this, I dunno if its a james bug or an RFC bug ;)
post this message (if it gets through intact!) it gets truncated below
"single dot below", and two dots at the beginning of the line are reduced to
one..
"danny" <da...@thought.co.uk> wrote in message news:...
start
two dots .. space word
two dots ..word
two dots on their own line below
..
single dot below
.
blank line, single dot
.
blank line two dots
..
I guess If I can see this I was wrong ;)
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org
Re: I think I just spotted a bug in the news server
Posted by Harmeet <ha...@kodemuse.com>.
I think dot stuffing in news server is ok.
Here is the relevant code from package
org.apache.james.nntpserver.repository. As far as I know it is right.
--------------------------------------------
// this interface is used to read the data from client and stream it
// into server repository
public interface NNTPLineReader {
// reads a line of data.
// @return null indicates end of data
String readLine();
}
public class NNTPLineReaderImpl implements NNTPLineReader {
private final BufferedReader reader;
public NNTPLineReaderImpl(BufferedReader reader) {
this.reader = reader;
}
public String readLine() {
try {
String line = reader.readLine();
// check for end of article.
if ( line.equals(".") )
line = null;
else if ( line.startsWith(".") )
line = line.substring(1,line.length());
return line;
} catch(IOException ioe) {
throw new NNTPException("could not create article",ioe);
}
}
}
------------------------------------------------
Please tell me if you spot a mistake.
BTW. this is a different approach from SMTP DotStuffing code, not sure if
one makes sense over the other.
Harmeet
----- Original Message -----
From: "Danny Angus" <da...@thought.co.uk>
To: "James-User@Jakarta. Apache. Org" <ja...@jakarta.apache.org>;
"James-Dev@Jakarta. Apache. Org" <ja...@jakarta.apache.org>
Sent: Tuesday, September 18, 2001 8:15 AM
Subject: Fw: I think I just spotted a bug in the news server
> I spotted this, I dunno if its a james bug or an RFC bug ;)
> post this message (if it gets through intact!) it gets truncated below
> "single dot below", and two dots at the beginning of the line are reduced
to
> one..
>
> "danny" <da...@thought.co.uk> wrote in message news:...
> start
> two dots .. space word
> two dots ..word
> two dots on their own line below
> ..
> single dot below
> .
> blank line, single dot
>
> .
>
> blank line two dots
>
> ..
>
> I guess If I can see this I was wrong ;)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org
JDBC mail store
Posted by Danny Angus <da...@thought.co.uk>.
I cant get this to work, I thought id done everything, connection, and
repository, but no.. obviously not.
Anyone done this and care to share their method?
I can get users rep to work .. so sqlResources is found, connection made
etc. but then I get::
(which suggests the table wasnt created, but it managed to create a users
table to surely permissions are Ok?)
Mon Sep 17 17:45:34 BST 2001 [INFO ] <<Phoenix.james.StartupPhase>> ():
Processing Block: James.
Mon Sep 17 17:45:34 BST 2001 [ERROR ] <<Phoenix.james>> (): Unknown error
during run phase startup of application. Details Follow.
org.apache.avalon.framework.CascadingException: Failed to load block James.
at
org.apache.avalon.phoenix.components.phases.StartupPhase.visitBlock(Unknown
Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.visitBlock(Unknown
Source)
at
org.apache.avalon.phoenix.components.phases.BlockDAG.visitDependencies(Unkno
wn Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.visitBlock(Unknown
Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.walkGraph(Unknown
Source)
at
org.apache.avalon.phoenix.components.application.DefaultServerApplication.ru
nPhase(Unknown Source)
at
org.apache.avalon.phoenix.components.application.DefaultServerApplication.st
art(Unknown Source)
rethrown from
org.apache.avalon.framework.component.ComponentException: Cannot find or
init repository
at org.apache.james.core.AvalonMailStore.select(AvalonMailStore.java:208)
at org.apache.james.James.initialize(James.java:246)
at
org.apache.avalon.phoenix.components.phases.StartupPhase.visitBlock(Unknown
Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.visitBlock(Unknown
Source)
at
org.apache.avalon.phoenix.components.phases.BlockDAG.visitDependencies(Unkno
wn Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.visitBlock(Unknown
Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.walkGraph(Unknown
Source)
rethrown from
java.sql.SQLException: Invalid argument value: Key column 'message' doesn't
exist in table
at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
at org.gjt.mm.mysql.Connection.execSQL(Connection.java:885)
at org.gjt.mm.mysql.PreparedStatement.execute(PreparedStatement.java:1093)
at
org.apache.james.mailrepository.JDBCMailRepository.initialize(JDBCMailReposi
tory.java:232)
at org.apache.james.core.AvalonMailStore.select(AvalonMailStore.java:199)
at org.apache.james.James.initialize(James.java:246)
Mon Sep 17 17:45:34 BST 2001 [WARN ] <<Phoenix>> (): Failed to start
application james.
org.apache.avalon.framework.CascadingException: Failed to load block James.
at
org.apache.avalon.phoenix.components.phases.StartupPhase.visitBlock(Unknown
Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.visitBlock(Unknown
Source)
at
org.apache.avalon.phoenix.components.phases.BlockDAG.visitDependencies(Unkno
wn Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.visitBlock(Unknown
Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.walkGraph(Unknown
Source)
at
org.apache.avalon.phoenix.components.application.DefaultServerApplication.ru
nPhase(Unknown Source)
at
org.apache.avalon.phoenix.components.application.DefaultServerApplication.st
art(Unknown Source)
rethrown from
org.apache.avalon.framework.component.ComponentException: Cannot find or
init repository
at org.apache.james.core.AvalonMailStore.select(AvalonMailStore.java:208)
at org.apache.james.James.initialize(James.java:246)
at
org.apache.avalon.phoenix.components.phases.StartupPhase.visitBlock(Unknown
Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.visitBlock(Unknown
Source)
at
org.apache.avalon.phoenix.components.phases.BlockDAG.visitDependencies(Unkno
wn Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.visitBlock(Unknown
Source)
at org.apache.avalon.phoenix.components.phases.BlockDAG.walkGraph(Unknown
Source)
rethrown from
java.sql.SQLException: Invalid argument value: Key column 'message' doesn't
exist in table
at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
at org.gjt.mm.mysql.Connection.execSQL(Connection.java:885)
at org.gjt.mm.mysql.PreparedStatement.execute(PreparedStatement.java:1093)
at
org.apache.james.mailrepository.JDBCMailRepository.initialize(JDBCMailReposi
tory.java:232)
at org.apache.james.core.AvalonMailStore.select(AvalonMailStore.java:199)
at org.apache.james.James.initialize(James.java:246)
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org
RE: Bug in MySQL JDBC sqlResources table creation statement
Posted by Danny Angus <da...@thought.co.uk>.
Thats the confused conclusion I came to,
however..
a) it seems that a PK is needed by the JDBC driver, or the code.
and
b) it prevents duplicates corrupting the db
but as the latest MySQL works with the SQL that exists,(actually thats not
quite right, theres a typo in the PRIMARY () line.) my preffered solution is
to recommend MySQL-3.23.42 or higher for this functionality.
After all its O.S. too, and easy to upgrade in-situ, so not a harsh
recommendation.
d.
> -----Original Message-----
> From: Serge Knystautas [mailto:sergek@lokitech.com]
>
> Interesting. Do you really even need a primary key in this case? Doesn't
> seem like you're using it.
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org
Re: Bug in MySQL JDBC sqlResources table creation statement
Posted by Serge Knystautas <se...@lokitech.com>.
Interesting. Do you really even need a primary key in this case? Doesn't
seem like you're using it.
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Danny Angus" <da...@thought.co.uk>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, September 25, 2001 7:58 AM
Subject: RE: Bug in MySQL JDBC sqlResources table creation statement
> 2 points..
>
> 1/ I changed the MySQL table and added a field "message_id int(32)
unsigned
> zerofill NOT NULL auto_increment,"
> made it the PK, and the old key a UNIQUE which works without changing the
> code, diff appended ..
>
> 2/ the latest mysql seems not to have this restriction anymore anyway.
>
> cvs -z9 diff -u sqlResources.xml
> Index: sqlResources.xml
> ===================================================================
> RCS file: /home/cvspublic/jakarta-james/src/conf/sqlResources.xml,v
> retrieving revision 1.3
> diff -u -r1.3 sqlResources.xml
> --- sqlResources.xml 2001/09/13 01:33:26 1.3
> +++ sqlResources.xml 2001/09/25 11:55:28
> @@ -116,6 +116,7 @@
> <sql name="listMessagesSQL">SELECT message_name, message_state,
> last_updated FROM ${table} WHERE repository_name = ? ORDER BY last_updated
> ASC</sql>
> <sql name="createTable" db="mysql">
> CREATE TABLE ${table} (
> + message_id int(32) unsigned zerofill NOT NULL auto_increment,
> message_name varchar (200) NOT NULL,
> repository_name varchar (200) NOT NULL,
> message_state varchar (30) NOT NULL ,
> @@ -126,7 +127,8 @@
> remote_addr varchar (20) NOT NULL ,
> message_body longblob NOT NULL ,
> last_updated datetime NOT NULL,
> - PRIMARY KEY (message, repository_name)
> + UNIQUE names (message_name,repository_name),
> + PRIMARY KEY (message_id)
> )
> </sql>
> <sql name="createTable" db="mssql">
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org
RE: Bug in MySQL JDBC sqlResources table creation statement
Posted by Danny Angus <da...@thought.co.uk>.
2 points..
1/ I changed the MySQL table and added a field "message_id int(32) unsigned
zerofill NOT NULL auto_increment,"
made it the PK, and the old key a UNIQUE which works without changing the
code, diff appended ..
2/ the latest mysql seems not to have this restriction anymore anyway.
cvs -z9 diff -u sqlResources.xml
Index: sqlResources.xml
===================================================================
RCS file: /home/cvspublic/jakarta-james/src/conf/sqlResources.xml,v
retrieving revision 1.3
diff -u -r1.3 sqlResources.xml
--- sqlResources.xml 2001/09/13 01:33:26 1.3
+++ sqlResources.xml 2001/09/25 11:55:28
@@ -116,6 +116,7 @@
<sql name="listMessagesSQL">SELECT message_name, message_state,
last_updated FROM ${table} WHERE repository_name = ? ORDER BY last_updated
ASC</sql>
<sql name="createTable" db="mysql">
CREATE TABLE ${table} (
+ message_id int(32) unsigned zerofill NOT NULL auto_increment,
message_name varchar (200) NOT NULL,
repository_name varchar (200) NOT NULL,
message_state varchar (30) NOT NULL ,
@@ -126,7 +127,8 @@
remote_addr varchar (20) NOT NULL ,
message_body longblob NOT NULL ,
last_updated datetime NOT NULL,
- PRIMARY KEY (message, repository_name)
+ UNIQUE names (message_name,repository_name),
+ PRIMARY KEY (message_id)
)
</sql>
<sql name="createTable" db="mssql">
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org
Re: Bug in MySQL JDBC sqlResources table creation statement
Posted by Serge Knystautas <se...@lokitech.com>.
Ok thanks. I'm going to look at the code to see if we can't make
message_name significantly shorter. I think it's based on message_id right
now, but this doesn't seem necessary. A 32-byte long GUID could probably do
just as well. I'll look into it.
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, September 25, 2001 5:30 AM
Subject: Re: Bug in MySQL JDBC sqlResources table creation statement
> On Mon, 24 Sep 2001, Serge Knystautas wrote:
> > What's the key length limit for the mysql key?
>
> The total (all the keys in a table) should not exceed 256 (or 255, I don't
> remember which).
>
> Oki
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org
Re: Bug in MySQL JDBC sqlResources table creation statement
Posted by Oki DZ <ok...@pindad.com>.
On Mon, 24 Sep 2001, Serge Knystautas wrote:
> What's the key length limit for the mysql key?
The total (all the keys in a table) should not exceed 256 (or 255, I don't
remember which).
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org
Re: Bug in MySQL JDBC sqlResources table creation statement
Posted by Serge Knystautas <se...@lokitech.com>.
What's the key length limit for the mysql key?
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Danny Angus" <da...@thought.co.uk>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, September 18, 2001 1:07 PM
Subject: Bug in MySQL JDBC sqlResources table creation statement
> the mysql repository table has to have an integer auto_increment field as
> primary key, the combination of message name and repository name is too
> large to be used as a key :(
>
> I'm testing these changes now.
> and I'll investigate a better key stucture.
> and .. the statement had a typo in it too.
>
>
> d.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org
Bug in MySQL JDBC sqlResources table creation statement
Posted by Danny Angus <da...@thought.co.uk>.
the mysql repository table has to have an integer auto_increment field as
primary key, the combination of message name and repository name is too
large to be used as a key :(
I'm testing these changes now.
and I'll investigate a better key stucture.
and .. the statement had a typo in it too.
d.
---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org