Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 75825 invoked from network); 7 May 2004 07:11:07 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 7 May 2004 07:11:07 -0000 Received: (qmail 53468 invoked by uid 500); 7 May 2004 07:10:40 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 53071 invoked by uid 500); 7 May 2004 07:10:37 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 53049 invoked from network); 7 May 2004 07:10:37 -0000 Received: from unknown (HELO paris.dvs1.informatik.tu-darmstadt.de) (130.83.166.129) by daedalus.apache.org with SMTP; 7 May 2004 07:10:37 -0000 Received: from [141.6.8.35] (border1.basf-ag.de [141.6.8.35]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by paris.dvs1.informatik.tu-darmstadt.de (Postfix) with ESMTP id 7647D80696 for ; Fri, 7 May 2004 09:10:46 +0200 (CEST) Message-ID: <409B3670.5020308@informatik.tu-darmstadt.de> Date: Fri, 07 May 2004 09:10:40 +0200 From: Christian Haul Reply-To: haul@informatik.tu-darmstadt.de User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Sendmail Action HTML-Mail & Attachment References: <003c01c431c7$f822a710$8500a8c0@RAMSES> <409958F8.4010906@gmx.de> In-Reply-To: <409958F8.4010906@gmx.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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 Joerg Heinicke wrote: > > > On 04.05.2004 13:07, Nils K�ster wrote: > >> I'm trying to send mail via the sendmail action with html-body and >> pdf-attachment, my sitemap looks like this: >> >> >> >> >> >> >> >> >> >> >> >> > value="{request-param:attachment}"/> >> >> >> >> In request-param:attachment i have something like: >> context:/nkpm/resources/documents/some.pdf >> >> But it doesn't send the mail when I have both in it: attachment and >> html-src. With one of them it works. >> >> Does anybody have a clue? > > >> In the error.log I get: >> ----------------------------------------------- >> ERROR (2004-05-02) 22:25.32:156 [sitemap.action.sendmail] >> (/mailer/mail) >> http8080-Processor25/Sendmail: SendmailAction: An exception was thrown >> while >> sending email. java.lang.NullPointerException >> at >> org.apache.cocoon.mail.MailMessageSender.send(MailMessageSender.java:323) >> at org.apache.cocoon.acting.Sendmail.act(Sendmail.java:253) > > > From the code the NPE is obvious: > > 306 BodyPart bodypart = null; > 307 > 308 if (this.src != null) { > 309 DataSource ds = null; > 310 > 311 Source source = resolver.resolveURI(this.src); > 312 sourcesList.add(source); > 313 if (source.exists()) { > 314 ds = > 315 new SourceDataSource( > 316 source, > 317 (this.srcMimeType == null > 318 ? source.getMimeType() > 319 : this.srcMimeType), > 320 this.src.substring(this.src.lastIndexOf('/') + 1)); > 321 } > 322 > 323 bodypart.setDataHandler(new DataHandler(ds)); > 324 bodypart.setFileName(ds.getName()); > 325 > 326 multipart.addBodyPart(bodypart); > > bodypart was never set/is still null in line 323. > > Unfortunately I don't know how to fix it and I don't have the time to > dive in at the moment. Christian wrote the code and could probably fix > it in the shortest time as he knows what should happen. Unfortunately he > made himself very rare on the lists in the last weeks, so I guess he has > not much time ATM neither. Hi Nils, Joerg, sorry that I can't look into this ATM but I believe the original idea was that every mail should contain a plain text body, not just attachments. However, we could for example provide a default text like "please see attachment" or the like but I feel like it would make more sense to do this application specific. So, the simplest solution for Nils would be to add such a body text and add the pdf as attachment. I need to dig up the specs to see if it is allowed to have no bodypart. Will try to look into this over the weekend. Cheers, Chris. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org