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 Hutson Carspecken <hu...@myprivacypolicy.com> on 2003/07/23 00:28:44 UTC

How to Set InternetAddress Personal Name

Hello,

I am having a hard time setting the InternetAddress value of PersonalName.  I have done a good deal of reading and have meet with plenty of failure.  Is there a line of code that someone could share?

Thanks,

Hut

Re: How to Set InternetAddress Personal Name

Posted by Hutson Carspecken <hu...@myprivacypolicy.com>.
Yes,  I have a lot of work to do.  Thanks for looking .

Hut
----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: "James Users List" <se...@james.apache.org>
Sent: Friday, July 25, 2003 11:06 AM
Subject: Re: How to Set InternetAddress Personal Name


> Hutson Carspecken wrote:
> > I am forwarding e-mails into our company through a gateway e-mail
server.  I
> > want to keep the original senders personal name, but I also need to
attach
> > the name of the proxy e-mail server.  So, from this e-mail, I see that
the
> > sender is:  "Serge Knystautas" <se...@lokitech.com>.  I would like to
> > change that so a person in our company receiving e-mail from you would
see
> > the following:
> >
> > "Serge Knystautas" <em...@mycompany.com>
> >
> > That is to say, the personal name would remain the original personal
name,
> > but the e-mail address would be the recipent's own "outward-facing"
email
> > address...the one which the original sender (in this example, yourself)
used
> > to reach the company employee.
>
> Ok, makes sense.
>
> > I am making headway with the required code and am somewhat close.  Tell
me
> > what you think of this code snippet.
> >
> > String prevPersonalName;
> >
> > Mail myMail = new Mail();
> > prevPersonalName = origMail.getMessage().getFrom().getPersonal();
> > myMail.getMessage().setPersonal( prevPersonalName);
>
> I think this is just a typo, but I think you meant setPersonal on
> myMail.getMessage().getFrom() (not getMessage()).
>
> I'm not sure why this isn't working for you... maybe it's some strange
> issue where it's updating a copy of the message's From header.
>
> Overall though, I think you have a tough job ahead of you because of the
> following:
> a) creating a new message will be very hard because of the amount of
> relevant headers you'd need to copy from the original to the copy.
> b) modifying the original is hard because you also have to go sanitize
> the Received headers, and possibly elsewhere as well.  Otherwise someone
> could see what your actual email address is.
>
> Actually, the more I read your idea, the more confused I get.  Why would
> you change the **FROM** of a message.  "Serge Knystautas"'s address
> stays the same... in fact the email address I put as the TO or CC would
> stay the same because it already is the "outward-facing" address,
> otherwise it wouldn't have reached your company employee.
>
> --
> Serge Knystautas
> President
> Lokitech >> software . strategy . design >> http://www.lokitech.com
> p. 301.656.5501
> e. sergek@lokitech.com
>
>
> ---------------------------------------------------------------------
> 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: How to Set InternetAddress Personal Name

Posted by Serge Knystautas <se...@lokitech.com>.
Hutson Carspecken wrote:
> I am forwarding e-mails into our company through a gateway e-mail server.  I
> want to keep the original senders personal name, but I also need to attach
> the name of the proxy e-mail server.  So, from this e-mail, I see that the
> sender is:  "Serge Knystautas" <se...@lokitech.com>.  I would like to
> change that so a person in our company receiving e-mail from you would see
> the following:
> 
> "Serge Knystautas" <em...@mycompany.com>
> 
> That is to say, the personal name would remain the original personal name,
> but the e-mail address would be the recipent's own "outward-facing" email
> address...the one which the original sender (in this example, yourself) used
> to reach the company employee.

Ok, makes sense.

> I am making headway with the required code and am somewhat close.  Tell me
> what you think of this code snippet.
> 
> String prevPersonalName;
> 
> Mail myMail = new Mail();
> prevPersonalName = origMail.getMessage().getFrom().getPersonal();
> myMail.getMessage().setPersonal( prevPersonalName);

I think this is just a typo, but I think you meant setPersonal on 
myMail.getMessage().getFrom() (not getMessage()).

I'm not sure why this isn't working for you... maybe it's some strange 
issue where it's updating a copy of the message's From header.

Overall though, I think you have a tough job ahead of you because of the 
following:
a) creating a new message will be very hard because of the amount of 
relevant headers you'd need to copy from the original to the copy.
b) modifying the original is hard because you also have to go sanitize 
the Received headers, and possibly elsewhere as well.  Otherwise someone 
could see what your actual email address is.

Actually, the more I read your idea, the more confused I get.  Why would 
you change the **FROM** of a message.  "Serge Knystautas"'s address 
stays the same... in fact the email address I put as the TO or CC would 
stay the same because it already is the "outward-facing" address, 
otherwise it wouldn't have reached your company employee.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


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


Re: How to Set InternetAddress Personal Name

Posted by Hutson Carspecken <hu...@myprivacypolicy.com>.
 Serge,

Thanks so much for writing about my question!   I am not completely sure
what you mean by "new InterAddress", but let me give you an example of what
I am trying to get done.

I am forwarding e-mails into our company through a gateway e-mail server.  I
want to keep the original senders personal name, but I also need to attach
the name of the proxy e-mail server.  So, from this e-mail, I see that the
sender is:  "Serge Knystautas" <se...@lokitech.com>.  I would like to
change that so a person in our company receiving e-mail from you would see
the following:

"Serge Knystautas" <em...@mycompany.com>

That is to say, the personal name would remain the original personal name,
but the e-mail address would be the recipent's own "outward-facing" email
address...the one which the original sender (in this example, yourself) used
to reach the company employee.

I am making headway with the required code and am somewhat close.  Tell me
what you think of this code snippet.

String prevPersonalName;

Mail myMail = new Mail();
prevPersonalName = origMail.getMessage().getFrom().getPersonal();
myMail.getMessage().setPersonal( prevPersonalName);

Many Thanks,

Hut


----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: "James Users List" <se...@james.apache.org>
Sent: Thursday, July 24, 2003 9:17 PM
Subject: Re: How to Set InternetAddress Personal Name


> Hutson Carspecken wrote:
> > Hello,
> >
> > I am having a hard time setting the InternetAddress value of
PersonalName.  I have done a good deal of reading and have meet with plenty
of failure.  Is there a line of code that someone could share?
>
> Do you mean setting the PersonalName value of InternetAddress?  What
> about new InternetAddress("sergek@lokitech.com", "Serge Knystautas");?
>
> --
> Serge Knystautas
> President
> Lokitech >>> software . strategy . design >> http://www.lokitech.com
> p. 301.656.5501
> e. sergek@lokitech.com
>
>
> ---------------------------------------------------------------------
> 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: How to Set InternetAddress Personal Name

Posted by Serge Knystautas <se...@lokitech.com>.
Hutson Carspecken wrote:
> Hello,
> 
> I am having a hard time setting the InternetAddress value of PersonalName.  I have done a good deal of reading and have meet with plenty of failure.  Is there a line of code that someone could share?

Do you mean setting the PersonalName value of InternetAddress?  What 
about new InternetAddress("sergek@lokitech.com", "Serge Knystautas");?

-- 
Serge Knystautas
President
Lokitech >>> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


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