imap

IMAP Encoded Emails

旧巷老猫 提交于 2019-12-12 06:25:17
问题 I am using Rohit Joshi's IMAP library to access an IMAP email account. So far, I have a program that connects to the mail server, retrieves all unread messages and saves them in an XML file. My problem is that some of the messages come back readable and some comeback encoded and impossible to read. Readable: <Part ID="1"> - <Part ID="1.1"> <DATA>Please respond if you receive this =20 Thanks =20 =20 *******=20 *************=20 =20 </DATA> Unreadable: <Part ID="1"> <DATA

PHP Get string after a specific regex pattern match

烈酒焚心 提交于 2019-12-12 05:25:07
问题 I am using the regex pattern from this SO thread: https://stackoverflow.com/a/11416262/ In the email's body message, there can be multiple emails so I am wanting to grab the email after a specific string: The following users in your Google Apps domain appear to be affected: name@domain.com .... Here is what I am doing: $message = (imap_fetchbody($inbox,$email_number,1.2)); if($message == '') { $message = imap_fetchbody($inbox,$email_number,1); } // Text inside pattern can be made smaller too

Python3 IMAP search special characters

夙愿已清 提交于 2019-12-12 05:17:10
问题 I would like to find a note over IMAP using Python3 and it's IMAP extension. I try to search for a subject which contains special chars as in the example below. Is there a way I can encode the search string to be IMAP compatible? self.connection.search(None, 'ALL', 'SUBJECT "büro"') returns UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 10: ordinal not in range(128) 回答1: You should pass UTF-8 encoded string as the search argument and also need to mention "CHARSET

IMAP client in Java (sockets only) hangs on receiving

≡放荡痞女 提交于 2019-12-12 04:44:58
问题 I want to implement a simple IMAP client. I can connect to server, receive its greeting but it seems I have a problem receiving the response after the login command. I know that in IMAP line ends with \r\n or .\r\n but it seems that reading one byte a time simply does not work here and I do not know why. My code: class NewClass { public static String readAll(Socket socket, String end) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()

imap_fetchbody HTML with strange chars

不羁岁月 提交于 2019-12-12 04:17:47
问题 I need to extract the body from an e-mail code $body = imap_fetchbody($this->stream, $this->msgno, $section); But the output contains some strange chars. In the first HTML tag in the first line <div dir=3D"ltr"> .. Why the 3D ?? output <div dir=3D"ltr"><div class=3D"gmail_quote"><br><table width=3D"100%" cells= pacing=3D"0" cellpadding=3D"0" style=3D"background:#efefef" align=3D"center= " height=3D"auto"><tbody><tr><td><table border=3D"0" cellspacing=3D"0" cell= padding=3D"0" width=3D"700"

Get available space on Gmail account via API python

梦想与她 提交于 2019-12-12 03:44:04
问题 Is there a way(Api or anything..pop/imap in python) via which you can get to know the available space on your Gmail account? 回答1: It appears GMail supports the Quota Extension for IMAP, and at least some information is available that way. On my account, I get this information: > a001 GETQUOTA "" < * QUOTA "" (STORAGE 72600 10601545) The units are in kilobytes. This means I'm using 72 megs, of a total of 10 gigabytes, which appears to match approximately what gmail.com is saying is the current

PHP fsockopen Is Slow

雨燕双飞 提交于 2019-12-12 02:16:47
问题 I'm playing around with the IMAP protocol in PHP using fsockopen to send and receive commands. My preliminary experiments work but are insanely slow. It takes about 2 minutes for the simple function below to run. I've tried several different IMAP servers and have gotten the same result. Can anyone tell me why this code is so slow? <?php function connectToServer($host, $port, $timeout) { // Connect to the server $conn = fsockopen($host, $port, $errno, $errstr, $timeout); // Write IMAP Command

get Sent mail using IMAP

六眼飞鱼酱① 提交于 2019-12-12 01:21:37
问题 I'm trying to fetch my sent mail using IMAP in C# but even after a considerable amount of time, i've not been able to make it work. The output given to me is null even when 12 emails are fetched. Consider the following screenshot The only help/hint i got on stackoverflow is this: get sent mails via imap [UPDATE] This is my code: > ImapClient client = new ImapClient("ExampleHost", port, ssl); > try > { > client.Login("ExampleEmail", "ExamplePass", AuthMethod.Login); > IEnumerable<uint> units =

How to uniquely identify an email with IMAP?

為{幸葍}努か 提交于 2019-12-12 00:05:24
问题 I'm trying to receive and process mails by querying them with IMAP from a mail server. I need guaranteed at-most-once processing. Therefore, I need to be able to detect what mails I have already processed. The IMAP Unique ID cannot serve that purpose because it's validity might change. If that happens I have no way of relating already processed UIDs to the new UIDs that I'm seeing after the change. How can I uniquely identify messages and achieve at-most-once processing? In fact, how are mail

Can we deduplicate emails retrieved through IMAP by hash?

邮差的信 提交于 2019-12-12 00:01:27
问题 I'm trying to achieve at-most-once processing of email messages retrieved over IMAP. (I asked a related question about it.) Is it reliable to compute a cryptographic hash code of the MIME messages retrieved over IMAP to deduplicate them? In other words, why would the same email result in a different result when retrieved over IMAP multiple times? Can an email change it's contents for example when it's moved across folders, or marked as read or for some other reason? I'm using hMailserver on