imap

Why can't I login to an imap server twice in Python

こ雲淡風輕ζ 提交于 2020-01-02 04:16:46
问题 As the error message below states, I cannot log in because I'm in state LOGOUT and not in state NONAUTH. How do I get from LOGOUT to NONAUTH? Example below (obviously the login credentials are faked below) Python 2.7.3 (default, Aug 1 2012, 05:14:39) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import imaplib >>> imap_server = imaplib.IMAP4_SSL("imap.gmail.com",993) >>> imap_server.login('something@myserver.com', 'mypassword') ('OK', [

IMAP folder path encoding (IMAP UTF-7) for Python

一个人想着一个人 提交于 2020-01-02 02:45:06
问题 I would like to know if any "official" function/library existed in Python for IMAP4 UTF-7 folder path encoding. In the imapInstance.list() I get the following path IMAP UTF-7 encoded : '(\\HasNoChildren) "." "[Mails].Test&AOk-"', If I do the following encoding : (u"[Mails].Testé").encode('utf-7') I get : '[Mails].Test+AOk-' Which is UTF-7 but not IMAP UTF-7 encoded. Test+AOk- instead of Test&AOk- I'd need an official function or library to get the IMAP UTF-7 encoded version. 回答1: The

How do I connect to Gmail's IMAP server using oauth in Rails3?

此生再无相见时 提交于 2020-01-02 01:00:14
问题 I found the gmail_xoauth gem, which does most of what I need, but I also need to generate the oauth tokens (consumer_key and consumer_secret) from inside Rails3. I am trying to integrate Gmail's oauth integration into my site and hence cannot use the python script that the above gem refers to. I would like my site to take the user to the authentication page and extract the consumer_key/secret tokens. I am new to OAuth, so maybe there's something obvious that I am missing. UPDATE: I solved the

Processing IMAP email in PHP

戏子无情 提交于 2020-01-01 19:30:14
问题 I need to process an email inbox, monitor it for messages with a particular subject line. If it finds a match I need to get the body content, manipulate, and insert into a database. Ideally would mark the message as read and move it to another IMAP folder as well. I'm poking around PHP documentation imap_open (http://us2.php.net/imap_open) and found a link http://www.linuxscope.net/articles/mailAttachmentsPHP.html#_jmp0_ Before I get too far, I'm wondering if anyone is aware of an existing

How to connect IMAP using AUTHENTICATE PLAIN correctly?

删除回忆录丶 提交于 2020-01-01 05:55:52
问题 I'm using OpenSSL to connect to mail server. POP3 works fine but I have problems with IMAP. Based on CAPABILITY command server supports PLAIN, NTLM and GSS-API authentication methods. I want to use PLAIN because it's easier than others. I have read it's needed to use <NUL> for it. I have run the next variations, but no success: ? login user pass ? login <nul>user<nul>pass ? <nul>login <nul>user<nul>pass What am I doing wrong? 回答1: ? login mymailbox@box.zone mypassword\r\n often servers don't

Get starred messages from GMail using IMAP4 and python

a 夏天 提交于 2020-01-01 05:30:15
问题 I found many dummy info about working with IMAP, but I didn't understand how to use it for my purposes. I found how I can get ALL messages from mailbox and ALL SEEN messages, but how should I work with stars? Please, give me examples of python code for getting starred messages from GMail through IMAP4, for checking if some message is starred or unstarred, for starring and unstarring some one message. 回答1: Gmail's "Starred" state maps directly onto the IMAP \Flagged keyword. So you can toggle

GMail threading, IMAP and Ruby

点点圈 提交于 2020-01-01 02:45:22
问题 I am using the Ruby IMAP library to get a GMail conversation. The way that GMail threads conversations is via "Message-ID" and "In-Reply-To" message headers. For example: In-Reply-To: <c0f07c940909151905w1ad93fabx19cf595f653c8b@mail.gmail.com> Message-ID: <9cd2f5ff0909151911r30ddb805n5172970dffc872c2@mail.gmail.com> I cannot figure out how to efficiently get the replied-to message. The current way: target = <c0f07c940909151905w1ad93fabx19cf595f653c8b@mail.gmail.com> imap.search(["NOT",

Error code 400 on generating OAuth 2 SASL string

瘦欲@ 提交于 2019-12-30 12:13:29
问题 I have generated the following SASL string FOR OAuth 2: user=designadmin@mydesign.mygbiz.com^Aauth=Bearer ya29.AHES6ZTtYOu0NR0vAYbrvKZNcHJPuZEpr4Hk3W3dXcXFQ88^A^A Then i encoded it and sent the encoded string like this: MSB AUTHENTICATE XOAUTH2 encoded string But i get error response as: {"status":"400","schemes":"Bearer","scope":"https://mail.google.com/"} What does this error mean and how can i correct it? 回答1: I finally figured it out. In my case, the Gmail scope("https://mail.google.com/"

PHP IMAP decoding messages

牧云@^-^@ 提交于 2019-12-28 02:05:07
问题 I have emails sent via base64 encoding and 8bit encoding. I was wondering how I could check the encoding of the message using imap_fetchstructure (been doing this for about two hours, so lost) and then decode it properly. Gmail and Mailbox (app on iOS) are sending it as 8bit while Windows 8's Mail app is sending it as base64. Either way, I need to decode whether its 8bit or base64 by detecting what type of encoding it has used. Using PHP 5.1.6 (yes, I should update, been busy). I really have

网站web服务器个人博客站开通那些端口合适?

半城伤御伤魂 提交于 2019-12-26 18:10:10
一般网站服务器, 只需要开通80 443 ,(ssh端口默认22,,建议修改) ping命令没有端口,因为ICMP 协议没有到tcp层,仅走ip层, 由于IP层协议是一种点对点的协议,而非端对端的协议,它提供无连接的数据报服务,没有端口的概念 。 端口 服务 说明 21 FTP FTP 服务所开放的端口,用于上传、下载文件。 22 SSH SSH 端口,用于通过命令行模式 远程连接 Linux 服务器或vps。 23 Telnet Telnet 端口,用于 Telnet 远程登录服务器。 25 SMTP SMTP 服务所开放的端口,用于发送邮件。 80 HTTP 用于 HTTP 服务提供访问功能,例如,IIS、Apache、Nginx 等服务。 您可以参阅 检查 TCP 80 端口是否正常工作 排查 80 端口故障。 110 POP3 用于 POP3 协议,POP3 是电子邮件收发的协议。 143 IMAP 用于 IMAP(Internet Message Access Protocol)协议,IMAP 是用于电子邮件的接收的协议。 443 HTTPS 用于 HTTPS 服务提供访问功能。HTTPS 是一种能提供加密和通过安全端口传输的一种协议。 1433 SQL Server SQL Server 的 TCP 端口,用于供 SQL Server 对外提供服务。 1434 SQL