You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Hans Liebenberg <ha...@cambrient.com> on 2005/08/26 13:02:58 UTC

Modifying BodyPart

Hi,

I am trying to write a mailet that modifies the text/html part of a message
as it comes through.
I get the correct BodyPart of the MultiPart message and call setContent() on
it,
But it doesn't seem to modify it at all.

I assume this is because it is probably not possible??

What I am trying to do is a Mail Merge on the message adding the users
firstname to the top of the message, replacing a placeholder.

Is the approach of writing a mailet to modify the text correct? 

Thanks
Hans




---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: need fully-qualified hostname

Posted by Etienne Richards <et...@solve400problems.com>.
Wonderful, it worked.

I previously did have a name but not a correct DNS name.

-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org] 
Sent: Saturday, August 27, 2005 11:00 AM
To: 'James Users List'
Subject: Re: need fully-qualified hostname

> When James tries to deliver mail to lycos.co.uk the server 
> responds back
> with:
> 
> Remote mail server told me: 501 <server>: Helo command 
> rejected: need fully-qualified hostname
> 
> What is meant by a fully qualified host name and where can I 
> change it?

James RemoteDelivery gets the fully quelified name from the "hello name" you
configured in the SMTP server.
If you don't have an hello name configured in the SMTPServer then it takes
the first servername (this may not be a qualified hostname).

You probably should configure properly your "hello name" in the smtpserver
with your public host name.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: need fully-qualified hostname

Posted by Stefano Bagnara <ap...@bago.org>.
> When James tries to deliver mail to lycos.co.uk the server 
> responds back
> with:
> 
> Remote mail server told me: 501 <server>: Helo command 
> rejected: need fully-qualified hostname
> 
> What is meant by a fully qualified host name and where can I 
> change it?

James RemoteDelivery gets the fully quelified name from the "hello name" you
configured in the SMTP server.
If you don't have an hello name configured in the SMTPServer then it takes
the first servername (this may not be a qualified hostname).

You probably should configure properly your "hello name" in the smtpserver
with your public host name.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


need fully-qualified hostname

Posted by Etienne Richards <et...@solve400problems.com>.
When James tries to deliver mail to lycos.co.uk the server responds back
with:

Remote mail server told me: 501 <server>: Helo command rejected: need
fully-qualified hostname

What is meant by a fully qualified host name and where can I change it?



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Modifying BodyPart

Posted by Stefano Bagnara <ap...@bago.org>.
> I am trying to write a mailet that modifies the text/html 
> part of a message as it comes through.
> I get the correct BodyPart of the MultiPart message and call 
> setContent() on it, But it doesn't seem to modify it at all.

Maybe you you should read this:
http://james.apache.org/FAQ.html#11
----
Q: Why isn't my mailet making changes to a MimeMessage?
A: Check the JavaMail docs. Per the API, when you call
MimeMessage.setContent(blah), you have to call saveChanges() to apply your
changes. James tries to automatically call this method so you don't have to,
but in certain cases you'll still have to call saveChanges().

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org