Return-Path: Delivered-To: apmail-james-server-dev-archive@www.apache.org Received: (qmail 36707 invoked from network); 6 Feb 2004 22:04:42 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Feb 2004 22:04:42 -0000 Received: (qmail 34370 invoked by uid 500); 6 Feb 2004 22:04:27 -0000 Delivered-To: apmail-james-server-dev-archive@james.apache.org Received: (qmail 34327 invoked by uid 500); 6 Feb 2004 22:04:26 -0000 Mailing-List: contact server-dev-help@james.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "James Developers List" Reply-To: "James Developers List" Delivered-To: mailing list server-dev@james.apache.org Received: (qmail 34280 invoked from network); 6 Feb 2004 22:04:26 -0000 Received: from unknown (HELO brmea-mail-3.sun.com) (192.18.98.34) by daedalus.apache.org with SMTP; 6 Feb 2004 22:04:26 -0000 Received: from sfbaymail1sca.SFBay.Sun.COM ([129.145.154.35]) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id i16M4Hi5029673; Fri, 6 Feb 2004 15:04:17 -0700 (MST) Received: from datsun.SFBay.Sun.COM (datsun.SFBay.Sun.COM [129.145.132.71]) by sfbaymail1sca.SFBay.Sun.COM (8.12.10+Sun/8.12.10/ENSMAIL,v2.2) with ESMTP id i16M4G9m015633; Fri, 6 Feb 2004 14:04:17 -0800 (PST) Received: from sun.com (localhost [127.0.0.1]) by datsun.SFBay.Sun.COM (8.12.10+Sun/8.12.2) with ESMTP id i16M1Ed9027503; Fri, 6 Feb 2004 14:01:14 -0800 (PST) Message-ID: <40240EAA.4080305@sun.com> Date: Fri, 06 Feb 2004 14:01:14 -0800 From: Bill Shannon User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.5) Gecko/20031016 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Richard O. Hammer" CC: James Developers List Subject: Re: JavaMail InternetHeaders could be more friendly to server developers References: <40212168.5050002@EarthLink.net> In-Reply-To: <40212168.5050002@EarthLink.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Richard O. Hammer wrote: > Three months ago in November we exchanged a few ideas about how the > JavaMail API might be made more useful for development of mail servers > -- as distinct from development of mail clients. Now I have discovered > one more point that I would like to add. I might be mistaken again > because of my incomplete understanding of the API, but I hope this is > right. My comment concerns javax.mail.internet.InternetHeaders. > > When a SMTP server receives a message it needs to add a Received: header > at the top of the headers. But InternetHeaders does not seem to offer > any way to add a header specifically at the top of the list. This class > seems to offer no way for its users to learn or set the order of the > headers. (I am referencing the JavaDocs for JavaMail 1.3). > > As a consequence the code in James* goes through an awkward workaround: > constructing a new InternetHeaders object, adding the new Received: > header, and then adding the remaining header lines by looping through an > Enumeration of header lines retrieved from the original incoming > InternetHeaders object. This workaround relies upon behavior which I > have not seen documented, namely that the addHeaderLine() method always > adds to the bottom of the list of headers. > > So, I would suggest that InternetHeaders could be improved, for the use > of server developers, by addition of a method addHeaderLineAtTop(), and > by promising and documenting the present behavior of addHeaderLine(), > that it adds to the bottom. It's something of a kludge, but InternetHeaders already handles this in the addHeaders method. It knows the preferred order for well-known headers, and it knows that Received headers should be added in reverse order. The addHeaderLine method, on the other hand, always adds to the end. I suppose some part of that ought to be part of the spec. :-) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org For additional commands, e-mail: server-dev-help@james.apache.org