﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Wolfman-文章分类-Java</title><link>http://www.blogjava.net/wolfman/category/7165.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 19:15:17 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 19:15:17 GMT</pubDate><ttl>60</ttl><item><title>James + derby 不可以发大小超过 1M(1024*1024Byte) 的邮件</title><link>http://www.blogjava.net/wolfman/articles/28870.html</link><dc:creator>wolfman.wu</dc:creator><author>wolfman.wu</author><pubDate>Sat, 21 Jan 2006 05:18:00 GMT</pubDate><guid>http://www.blogjava.net/wolfman/articles/28870.html</guid><wfw:comment>http://www.blogjava.net/wolfman/comments/28870.html</wfw:comment><comments>http://www.blogjava.net/wolfman/articles/28870.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wolfman/comments/commentRss/28870.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wolfman/services/trackbacks/28870.html</trackback:ping><description><![CDATA[<P>使用 James + Derby 构建 email 系统, 发送邮件大小有限制</P>
<P>问题:<BR>&nbsp; 1. 配置好 james 使用 derby 作为存储邮件的数据库.<BR>&nbsp;&nbsp;&nbsp;&nbsp; 懒,把 username/password 给 james 自己来创建它要的表.用如下的url:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jdbc:derby://localhost/maildb;create=true<BR>&nbsp; 2. 启动 James<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1) 没任何报错问题<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2) 测试简单邮件可以通过<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3) 发大邮件不可以通过&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 问题出现</P>
<P>处理过程:<BR>&nbsp; 1. 检查 derby 中 maildb schema 中的 deadletter, inbox, spool 这几个表中的 blob 类型的长度都是 1048576 Byte(1024*1024Byte = 1M).<BR>&nbsp; 2. 查 derby 的 blob 说明没有说限制这么小的. 至少它的例子就建了个 16M 的都可以通过.<BR>&nbsp; 3. 删掉 James 自动建的那几个表, 自己手工再建一次. deadletter, inbox, spool 这几个表的结构是相同的:<BR></P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">CREATE</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">TABLE</SPAN><SPAN style="COLOR: #000000">&nbsp;deadletter&nbsp;(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;inbox,&nbsp;spool&nbsp;也用相同的结构建表</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;message_name&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">200</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #808080">NOT</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">NULL</SPAN><SPAN style="COLOR: #000000">&nbsp;,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;repository_name&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">255</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #808080">NOT</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">NULL</SPAN><SPAN style="COLOR: #000000">&nbsp;,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;message_state&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">30</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #808080">NOT</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">NULL</SPAN><SPAN style="COLOR: #000000">&nbsp;,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;error_message&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">200</SPAN><SPAN style="COLOR: #000000">)&nbsp;,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;sender&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">255</SPAN><SPAN style="COLOR: #000000">)&nbsp;,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;recipients&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1000</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #808080">NOT</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">NULL</SPAN><SPAN style="COLOR: #000000">&nbsp;,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;remote_host&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">100</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #808080">NOT</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">NULL</SPAN><SPAN style="COLOR: #000000">&nbsp;,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;remote_addr&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">20</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #808080">NOT</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">NULL</SPAN><SPAN style="COLOR: #000000">&nbsp;,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;message_body&nbsp;blob(20M)&nbsp;</SPAN><SPAN style="COLOR: #808080">NOT</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">NULL</SPAN><SPAN style="COLOR: #000000">&nbsp;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;指定&nbsp;blob&nbsp;的大小,不用默认的</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;message_attributes&nbsp;blob(20M)&nbsp;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;指定&nbsp;blob&nbsp;的大小,不用默认的</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;last_updated&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">timestamp</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">NOT</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">NULL</SPAN><SPAN style="COLOR: #000000">&nbsp;,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">PRIMARY</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">KEY</SPAN><SPAN style="COLOR: #000000">&nbsp;(repository_name,&nbsp;message_name)<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV>
<P><BR>再次启动 James 测试大邮件(当然不可以超过 Blob 类型的指定长度, 这里是20M),问题解决!</P><img src ="http://www.blogjava.net/wolfman/aggbug/28870.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wolfman/" target="_blank">wolfman.wu</a> 2006-01-21 13:18 <a href="http://www.blogjava.net/wolfman/articles/28870.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>