is there any site to get imap Mail commands list? - imap

i want to learn all commands using in IMAP.
fetch all mails
read particular mail
search particular mail
create folder/label
is there any site to get imap command list?

Sure, read RFC 3501. The IMAP wiki also has plenty of resources for client developers.

Connect to a server via telnet and issue the help command.
Telnet server.com 110

Related

mailbox always empty when checking emails via imap

Our platform is regularly checking some of our clients mailbox looking for answered emails, so far it's been working perfectly but we recently got a client with a strange issue.
When i connect to the IMAP server and search for email on a given period of time (for instance all mails from yesterday), i just get an empty list. But when i check with the client on its mailbox i can see the mail received from yesterday. Her mail client was configured to use POP so i asked her to change to IMAP as POP is supposed to remove email from the mail server. Now she is using IMAP but i still can not see anything on the mail server.
To connect to the IMAP server i am using those instructions:
imap = Net::IMAP.new(server, port, ssl, nil, false) # OK
imap.login(login, pwd) # Authentification Successful
imap.select("INBOX") # Mailbox is OK
To look for email from yesterday i am using those criteria:
imap.search(["SEEN","SINCE","Sep-07-2015"]
imap.search(["SEEN","SINCE","Sep-07-2015"]
I even tried to look into other mailbox in case her mail didn't arrive on Inbox, i have listed her mailboxes with imap.list('', '') even so i can not find any mails. It feels her entire mailbox is empty on the server. Yet i can see her emails on the mail client.
I am at loss on this case and was wondering if anyone has an idea of what could be happening preventing me from discovering any emails via IMAP?
It seems you have incorrect date format: it should be similar to 8-Aug-2002 and not Aug-8-2002. Look here for other options. If that doesn't help, try some easier search with a more broader criteria, something like imap.search(['SUBJECT', 'hello']) and use instead of hello some real subject.
This article also may help.
Cheers!
you can use this syntaxe in php , example for yahoo
$inbox='{imap.mail.yahoo.com:993/imap/ssl/novalidate-cert}Inbox';
$mbox = imap_open($inbox,$username,$password);
imap_search($mbox, 'SINCE "'.date('d M Y',strtotime("-1 days")).'"');

IRC /TOPIC command trimming issue in iOS

I am using Cocoa async socket library in my iOS application to make connection with an IRC server via Tcp sockets. All the IRC commands are working perfectly except /TOPIC command.
When I send a topic command it always trim the first two characters in the response. Please check the example wireshark report below.
It works on other IRC clients (mIRC). How can I identify the root cause of the issue?
If you send your own IRC commands (most IRC clients let you easily inject arbitrary commands with /command here), you have to format it correctly, with a : before the final parameter if it contains spaces:
TOPIC #abcdereh :My name is Clement
Most IRC clients have an alias for /TOPIC that does that stuff for you.
If you are writing your own client, make sure that you handle the following cases:
/TOPIC: send TOPIC #currentchannel
/TOPIC #somechannel send TOPIC #somechannel
/TOPIC Not a channel send TOPIC #currentchannel :Not a channel
/TOPIC #somechannel New Topic send TOPIC #somechannel :New Topic

How can I download all the emails from gmail acount to my local machine

I am newbie on ruby on rails and gems...If any one help me to figure out that any gems or script that downloads all the emails from gmail to my local machine
I heard about ruby 'net/imap'
but using it I am not able to fetch or authenticate
imap = Net::IMAP.new('mail.google.com')
imap.authenticate('LOGIN', 'bmonal125', 'aaaa')
Please suggest me ...
I need any kind of technical suggestion to overcome it
Thanks in advance
Have a look at http://rubydoc.info/gems/gmail, there are detailed examples on how to authenticate and retrieve messages.
If the authentication does not work, it is quite possible that your IMAP access is not configured in gmail. Have a look at support.google.com/mail/troubleshooter/1668960?hl=en#ts=1665018 on how to enable it

Running a PHP script on email arrival in an IMAP Server

I'm trying to implement a webmail in PHP. I would like to write a PHP CLI script which is run on every email arrival to store some parts of (not all of) incoming email into database for search purposes. Then when the user finished searching and chose an email to show, a connection is made to mail server to retrieve the complete email. In order to implement this scenario I need to make some sort of connection among emails within database and mail server.
Since my knowledge of working with mail servers is limited to Zend Framework's API, what I believe I need in order to retrieve an email from an IMAP server is a message number or a message unique id (this later one seems not to be supported by all mail servers).
To this point, I've managed to find .forward (and some other ways) to introduce my PHP CLI script to MTAs to be run on every email arrival. This way I can store emails to database. But this won't do since message unique id is created by MDA so MTA do not know of it and they can not provide it to me. This means I can not find emails later when I want to retrieve them from mail server.
At last, here's my question: Is there a way to introduce a PHP CLI script to a MDA for emails' arrival? If this is dependent on the mail server, which servers do support this and how? My personal choice would be Dovecot or Courier, but any other mail server would do as well.
This is tricky -- there are many ways on how to setup delivery. Some of them work with the underlying mail store directly, bypassing your IMAP server altogether, while others use e.g. Dovecot's facilities.
Have you considered building on top of the notify plugin which ships with Dovecot?
It seems like it's impossible to introduce such a PHP CLI script to IMAP server (at least I'm sure of Dovecot). Anyway, the work around I found for this problem is to use my own PHP script to insert the new mails into IMAP server and retrieve their id's and then store the id in database for future references. To be clear, email are given to my PHP CLI script by MTA, not MDA. As I said before this is done easily using .forward file.
[UPDATE]
Unfortunately it seems this solution can not be implemented as well. The way to insert a new email to IMAP server is APPEND command, and to have the UID of the recently added mail server must support UIDPLUS extension. Neither Dovecot nor Courier supports this extension at the moment! If they did it seems the server would return the UID with a APPENDUID response.
[UPDATE]
It is my bad since Courier does support UIDPLUS. So this solution is valid and the one I'm going to implement.

Any examples of running an smtp server with Rails?

Has anyone seen any examples of how to run an smtp server with Rails hosted on heroku?
I'm interested to send mail to my own smtp server, manipulate the content with rails by adding a footer, adding link tracking etc, then send it out again.
Once I have the data, easy. Not sure where to begin in terms of setting up smtp.
Alternatively, are there any smtp services out there that will simply POST the data to my app?
Take a look at SendGrid here http://sendgrid.com/
They've got some great APIs, and should be able to enable what you want.
If you want inbound email via a post to your application look at cloudmailin.com
It's python, not RoR, but the Lamson project is pretty close to what you are talking about.
http://lamsonproject.org/
(Thanks Zed!)

Resources