2007年04月09日 星期一 18:13
请问这里有人熟悉 qmail配置的么
我用 python 中的 smtplib 连接自己配置的 qmail 服务器遇到身份验证困难
身份验证方式是 ESMTP, 现在的情况是通过
s = smtplib.SMTP("localhost")
s.ehlo()
s.esmtp_features["auth"] = "LOGIN PLAIN" # 关键的一句
s.debuglevel = 5
s.login("...", "...")
这段代码可以链接成功。
(参考了 http://blog.czug.org/panjy/2006/6/dui163youxiangdezhichi/blogentry_view?month:int=1&year;:int=2007,
以及 http://python.cn/pipermail/python-chinese/2004-May/001317.html
等很多讨论)
但因为我在 django 中调用,修改 django 自身的源代码 mail.py 会很麻烦。
我想知道 qmail 如何设置为默认使用 "PLAIN" 方式身份验证。 从服务器端配置来解决这个问题。
2007年04月09日 星期一 22:17
On 4/9/07, Neil(ľҰºü) <chenrong2003在gmail.com> wrote: > > ÇëÎÊÕâÀïÓÐÈËÊìϤ qmailÅäÖõÄô > ÎÒÓà python ÖÐµÄ smtplib Á¬½Ó×Ô¼ºÅäÖÃµÄ qmail ·þÎñÆ÷Óöµ½Éí·ÝÑéÖ¤À§ÄÑ > Éí·ÝÑéÖ¤·½Ê½ÊÇ ESMTP, ÏÖÔÚµÄÇé¿öÊÇͨ¹ý > > s = smtplib.SMTP("localhost") > s.ehlo() > s.esmtp_features["auth"] = "LOGIN PLAIN" # ¹Ø¼üµÄÒ»¾ä > s.debuglevel = 5 > s.login("...", "...") > > Õâ¶Î´úÂë¿ÉÒÔÁ´½Ó³É¹¦¡£ > £¨²Î¿¼ÁË > http://blog.czug.org/panjy/2006/6/dui163youxiangdezhichi/blogentry_view?month:int=1&year;:int=2007 > £¬ > ÒÔ¼° http://python.cn/pipermail/python-chinese/2004-May/001317.html > µÈºÜ¶àÌÖÂÛ£© > > µ«ÒòΪÎÒÔÚ django Öе÷Óã¬ÐÞ¸Ä django ×ÔÉíµÄÔ´´úÂë mail.py »áºÜÂé·³¡£ > ÎÒÏëÖªµÀ qmail ÈçºÎÉèÖÃΪĬÈÏʹÓà "PLAIN" ·½Ê½Éí·ÝÑéÖ¤¡£ ´Ó·þÎñÆ÷¶ËÅäÖÃÀ´½â¾öÕâ¸öÎÊÌâ¡£ Èç¹û²»ÊÇpythonµÄÎÊÌâ¡£ÊDz»Êǵ½qmailµÄIRCÎʸüÓÐЧ¡£qmail µÄÎĵµÖÐÓ¦¸ÃдÁË¡£ÎÒÓÃpostfixºÃÏñÓа취ֱ½ÓÉèÖõġ£ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070409/f884267d/attachment.html
2007年04月10日 星期二 00:32
def login():
server=smtplib.SMTP('ip')
server.set_debuglevel(1)
server.login('kongxiangbo在haaaa','yarshure')
return server
qmail.postfix all ok
ÔÚ07-4-9£¬Ben Luo <benluo在gmail.com> дµÀ£º
>
>
>
> On 4/9/07, Neil(ľҰºü) <chenrong2003在gmail.com> wrote:
> >
> > ÇëÎÊÕâÀïÓÐÈËÊìϤ qmailÅäÖõÄô
> > ÎÒÓà python ÖÐµÄ smtplib Á¬½Ó×Ô¼ºÅäÖÃµÄ qmail ·þÎñÆ÷Óöµ½Éí·ÝÑéÖ¤À§ÄÑ
> > Éí·ÝÑéÖ¤·½Ê½ÊÇ ESMTP, ÏÖÔÚµÄÇé¿öÊÇͨ¹ý
> >
> > s = smtplib.SMTP("localhost")
> > s.ehlo()
> > s.esmtp_features["auth"] = "LOGIN PLAIN" # ¹Ø¼üµÄÒ»¾ä
> > s.debuglevel = 5
> > s.login("...", "...")
> >
> > Õâ¶Î´úÂë¿ÉÒÔÁ´½Ó³É¹¦¡£
> > £¨²Î¿¼ÁË http://blog.czug.org/panjy/2006/6/dui163youxiangdezhichi
> > /blogentry_view?month:int=1&year;:int=2007 £¬
> > ÒÔ¼° http://python.cn/pipermail >
> > /python-chinese/2004-May/001317.html<http://python.cn/pipermail/python-chinese/2004-May/001317.html>
> > µÈºÜ¶àÌÖÂÛ£©
> >
> > µ«ÒòΪÎÒÔÚ django Öе÷Óã¬ÐÞ¸Ä django ×ÔÉíµÄÔ´´úÂë mail.py »áºÜÂé·³¡£
> > ÎÒÏëÖªµÀ qmail ÈçºÎÉèÖÃΪĬÈÏʹÓà "PLAIN" ·½Ê½Éí·ÝÑéÖ¤¡£ ´Ó·þÎñÆ÷¶ËÅäÖÃÀ´½â¾öÕâ¸öÎÊÌâ¡£
>
>
> Èç¹û²»ÊÇpythonµÄÎÊÌâ¡£ÊDz»Êǵ½qmailµÄIRCÎʸüÓÐЧ¡£qmail µÄÎĵµÖÐÓ¦¸ÃдÁË¡£ÎÒÓÃpostfixºÃÏñÓа취ֱ½ÓÉèÖõġ£
>
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists<python-chinese-request在lists.python.cn>
> .python.cn <python-chinese-request在lists.python.cn>
> Unsubscribe: send unsubscribe to python-chinese-request在lists<python-chinese-request在lists.python.cn>
> .python.cn <python-chinese-request在lists.python.cn>
> Detail Info: http://python.cn/mailman >
> /listinfo/python-chinese<http://python.cn/mailman/listinfo/python-chinese>
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070410/c2dadcf1/attachment.htm
2007年04月10日 星期二 09:56
谢谢 Ben Luo 和 kongxiangbo 孔祥波, 现在我临时的办法是修改了 /django/core/mail.py,好在不算复杂。可以正常使用了。 在 07-4-10,kongxiangbo 孔祥波<py.konger在gmail.com> 写道: > > > def login(): > server=smtplib.SMTP('ip') > server.set_debuglevel(1) > server.login('kongxiangbo在haaaa','yarshure') > return server > qmail.postfix all ok > 在07-4-9,Ben Luo <benluo在gmail.com> 写道: > > > > > > > > > > On 4/9/07, Neil(木野狐) < chenrong2003在gmail.com> wrote: > > > 请问这里有人熟悉 qmail配置的么 > > > 我用 python 中的 smtplib 连接自己配置的 qmail 服务器遇到身份验证困难 > > > 身份验证方式是 ESMTP, 现在的情况是通过 > > > > > > s = smtplib.SMTP("localhost") > > > s.ehlo() > > > s.esmtp_features["auth"] = "LOGIN PLAIN" # 关键的一句 > > > s.debuglevel = 5 > > > s.login("...", "...") > > > > > > 这段代码可以链接成功。 > > > (参考了 > http://blog.czug.org/panjy/2006/6/dui163youxiangdezhichi/blogentry_view?month:int=1&year;:int=2007 > , > > > 以及 http://python.cn/pipermail > /python-chinese/2004-May/001317.html > > > 等很多讨论) > > > > > > 但因为我在 django 中调用,修改 django 自身的源代码 mail.py 会很麻烦。 > > > 我想知道 qmail 如何设置为默认使用 "PLAIN" 方式身份验证。 从服务器端配置来解决这个问题。 > > > > > > 如果不是python的问题。是不是到qmail的IRC问更有效。qmail > 的文档中应该写了。我用postfix好像有办法直接设置的。 > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists .python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists .python.cn > > Detail Info: http://python.cn/mailman /listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese >
2007年04月10日 星期二 10:07
我觉得可以把你的修改提交回django:),可以把这个设置放到settings中 On 4/10/07, Neil(木野狐) <chenrong2003在gmail.com> wrote: > 谢谢 Ben Luo 和 kongxiangbo 孔祥波, > 现在我临时的办法是修改了 /django/core/mail.py,好在不算复杂。可以正常使用了。 > > 在 07-4-10,kongxiangbo 孔祥波<py.konger在gmail.com> 写道: > > > > > > def login(): > > server=smtplib.SMTP('ip') > > server.set_debuglevel(1) > > server.login('kongxiangbo在haaaa','yarshure') > > return server > > qmail.postfix all ok > > 在07-4-9,Ben Luo <benluo在gmail.com> 写道: > > > > > > > > > > > > > > > On 4/9/07, Neil(木野狐) < chenrong2003在gmail.com> wrote: > > > > 请问这里有人熟悉 qmail配置的么 > > > > 我用 python 中的 smtplib 连接自己配置的 qmail 服务器遇到身份验证困难 > > > > 身份验证方式是 ESMTP, 现在的情况是通过 > > > > > > > > s = smtplib.SMTP("localhost") > > > > s.ehlo() > > > > s.esmtp_features["auth"] = "LOGIN PLAIN" # 关键的一句 > > > > s.debuglevel = 5 > > > > s.login("...", "...") > > > > > > > > 这段代码可以链接成功。 > > > > (参考了 > > http://blog.czug.org/panjy/2006/6/dui163youxiangdezhichi/blogentry_view?month:int=1&year;:int=2007 > > , > > > > 以及 http://python.cn/pipermail > > /python-chinese/2004-May/001317.html > > > > 等很多讨论) > > > > > > > > 但因为我在 django 中调用,修改 django 自身的源代码 mail.py 会很麻烦。 > > > > 我想知道 qmail 如何设置为默认使用 "PLAIN" 方式身份验证。 从服务器端配置来解决这个问题。 > > > > > > > > > 如果不是python的问题。是不是到qmail的IRC问更有效。qmail > > 的文档中应该写了。我用postfix好像有办法直接设置的。 > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists .python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists .python.cn > > > Detail Info: http://python.cn/mailman /listinfo/python-chinese > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- 用彩信更新我的Blog,用照片记录我的生活 http://qingfeng.ushared.com/blog/
2007年04月10日 星期二 17:17
我也不知道提交这个到 django 是否恰当? 因为这个感觉只是我自己邮件服务器设置的不好导致的。应该说目前的这个办法只是个 walk-around, 而不是 solution. 在 07-4-10,清风<paradise.qingfeng在gmail.com> 写道: > 我觉得可以把你的修改提交回django:),可以把这个设置放到settings中 >
Zeuux © 2025
京ICP备05028076号