简体   繁体   English

使用Java发送邮件时是否可以屏蔽/欺骗电子邮件地址

[英]Is it possible to mask/spoof email address while sending mail in Java

In simple word, whenever I will send mail to anyone (within same mail server) it should appears some fake email address ie fakemail@gmail.com but, when they reply to this mail, it should come to my actual email address that is realname@gmail.com . 在简单的一句话,每当我会发邮件给任何人(同一邮件服务器内),它应该会出现一些假的电子邮件地址即fakemail@gmail.com但是,当他们回复此邮件时,它应该来我的实际电子邮件地址是realname@gmail.com

Note: My both email addresses will use same domain name, but only difference will be fake and real username for that email. 注意:我的两个电子邮件地址都将使用相同的域名,但是唯一的区别是该电子邮件的假名称和真实用户名。 I needed for the privacy issue. 我需要解决隐私问题。 So, that nobody can reply to my mail directly until I send any mail to them. 因此,在我向他们发送任何邮件之前,没有人可以直接回复我的邮件。

Ask your mail server administrator to setup an email forwarding for you. 请您的邮件服务器管理员为您设置电子邮件转发。

This is not a Java specific question. 这不是Java特定的问题。 What you are asking for is called an Email alias , and is a standard functionality on mail servers. 您要求的是电子邮件别名 ,它是邮件服务器上的标准功能。

您可以使用伪造的“发件人:”字段和有效的“答复人:”字段,但是唯一会被此蒙骗的人是不知道如何发送垃圾邮件的人。

Even if you can (see below) mask the From field, you are giving away your email address in the Reply-To field, so you are still revealing your email address. 即使您可以屏蔽From字段(请参阅下文),也要在“ Reply-To字段中放弃您的电子邮件地址,因此您仍会显示您的电子邮件地址。 (And if you weren't, it wouldn't be possible to reply.) So go with @Anony-Mousse and find a proper solution. (如果不是,那么将无法回复。)因此,请使用@ Anony-Mousse并找到适当的解决方案。

Now, please note that there are two "from" fields: one in the SMTP envelope and another in the message data. 现在,请注意有两个“发件人”字段:一个在SMTP信封中,另一个在邮件数据中。

It is quite uncommon for current mail servers to let you fake the SMTP from, though it may be possible if the server is using raw SMTP without authorization. 当前的邮件服务器允许您伪造SMTP的情况很少见,尽管如果该服务器未经授权使用原始SMTP也可能。

You are more likely to be allowed to send an email with a custom "From" in the message body (which is the one mail clients display, unless you look att all headers). 更有可能允许您在邮件正文中发送带有自定义“发件人”的电子邮件(这是邮件客户端显示的一个邮件,除非您查看所有标头)。 However, the mail server may require that it matches the user you authenticated as. 但是,邮件服务器可能要求它与您验证为的用户匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM