You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Mark Imel <mi...@imelshire.com> on 2003/02/14 20:58:07 UTC
[PATCH] AddFooter enhancement
The current AddFooter mailet is unable to successfully add its footer to more complex mail messages: specifically, any MimeMessage that has nested MimeMultiparts.
These kinds of email messages may result when a user decides to use embedded html elements with their email. For instance, Outlook Express has a Stationary feature that causes these complex MimeMessages to occur.
I came across this scenario, while building a [slightly] more advanced list serv mailet that i hope to donate either to mailet.org or the james project. I wanted to embed a standard mailing list footer (like you see with the Jakarta mailing lists), and ensure that the footer is included regardless of the type of mail sent to the list.
Regards,
--mark imel
BTW: This is my first time submitting a patch to an apache project, i apologize if i messed up the cvs diff file. I'd be more than happy to send the modified AddFooter if preferred, or regenerate the diff file if necessary.
RE: [PATCH] AddFooter enhancement
Posted by Danny Angus <da...@apache.org>.
> mailet that i hope to donate either to mailet.org or the james project.
FWIW Mailet.org is intended to be a place where mailet developers can have their projects listed, and once some projects materialise it could be linked to the james website, without giving up the IPR.
Donating to James involves giving the IPR to Apache.
d.
(PS pls use text/plain in mail for the lists)
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
RE: [PATCH] AddFooter enhancement
Posted by "Noel J. Bergman" <no...@devtech.com>.
> > Based upon what code? Did you try the code from CVS? Did you try using
> > the nightly build?
> I use actually the version 1.8.
AddFooter.java,v1.8 is the current version in HEAD for James v3. It is
identical to what is in the branch for James v2.x. There is a considerable
amount of debugging code in there right now, that you can uncomment to find
out what is happening with respect to your footer.
Caveat: do NOT uncomment the code related to getRawInputStream(). It will
NOT work. That portion of code is there to demonstrate the presence of a
JavaMail problem that I've reported to Sun. Instead, if you want to dump
the entire message content to the log after attaching footers, enable the
portion of code that uses getInputStream().
I have successfully tested this version of AddFooter with text/plain,
text/html, and multipart messages. If you find a problem, please let me
know.
--- Noel
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
RE: [PATCH] AddFooter enhancement
Posted by Scherer Pierre <sc...@ibelgique.com>.
>Based upon what code? Did you try the code from CVS? Did you try using
the
>nightly build?
I use actualy the version 1.8.
-Pierre
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
RE: [PATCH] AddFooter enhancement
Posted by "Noel J. Bergman" <no...@devtech.com>.
Pierre,
Based upon what code? Did you try the code from CVS? Did you try using the
nightly build?
--- Noel
-----Original Message-----
From: Scherer Pierre [mailto:scherer_pierre@ibelgique.com]
Sent: Wednesday, March 12, 2003 5:58
To: James Developers List
Subject: RE: [PATCH] AddFooter enhancement
Noel,
I'm sorry, but it always doesn't run!
In fact, I have a good log message, but no footer in my mail received.
Perhaps I must configure my client-mail otherwise?
------
<!--Add a footer at all incoming mails (no spam) -->
<mailet match="All" class="AddFooterTrack">
<text>test</text>
</mailet>
------
Any suggestions?
-Pierre
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
RE: [PATCH] AddFooter enhancement
Posted by Scherer Pierre <sc...@ibelgique.com>.
Noel,
I'm sorry, but it always doesn't run!
In fact, I have a good log message, but no footer in my mail received.
Perhaps I must configure my client-mail otherwise?
------
<!--Add a footer at all incoming mails (no spam) -->
<mailet match="All" class="AddFooterTrack">
<text>test</text>
</mailet>
------
Any suggestions?
-Pierre
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
RE: [PATCH] AddFooter enhancement
Posted by "Noel J. Bergman" <no...@devtech.com>.
Mark and Pierre,
I have committed a revision of AddFooter. This version appears to be
working properly based upon my tests with text/plain, text/html, and
multipart/alternative. I have put considerable debugging code into the
mailet, all commented out, to help track anymore issues as might come up.
NB: there is an issue with getRawInputStream, which I have also debugged.
We do not want to use it with JavaMail v1.3 if a message has changed.
One of the changes I made fixes a longstanding problem with text/html
footers being malformed.
Please review the changes at your leisure.
--- Noel
-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com]
Sent: Sunday, March 09, 2003 17:34
To: James Developers List
Subject: RE: [PATCH] AddFooter enhancement
Mark,
I am reviewing your submission. It appears that this also fixes the problem
that Pierre Scherer has been reporting.
One question. You removed the check for multipart/alternative as well as
adding the handling for MimeMultipart. Wasn't just the latter change
necessary, and shouldn't the former have been kept? For example, I don't
believe that you would want to run that loop on multipart/[related, signed,
encrypted, pgp, ...] parts.
Similarly, I'm wondering if the (part.getContent() instanceof MimeMultipart)
check ought to be a bit more selective.
Thoughts?
--- Noel
-----Original Message-----
From: Mark Imel [mailto:mimel@imelshire.com]
Sent: Friday, February 14, 2003 14:58
To: James Developers List
Subject: [PATCH] AddFooter enhancement
The current AddFooter mailet is unable to successfully add its footer to
more complex mail messages: specifically, any MimeMessage that has nested
MimeMultiparts.
These kinds of email messages may result when a user decides to use embedded
html elements with their email. For instance, Outlook Express has a
Stationary feature that causes these complex MimeMessages to occur.
I came across this scenario, while building a [slightly] more advanced list
serv mailet that i hope to donate either to mailet.org or the james project.
I wanted to embed a standard mailing list footer (like you see with the
Jakarta mailing lists), and ensure that the footer is included regardless of
the type of mail sent to the list.
Regards,
--mark imel
BTW: This is my first time submitting a patch to an apache project, i
apologize if i messed up the cvs diff file. I'd be more than happy to send
the modified AddFooter if preferred, or regenerate the diff file if
necessary.
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
RE: [PATCH] AddFooter enhancement
Posted by "Noel J. Bergman" <no...@devtech.com>.
Mark,
I am reviewing your submission. It appears that this also fixes the problem
that Pierre Scherer has been reporting.
One question. You removed the check for multipart/alternative as well as
adding the handling for MimeMultipart. Wasn't just the latter change
necessary, and shouldn't the former have been kept? For example, I don't
believe that you would want to run that loop on multipart/[related, signed,
encrypted, pgp, ...] parts.
Similarly, I'm wondering if the (part.getContent() instanceof MimeMultipart)
check ought to be a bit more selective.
Thoughts?
--- Noel
-----Original Message-----
From: Mark Imel [mailto:mimel@imelshire.com]
Sent: Friday, February 14, 2003 14:58
To: James Developers List
Subject: [PATCH] AddFooter enhancement
The current AddFooter mailet is unable to successfully add its footer to
more complex mail messages: specifically, any MimeMessage that has nested
MimeMultiparts.
These kinds of email messages may result when a user decides to use embedded
html elements with their email. For instance, Outlook Express has a
Stationary feature that causes these complex MimeMessages to occur.
I came across this scenario, while building a [slightly] more advanced list
serv mailet that i hope to donate either to mailet.org or the james project.
I wanted to embed a standard mailing list footer (like you see with the
Jakarta mailing lists), and ensure that the footer is included regardless of
the type of mail sent to the list.
Regards,
--mark imel
BTW: This is my first time submitting a patch to an apache project, i
apologize if i messed up the cvs diff file. I'd be more than happy to send
the modified AddFooter if preferred, or regenerate the diff file if
necessary.
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org