Avoid Gmail's “This message may not have been sent by” using sender header

人走茶凉 提交于 2019-12-04 09:30:54

问题


I'm creating an email a friend type system where I need our mail server to send emails from the user of the site to their friend, i.e. from fred@gmail.com, to tony@gmail.com.

If, as is the case in this example, the user's are both part of Gmail the friend would receive an email with the warning "This message may not have been sent by: fred@gmail.com.

I thought that by then adding a 'sender' header with our email (e.g. us@company.com) this should indicate to Gmail that we are the sender and are effectively openly spoofing the sender at their request. Is this true, can you get around Gmail's warning using the 'sender' header?

I realise this is similar to the following question but I'm more interested in whether the sender header should have an effect: Email sent from web server causes gmail to treat as phishing. How to get rid of this?

More info: I'm using netmailbot to send emails from our mail server using the '-customheader' parameter with 'sender' and 'x-sender' e.g. '-customheader sender:us@company.com x-sender:us@company.com'


回答1:


If gmail doesn't fail miserably, you have no way to suppress this warning.
Google is in control of both accounts and therefore knows, that this mail wasn't send by fred using their infrastructure.
There was used some third party infrastructure (yours) and this is all this warning is about. You can set an arbitrary email address as "from" and Google has no knowledge if this is legitimate use (if fred really wrote the message). Anyone could have written that message. Normally fred would use Googles infrastructure to send mails and then they would know its him.

A cleaner solution would be to put your email address ("noreply@company.com") as from header (that would be honest) and set fred@gmail.com as reply-to header (so he gets the replies).



来源:https://stackoverflow.com/questions/14155604/avoid-gmails-this-message-may-not-have-been-sent-by-using-sender-header

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!