imap

Know if email was a reply using IMAP in PHP

蓝咒 提交于 2019-12-18 13:53:25
问题 I am not sure if it is in the headers or not, but I am looking for a way to tell if an email I receive is a response to an email I sent, and if so, to only grab the new text, not "quoted text" A little background: I am creating a script that will send out emails automatically. I am creating a cron job to run at periodic intervals to check to see if there were any replies. If there were replies, I only want to grab the new stuff, and not the old stuff. In the past, I would send out emails with

How IMAP idle works?

不打扰是莪最后的温柔 提交于 2019-12-18 12:41:05
问题 Can someone explain to me how IMAP IDLE works? Does it fork a new process for each connection that it opens? Can I somehow use eventmachine with it? I am trying to implement it in ruby on heroku with background workers. Any thoughts? 回答1: In Ruby 2.0 and up, there's an idle method that accepts a code block that will be called every time you get an untagged response. Once you got this response, you need to break out and pull the emails that came in. The idle call is also blocking, so you need

IMAP: how to move a message from one folder to another

此生再无相见时 提交于 2019-12-18 11:21:34
问题 (using the IMAP commands, not with the assistance of any other mail package) 回答1: I'm not sure how well-versed you are in imap-speak, but basically after login, "SELECT" the source mailbox, "COPY" the messages, and "EXPUNGE" the messages (or "DELETE" the old mailbox if it is empty now :-). a login a s b select source c copy 1 othermbox d store 1 +flags (\Deleted) e expunge would be an example of messages to send. ( Note : imap messages require a uniqe prefix before each command, thus the "a b

Python, IMAP and GMail. Mark messages as SEEN

℡╲_俬逩灬. 提交于 2019-12-18 10:47:44
问题 I have a python script that has to fetch unseen messages, process it, and mark as seen (or read) I do this after login in: typ, data = self.server.imap_server.search(None, '(UNSEEN)') for num in data[0].split(): print "Mensage " + str(num) + " mark" self.server.imap_server.store(num, '+FLAGS', '(SEEN)') The first problem is that, the search returns ALL messages, and not only the UNSEEN. The second problem is that messages are not marked as SEEN. Can anybody give me a hand with this? Thanks!

how to download mails attachment to a specific folder using IMAP and php

早过忘川 提交于 2019-12-18 10:26:15
问题 i am developing a site in which users can mail tickets and attach any type of files to a specific mail id. I need to add the mail subject, content and attachment to the database. I am doing this using cron. Except the attachments every thing works perfect. I have seen some post which create download links. Since i am using cron i can't do it manually. $hostname = '{xxxx.net:143/novalidate-cert}INBOX'; $username = 'yyy@xxxx.net'; $password = 'zzzz'; /* try to connect */ $inbox = imap_open(

Using spring integration IMAP adapter, how to fetch an email which was marked “unread” manually?

夙愿已清 提交于 2019-12-18 08:26:36
问题 I have a piece of code which uses spring integration's IMAP adapter to poll an inbox to read all incoming emails which are unread and that works perfectly. But if I open any email message and and then mark it as "unread" in my outlook inbox the poller doesn't fetch the marked email. I can use the pop3 adapter which fetches all the email, but deletes them afterwords, but I want to keep the emails in my inbox and I want the poller to fetch all the email which are unseen. Any suggestions to

Using python imaplib to “delete” an email from Gmail?

自闭症网瘾萝莉.ら 提交于 2019-12-18 03:16:12
问题 Can you delete emails with imaplib? If so how? 回答1: Use the store method (of the IMAP4 object representing your connection) to set the r'\Deleted' flag on the message number you want to delete, as the example in the docs show; then the expunge method to actually perform all deletions so marked. Gmail's implementation of IMAP has subtly different semantics, by default, but if you want you can tweak it to behave much more like a traditional IMAP implementation (where the above sequence works) -

Python imaplib fetch body emails gmail

对着背影说爱祢 提交于 2019-12-18 01:14:29
问题 I read this already and wrote this script to fetch body for emails in some mail box which title begins with '$' and is sent by some sender. import email, getpass, imaplib, os detach_dir = "F:\PYTHONPROJECTS" # where you will save attachments user = raw_input("Enter your GMail username --> ") pwd = getpass.getpass("Enter your password --> ") # connect to the gmail imap server m = imaplib.IMAP4_SSL("imap.gmail.com") m.login(user, pwd) m.select("PETROLEUM") # here you a can choose a mail box

JavaMail reading recent unread mails using IMAP

家住魔仙堡 提交于 2019-12-17 19:14:20
问题 I have a requirement to retrieve unread mails from Gmail. I am using Java Mail API. By default, this API retrieves mails from the oldest to newest. But I need to retrieve recent mails first. Is it possible? Thanks in advance. 回答1: Here is example. Do not forget to add javax.mail in your classpath. import javax.mail.*; import javax.mail.search.FlagTerm; import java.util.*; public class GmailFetch { public static void main( String[] args ) throws Exception { Session session = Session

Certificate error using IMAP in PHP

a 夏天 提交于 2019-12-17 18:35:43
问题 I used up all possible combinations of hostname but I always either get a certificate error or just IMAP connection broken. Certificate failure for imap.froiden.com: Server name does not match certificate: /O=imap.mailhostbox.com/OU=Go to https://www.thawte.com/repository/index.html/OU=Thawte SSL123 certificate/OU=Domain Validated/CN=imap.mailhostbox.com Hostname which I used is ' {imap.froiden.com}INBOX '. ANy suggestion to solve this error? 回答1: The certificate is plain invalid. You should