You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Rui Alberto L. Gonçalves" <ru...@ptinovacao.pt> on 2003/11/28 17:13:19 UTC

SendMailTransfomer question

Hi all,
sorry bother again with this question, but I can't figure out
why SendMailTransformer is not working.

my sitemap looks like:

<map:match pattern="sendmail">
    <map:generate src="sendmail.xml"/>
     <map:transform type="sendmail"/>
     <map:serialize type="xml"/>
</map:match>

where sendmail.xml is:
=====================
<document
xmlns:email="http://apache.org/cocoon/transformation/sendmail">
  <email:sendmail>
    <email:smtphost>127.0.0.1</email:smtphost>
    <email:from>root@localhost.localdomain</email:from>
    <email:to>root@localhost.localdomain</email:to>
    <email:subject>O Relatorio a ser envioado por email</email:subject>
    <email:body>
      Relatorio com o total das chamadas efectuadas que eu
      decidi agendar para envio por email!
    </email:body>
  </email:sendmail>
</document>

I'm missing something?? thanks for any help.
Rui



-- 
Rui Alberto L. Gonçalves <ru...@ptinovacao.pt>
PT Inovação


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: SendMailTransfomer question

Posted by "Rui Alberto L. Gonçalves" <ru...@ptinovacao.pt>.
Hi Simon,
thanks to you a have SendMailTransformer working ok. I was
missing tomcat localhost_log....

It was a known bug:
http://www.mail-archive.com/dev@cocoon.apache.org/msg06922.html

Thank-you for pointing me the right direction!!
Rui






On Tue, 2003-12-02 at 14:12, Simon Mieth wrote:
> Hi Rue,
> 
> 
> On 02 Dec 2003 12:15:44 +0000
> "Rui Alberto L." Gonçalves <ru...@ptinovacao.pt>
> wrote:
> 
> > I'm getting the message in /var/log/maillog:
> > 
> > Dec  2 11:44:43 localhost sendmail[4960]: hB2BigJP004960:
> > localhost.localdomain [127.0.0.1] did not issue
> > MAIL/EXPN/VRFY/ETRN during connection to MTA
> > 
> > It seems that the connection is established to sendmail,
> > but after that the connection is aborted without trying to
> > send the email.
> > 
> > At the end of pipeline I have:
> > <html><body></body></html>
> 
> This is done by your browser, your pipeline serialize
> nothing. Is there no exception in your error.log or (if you
> use tomcat in the tomcat-logs)?
> 
> 
> 
> 
> > I can't understand the reason of this html tags as the
> > result of the pipeline!!
> > 
> > org.apache.cocoon.acting.Sendmail is working!!
> > 
> > Rui
> 
> Regards,
> Simon
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
-- 
Rui Alberto L. Gonçalves <ru...@ptinovacao.pt>
PT Inovação


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: SendMailTransfomer question

Posted by Simon Mieth <si...@t-online.de>.
Hi Rue,


On 02 Dec 2003 12:15:44 +0000
"Rui Alberto L." Gonçalves <ru...@ptinovacao.pt>
wrote:

> I'm getting the message in /var/log/maillog:
> 
> Dec  2 11:44:43 localhost sendmail[4960]: hB2BigJP004960:
> localhost.localdomain [127.0.0.1] did not issue
> MAIL/EXPN/VRFY/ETRN during connection to MTA
> 
> It seems that the connection is established to sendmail,
> but after that the connection is aborted without trying to
> send the email.
> 
> At the end of pipeline I have:
> <html><body></body></html>

This is done by your browser, your pipeline serialize
nothing. Is there no exception in your error.log or (if you
use tomcat in the tomcat-logs)?




> I can't understand the reason of this html tags as the
> result of the pipeline!!
> 
> org.apache.cocoon.acting.Sendmail is working!!
> 
> Rui

Regards,
Simon

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: SendMailTransfomer question

Posted by Simon Mieth <si...@t-online.de>.
Hi Rui,

i tried your example with my enviroment and it works, but i
use postfix as MTA. Maybe there is a problem by sendmail.




On 02 Dec 2003 12:15:44 +0000
"Rui Alberto L." Gonçalves <ru...@ptinovacao.pt>
wrote:

> I'm getting the message in /var/log/maillog:
> 
> Dec  2 11:44:43 localhost sendmail[4960]: hB2BigJP004960:
> localhost.localdomain [127.0.0.1] did not issue
> MAIL/EXPN/VRFY/ETRN during connection to MTA
> 

Which version of java-mail you use (1.3 by me)?


> It seems that the connection is established to sendmail,
> but after that the connection is aborted without trying to
> send the email.
> 
> At the end of pipeline I have:
> <html><body></body></html>
> 
> I can't understand the reason of this html tags as the
> result of the pipeline!!

This is done by your browser i think, not by the
cocoon-pipeline. So there is no result from your pipeline
(empty). 


> org.apache.cocoon.acting.Sendmail is working!!
> 
> Rui

Ok, i have found a difference in the Action and Transformer.
The Action use the static method Transport.send(Message)
from javamail and the Transformer use a
Transport.sendMessage(). I'm not sure, becouse it works for
me here. 
>From JAVAMAIL-FAQ: befor sending with do a
Session.saveChanges(), if needed. 

This part is done in the Transformer, only the there is
setting the Message.setRecipients() before sending. 
Maybe you can try to add a saveChanges() in the code before
sending, but i'm not sure if is needed there.

in
cocoon-2.1.x/src/blocks/mail/java/org/apache/cocoon/mail/tr
ansformation/SendmailTransformer.java

insert at line 525 a "this.smtpMessage.saveChanges();"
before "trans.sendMessage(this.smtpMessage, iaArr);" 

//but this will slow down the process 

and rebuild cocoon and try again. 


This is the point i can see, maybe it helps you.


Best regards,
Simon





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: SendMailTransfomer question

Posted by "Rui Alberto L. Gonçalves" <ru...@ptinovacao.pt>.
I'm getting the message in /var/log/maillog:

Dec  2 11:44:43 localhost sendmail[4960]: hB2BigJP004960:
localhost.localdomain [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN
during connection to MTA

It seems that the connection is established to sendmail, but
after that the connection is aborted without trying to send the
email.

At the end of pipeline I have:
<html><body></body></html>

I can't understand the reason of this html tags as the result of the
pipeline!!

org.apache.cocoon.acting.Sendmail is working!!

Rui





On Fri, 2003-11-28 at 20:16, Simon Mieth wrote:
> On 28 Nov 2003 18:21:23 +0000
> "Rui Alberto L." Gonçalves <ru...@ptinovacao.pt>
> wrote:
> 
> > I'm sending in attachment the result log of a request that
> > matches this pipeline with DEBUG level.
> > In fact the match pattern this time is sendmail-x :)
> > I'm using cocoon 2.1.2. I tryed to use SendMailTransformer
> > that is shiped with cocoon-2.1.3, but the result is the
> > same!! :(
> > 
> > Thanks again!
> > 
> 
> 
> Ok, as i see from your log-file the sendMail-method from the
> sendmailtransformer should be invoked and there is no
> exception in the log-file.
> 
> What get you as result from your pipeline? 
> Can you take a look at your mail.log (linux? then
> /var/log/mail.log). Is there a connection from localhost (
> the messageID should contain JavaMail?
> Maybe a look in error.log and core.log (in WEB-INF/logs) can
> give more details.
> 
> Best regards,
> 
> Simon
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
-- 
Rui Alberto L. Gonçalves <ru...@ptinovacao.pt>
PT Inovação


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: SendMailTransfomer question

Posted by Simon Mieth <si...@t-online.de>.
On 28 Nov 2003 18:21:23 +0000
"Rui Alberto L." Gonçalves <ru...@ptinovacao.pt>
wrote:

> I'm sending in attachment the result log of a request that
> matches this pipeline with DEBUG level.
> In fact the match pattern this time is sendmail-x :)
> I'm using cocoon 2.1.2. I tryed to use SendMailTransformer
> that is shiped with cocoon-2.1.3, but the result is the
> same!! :(
> 
> Thanks again!
> 


Ok, as i see from your log-file the sendMail-method from the
sendmailtransformer should be invoked and there is no
exception in the log-file.

What get you as result from your pipeline? 
Can you take a look at your mail.log (linux? then
/var/log/mail.log). Is there a connection from localhost (
the messageID should contain JavaMail?
Maybe a look in error.log and core.log (in WEB-INF/logs) can
give more details.

Best regards,

Simon

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: SendMailTransfomer question

Posted by "Rui Alberto L. Gonçalves" <ru...@ptinovacao.pt>.
On Fri, 2003-11-28 at 17:30, Simon Mieth wrote:
> On 28 Nov 2003 16:13:19 +0000
> "Rui Alberto L." Gonçalves <ru...@ptinovacao.pt> wrote:
> 
> > Hi all,
> > sorry bother again with this question, but I can't figure out
> > why SendMailTransformer is not working.
> > 
> > my sitemap looks like:
> > 
> > <map:match pattern="sendmail">
> >     <map:generate src="sendmail.xml"/>
> >      <map:transform type="sendmail"/>
> >      <map:serialize type="xml"/>
> > </map:match>
> > 
> > where sendmail.xml is:
> > =====================
> > <document
> > xmlns:email="http://apache.org/cocoon/transformation/sendmail">
> >   <email:sendmail>
> >     <email:smtphost>127.0.0.1</email:smtphost>
> >     <email:from>root@localhost.localdomain</email:from>
> >     <email:to>root@localhost.localdomain</email:to>
> >     <email:subject>O Relatorio a ser envioado por email</email:subject>
> >     <email:body>
> >       Relatorio com o total das chamadas efectuadas que eu
> >       decidi agendar para envio por email!
> >     </email:body>
> >   </email:sendmail>
> > </document>
> > 
> > I'm missing something?? thanks for any help.
> > Rui
> > 
> > 
> 

Hi Simon, thanks for the answer!!
> Hi,
> 
> some stupid questions from me:
> 
> *Have you drop mail.jar, activation.jar from java.sun.com in your WEB-INF/lib folder?

Yes!

> *Your SMTP-Server work and you can send mail from root@localhost.localdomain to root@localhost.localdomain with your emailprogram without problems?
Yes... I can send email with: 
telnet 127.0.0.1 25 to user root@localhost.localdomain
> 
> Sorry, i didnt read your older mails, so can post snippeds from your sitemap.xmap (the <map:transformers>-section on top) and from the log-files.
> Maybe the sendmail-transformer is not setup by default, isn't it?

In transformers sections I have:

<map:transformer logger="sitemap.transformer.mailtransformer"
name="sendmail"                  
src="org.apache.cocoon.mail.transformation.SendMailTransformer"/>

parameters setted up in sendmail.xml file override default
configurations right?

I'm sending in attachment the result log of a request that matches
this pipeline with DEBUG level.
In fact the match pattern this time is sendmail-x :)
I'm using cocoon 2.1.2. I tryed to use SendMailTransformer that
is shiped with cocoon-2.1.3, but the result is the same!! :(

Thanks again!

> 
> More informations can help to find out, where the problem is?
> 
> Best regards,
> 
> Simon
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
-- 
Rui Alberto L. Gonçalves <ru...@ptinovacao.pt>
PT Inovação

Re: SendMailTransfomer question

Posted by Simon Mieth <si...@t-online.de>.
On 28 Nov 2003 16:13:19 +0000
"Rui Alberto L." Gonçalves <ru...@ptinovacao.pt> wrote:

> Hi all,
> sorry bother again with this question, but I can't figure out
> why SendMailTransformer is not working.
> 
> my sitemap looks like:
> 
> <map:match pattern="sendmail">
>     <map:generate src="sendmail.xml"/>
>      <map:transform type="sendmail"/>
>      <map:serialize type="xml"/>
> </map:match>
> 
> where sendmail.xml is:
> =====================
> <document
> xmlns:email="http://apache.org/cocoon/transformation/sendmail">
>   <email:sendmail>
>     <email:smtphost>127.0.0.1</email:smtphost>
>     <email:from>root@localhost.localdomain</email:from>
>     <email:to>root@localhost.localdomain</email:to>
>     <email:subject>O Relatorio a ser envioado por email</email:subject>
>     <email:body>
>       Relatorio com o total das chamadas efectuadas que eu
>       decidi agendar para envio por email!
>     </email:body>
>   </email:sendmail>
> </document>
> 
> I'm missing something?? thanks for any help.
> Rui
> 
> 

Hi,

some stupid questions from me:

*Have you drop mail.jar, activation.jar from java.sun.com in your WEB-INF/lib folder?
*Your SMTP-Server work and you can send mail from root@localhost.localdomain to root@localhost.localdomain with your emailprogram without problems?

Sorry, i didnt read your older mails, so can post snippeds from your sitemap.xmap (the <map:transformers>-section on top) and from the log-files.
Maybe the sendmail-transformer is not setup by default, isn't it?

More informations can help to find out, where the problem is?

Best regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org