如何确认电子邮件来源 [英] how to confirm email source
问题描述
我从smtp服务器发送电子邮件,例如,将从
设置为 anyemail@anydomain.com 。收件人将认为电子邮件来自 anydomain
。如何确认电子邮件来源?
I send an email from my smtp server, for example, setting From
to anyemail@anydomain.com. The recipient will think that email comes from anydomain
. How to confirm the email source?
推荐答案
有几种处理电子邮件伪造的方法:
There are several approaches to dealing with email forgery:
- Use PGP or SSL signed certificates
- Use SPF
- check the
Received
headers (although this isn't reliable) - reply back to the sender and ask if they actually sent it. If you know the sender, maybe ask them in person or over the phone.
要实现的主要是,From:address没有任何形式的保证信息的发起人。
The main thing to realise is that the From: address isn't any form of guarantee about the originator of a message.
编辑:好的,我现在明白,你只是试图标记邮件的某种方式,以便你可以识别哪个服务器生成它(以非安全的方式)。以下是使用.NET的MailMessage的方式:
okay I now understand that you're just trying to tag the mail message somehow so that you can recognise which server generated it (in a non-secure way). Here's how using .NET's MailMessage:
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
msg.Headers.Add("X-Is-Development", "true");
这篇关于如何确认电子邮件来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!