You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brian Weddell <bw...@sbcglobal.net> on 2012/08/24 19:34:40 UTC

Customize "from" and "to" address for emails that come from tomcat

I'm using mail.jar and activation-1.1.jar.

I am able to successfully send mail from Tomcat.

However the emails come from the user running tomcat and the FQDN of the local 
host.

Is there a way to mask this?

For example, instead of:
From: tomcat7@servername.domain.com
[mailto:tomcat7@servername.domain.com]

Is there a way to change it to:
From: mailer@differentdomain.com
[mailto:mailer@differentdomain.com]  

Re: Customize "from" and "to" address for emails that come from tomcat

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian,

On 8/28/12 5:16 PM, bweddell@sbcglobal.net wrote:
> I ended up fixing this at the smtp server.  I added an entry in 
> /etc/postfix/generic with the "undesired address         desired
> address"
> 
> Re-ran the postmap command and reloaded postfix.
> 
> It is somewhat of a hack, but customers won't see a "tomcat at 
> some.local.server.org address".
> 
> They now see "donot-reply at corporate.com".

That's an awful hack and I'm sure you will find that when moving this
software to another machine you'll never figure out why "Tomcat" is
suddenly reverting to sending email messages from a different email
address.

Read the documentation for your email component (which surely uses
JavaMail under the hood) and how to set the "from" header. You can
also look at the JavaMail docs to see what system properties can
affect that kind of thing even if the email component doesn't expose it.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlA9Y/AACgkQ9CaO5/Lv0PBxmQCfQFXzRHhXMDvsFALe+ZUY7yUd
nOsAn1RBr0Mo/DuwZ0lDr5jKMjwA1CJj
=9dlA
-----END PGP SIGNATURE-----

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


Re: Customize "from" and "to" address for emails that come from tomcat

Posted by "bweddell@sbcglobal.net" <bw...@sbcglobal.net>.
I ended up fixing this at the smtp server.  I added an entry in
/etc/postfix/generic with the "undesired address         desired address"

Re-ran the postmap command and reloaded postfix.

It is somewhat of a hack, but customers won't see a "tomcat at
some.local.server.org address".

They now see "donot-reply at corporate.com".




--
View this message in context: http://tomcat.10.n6.nabble.com/Customize-from-and-to-address-for-emails-that-come-from-tomcat-tp4985625p4985926.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

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


Re: Customize "from" and "to" address for emails that come from tomcat

Posted by David kerber <dc...@verizon.net>.
On 8/24/2012 3:41 PM, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Brian,
>
> On 8/24/12 1:34 PM, Brian Weddell wrote:
>> I'm using mail.jar and activation-1.1.jar.
>>
>> I am able to successfully send mail from Tomcat.
>>
>> However the emails come from the user running tomcat and the FQDN
>> of the local host.
>>
>> Is there a way to mask this?
>>
>> For example, instead of: From: tomcat7@servername.domain.com
>> [mailto:tomcat7@servername.domain.com]
>>
>> Is there a way to change it to: From: mailer@differentdomain.com
>> [mailto:mailer@differentdomain.com]
>
> Note that Tomcat does not ship with a component to send emails.
> Whatever component you are using to send emails is providing those
> defaults.
>

And you can change them when you create the message; they're just 
properties.




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


Re: Customize "from" and "to" address for emails that come from tomcat

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian,

On 8/24/12 1:34 PM, Brian Weddell wrote:
> I'm using mail.jar and activation-1.1.jar.
> 
> I am able to successfully send mail from Tomcat.
> 
> However the emails come from the user running tomcat and the FQDN
> of the local host.
> 
> Is there a way to mask this?
> 
> For example, instead of: From: tomcat7@servername.domain.com 
> [mailto:tomcat7@servername.domain.com]
> 
> Is there a way to change it to: From: mailer@differentdomain.com 
> [mailto:mailer@differentdomain.com]

Note that Tomcat does not ship with a component to send emails.
Whatever component you are using to send emails is providing those
defaults.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlA32N0ACgkQ9CaO5/Lv0PDCVQCfbIzSxeCDA+bhuRxV2ZlQuMng
8wcAn1/5BqpVs9+HX8+r87BAa/UYg4ua
=AGjM
-----END PGP SIGNATURE-----

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