使用 Gmail API 添加安全发件人?

Add a safe sender using the Gmail API?

是否可以使用 Gmail API 将地址或域添加到安全发件人列表?当然不是出于恶意

Gmail 本身没有 "safe sender list"。

但是,有两种方法可以达到相同的效果:(a) 将电子邮件地址添加到联系人,and/or (b) 为该电子邮件地址(或域)添加过滤器使邮件始终进入收件箱。

要通过 API 添加联系人,请参阅人员 API 上的 people.createContact 方法:https://developers.google.com/people/api/rest/v1/people/createContact

要通过 API 添加过滤器,请参阅 Gmail API 的 "managing filters":https://developers.google.com/gmail/api/guides/filter_settings