You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Fleischer Roman <ro...@siemens.com> on 2003/09/18 15:01:33 UTC
Sendmail Action Status
Hello,
i try to use the sendmail action. When the mail is sent without any error,
everything seems to work well. The {status} of the action is success. But
when i use a non exixting EMail, i get an error "Ressource not found" I use
the action like described in the example (on cocoon.apache.org)
<map:match pattern="mail">
<map:act type="sendmail">
<map:parameter name="charset" value="ISO-8859-1"/>
<map:parameter name="smtphost"
value="{global:mailserver}"/>
<map:parameter name="from"
value="{request-param:from}"/>
<map:parameter name="to"
value="{request-param:to}"/>
<map:parameter name="subject"
value="{request-param:subject}"/>
<map:parameter name="body"
value="{request-param:body}"/>
<map:generate src="{status}.xml"/>
<map:serialize type="html"/>
</map:act>
</map:match>
I also create a user-error.xml and server-error.xml document. But when the
Email is unknown, the action has no status. In the sitemap.log i get this
entry:
ERROR (2003-09-18) 14:47.07:234 [sitemap.action.sendmail] (/cocoon/mail)
PoolThread-2/Sendmail: SendmailAction: MessagingException: An error occured
while sending email.
javax.mail.MessagingException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 553 5.1.8 <fs...@fdfd.de>...
Domain of sender address fsdsdf@fdfd.de does not exist
at
org.apache.cocoon.mail.MailMessageSender.send(MailMessageSender.java:319)
at org.apache.cocoon.acting.Sendmail.act(Sendmail.java:234)
at
org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTyp
eNode.java:152)
Can anybody help?
Thanks,
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Sendmail Action Status
Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 18.Sep.2003 -- 03:01 PM, Fleischer Roman wrote:
> Hello,
>
> i try to use the sendmail action. When the mail is sent without any error,
> everything seems to work well. The {status} of the action is success. But
> when i use a non exixting EMail, i get an error "Ressource not found" I use
> the action like described in the example (on cocoon.apache.org)
> <map:match pattern="mail">
> <map:act type="sendmail">
> <map:generate src="{status}.xml"/>
> <map:serialize type="html"/>
> </map:act>
> </map:match>
>
> I also create a user-error.xml and server-error.xml document. But when the
> Email is unknown, the action has no status. In the sitemap.log i get this
> entry:
> Can anybody help?
The above is intentional as actions should include pipeline parts
depending on the successful execution of the action. Therefore the
pipeline nested inside the map:act elements is included only upon
success. It is skipped if the action failed.
So, for your application, you need to
<map:act type="sendmail">
<map:generate src="success.xml"/>
<map:serialize/>
</map:act>
<map:generate src="{request-attr:org.apache.cocoon.acting.Sendmail}.xml"/>
<map:serialize/>
Of course you could put everything outside as well
<map:act type="sendmail"/>
<map:generate src="{request-attr:org.apache.cocoon.acting.Sendmail}.xml"/>
<map:serialize/>
Although no status is returned to the sitemap, it is still set as
request attribute.
HTH
Chris.
--
C h r i s t i a n H a u l
haul@informatik.tu-darmstadt.de
fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org