Craiglist电子邮件匿名Python / Django [英] Craiglist Email Anonymizing for Python/Django

查看:154
本文介绍了Craiglist电子邮件匿名Python / Django的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是允许用户发送电子邮件,而不会在我的网站上披露任何人的电子邮件地址。



我的初始选择是创建一个通过我的SMTP服务器发送邮件的表单(我使用gmail),欺骗FROM字段,使其看起来像一个用户到另一个用户。



这似乎很简单,我将其限制在每个唯一的用户对一个电子邮件。最大的问题是Gmail对这种事情非常有帮助,并会自动重写所有FROM和Evelope设置。所以我不能这样做,除非我要使用第三方邮件服务器。



我也读过欺骗从字段可以让你遇到垃圾邮件过滤器的麻烦。是否值得(仅仅因为其他原因)匿名收件人用户的电子邮件地址并显示它(ala Craigslist)?我不知道如何PIPE /解析电子邮件,所以我不知道学习和实现这个功能需要多少时间。



我也看过PHP的类似帖子,但是它们具有陈旧的链接,我想为Python / Django找到一个解决方案。

谢谢,
Brendan

解决方案

您可以在 Catch-All 电子邮件地址设置python的 imaplib



如果您生成了连接到用户的电子邮件地址,然后当有人向@ your-domain.com发送电子邮件时,您可以捕获消息,看看它是否与数据库中的令牌相关,如果是,则将电子邮件转发到用户实际的电子邮件地址。



如果您还要为发件人的电子邮件地址创建一个令牌并存储它,那么您可以将from地址设置为该令牌,以便在响应时如上所述,它也会通过您的服务器弹起。


My goal here is to allow users to email each other without disclosing anyone's email addresses on my website.

My initial choice was to create a form which sent mail through my SMTP server (I'm using gmail), spoofing the FROM field to make it look like it's sent by one user to another user.

That seemed fairly simple and I'm limiting it to one email per unique pair of users. The big problem is that Gmail is finicky about this sort of thing and automatically rewrites all FROM and Evelope settings. So, I can't do this unless I'm going to use a third party mail server.

I've also read that spoofing From fields can get you in trouble with spam filters. Is it worth it for that (and other) reasons to just anonymize the recipient users email address and display it (ala Craigslist)? I have no idea how to PIPE/Parse emails, so I'm not sure how much time it would take to learn and implement this feature.

I've also seen similar posts for PHP but they have stale links and I'd like to find a solution for Python/Django.

Thanks, Brendan

解决方案

Why don't you set up at Catch-All email address python's imaplib.

If you generated a unique token that was connected to the user's email address, then when someone sent an email to @your-domain.com you could catch the message, see if it related to a token in the db and if it did, forward the email on to the users actual email address.

If you were to then also create a token for the sender's email address and store it, then you could set the 'from' address as that token so that when they responded, it also bounced through your server as noted above.

这篇关于Craiglist电子邮件匿名Python / Django的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆