curl,imap , CURL IMAP APPEND command



Tag: curl,imap

I would like to use CURL in order to APPEND emails at the given date.

$ curl -kv -u [email protected]:user 'imap://IP:143' -X 'APPEND INBOX (Mon, 7 Feb > 1994 21:52:25 +0000) {310}' '
Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
From: Fred Foobar <[email protected]>
Subject: afternoon meeting
To: [email protected]
Message-Id: <[email protected]>
MIME-Version: 1.0
Hello Joe, do you think we can meet at 3:30 tomorrow?'

Unfortunately, it's not working, as the email is not passed to the server

C: A003 APPEND (Mon, 7 Feb 1994 21:52:25 +0000) INBOX {310}
S: A003 BAD Missing required argument to Append

I also try by sending the email as a file:

$ curl -kv -u [email protected]:user 'imap://IP:143' -X 'APPEND INBOX (Mon, 7 Feb > 1994 21:52:25 +0000) {310}' -T email.txt

but it still not working

C: A003 APPEND email.txt (\Seen) {318}
S: A003 NO [TRYCREATE] Mailbox does not exist

Any idea?


you don't have to provide the IMAP command, CURL will do that for you. However you have to specify on which folder you're working on.

curl -kv imaps://user:[email protected]/INBOX -T ~/simple.eml



Nutch 2.3 REST curl syntax

I'm trying to use curl to test out the Nutch 2.X REST API. I'm able to start the nutchserver and inject URLS, but I'm having trouble getting the generate step to work. Here's what I've done: curl -i -X POST -H "Content-Type:application/json" http://localhost:8081/job/create -d '{"crawlId":"crawl-01","type":"INJECT","confId":"default","args":{"seedDir":"/Users/username/myNutchFolder/apache-nutch-2.3/runtime/local/urls/"}}' which when I look at...

Sending XML in Curl PHP

I currently send my form data as normal Post. I would like to send it as XML . Current format : name=max Format i need : max Here is my current code : // This is the data to POST to the form. The KEY of the array is the...

incessantly getting null values for reduce function

My data is as follows: { "_id": "33d4d945613344f13a3ee929337b1ca8", "_rev": "1-427c691a5c5f504c6b1d885b6b9ff4bc", "release": { "genres": { "genre": "Electronic" }, "identifiers": { "identifier": [ { "description": "Text", "value": "5 021603 054028", "type": "Barcode" }, { "description": "String", "value": 5021603054028, "type": "Barcode" }, { "value": "MAYKING WAP54CD", "type": "Matrix / Runout" } ] },...

defining specific PHP curl options for specific web page retrieval

I'm trying to scrape this web page: SiriusXMU to get the "now playing" information. Here's the code I've got so far: $timeout = 60; $url = ''; $agent= 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0'; $referer = ''; $header[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; $header[] = "Cache-Control: max-age=0"; $header[] = "Connection:...

JSON decoding in golang

So I tried something based on the example here in my code, and get no data, but no error either. The code is: import ( "io" "fmt" "net/http" "encoding/json" ) type Credential struct { username string `json:"username"` password string `json:"password"` } func login(res http.ResponseWriter, req *http.Request) { if req.Method ==...

Update JIRA ticket status using REST API

I am able to create a ticket in JIRA using CURL command and having a json data handy. curl -D- -u : -X POST --data @< filename> -H "Content-Type: application/json" http://< hostname>:< port>/rest/api/2/issue/ I was now trying to update the status of the ticket generated but was getting the following...

PHP - Search for item by UPC code in

This is the api: but I don't know write the curl code to get the item with UPC: 00040000006039 Where I have to add username and password ?

returning login status in php [CURL] [closed]

how are you? i have a non expected result , it should return "1" when login successfuly , and "0" when login error, and it always return "0" <?php $username = 'admin'; $password = 'admin'; $loginUrl = 'http://localhost/wordpress/wp-login.php'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $loginUrl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'log='.$username.'&pwd='.$password);...

How to obtain accurate latitude and longitude of user machine based on IP address

In my PHP based application i would like to capture the location of user machine when user logs in to the webapp based on IP address. I followed this method: $url = "$ip"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $data = curl_exec($ch); curl_close($ch); i...

XML Post from form using curl PHP

What is the best way to post XML from a form using Curl. I have a HTML Form and i post the data to a new php page and all the fields are collected. How do i collect these fields in XML Format. I can process it from a xml...

json response handling issue

Hi guys I stuck with retrieving json response below is the json output .I novice in this your help would be highly appreciated. { "productHeader" : { "totalHits" : 684 }, "products" : [ { "name" : "Victoria Hotels", "productImage" : { "url" : "" }, "language" : "en", "description"...

Wistia : Uploading file using curl and php

I am trying to upload an mp4 file using curl and php to Wistia video hosting. But i am constantly getting 500 server error in response even though all the parameters seem to be fine. Here is the code where i do a curl call: $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,); curl_setopt($ch,CURLOPT_POST,...

Filling a std string with memcpy does not set length

I have the following code to fill a std::string with a curl get response. struct curl_string { std::string tmpStr; size_t len; }; void init_string(struct curl_string *s) { s->len = 0; } size_t writefunc(void *ptr, size_t size, size_t nmemb, struct curl_string *s) { size_t new_len = s->len + size*nmemb; s->tmpStr.reserve(new_len +...

Rails 4 Api Users Post test failing

I'm building a blog in Rails 4.2 API (for an Angular front end). I'm adding in users with devise (overkill I know), and my controller tests pass for everything. When I try a curl POST request or try to create a user from my Angular app, I get a 406...

How to get all the tags from the tag using PHP DOM?

I am using PHP's curl for getting webpage data, and for extracting <a> tags from the <body> I am using DOM Document, but it is creating an error. <?php $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => "", CURLOPT_RETURNTRANSFER => 1, CURLOPT_USERAGENT => 'Webbot UA' )); $result = curl_exec($ch); curl_close($ch); if...

How to work arround php notice raised incorrecty when posting a string that begins with an @?

I want to perform a post request using PHP and Curl. This is how I set my post parameters: curl_setopt($ch,CURLOPT_POSTFIELDS,array('name'=> $name)); When the String in $name happens to contain an @ character at the beginning I get the following error. [8192] curl_setopt(): The usage of the @filename API for file...


I would like to use CURL in order to APPEND emails at the given date. $ curl -kv -u [email protected]:user 'imap://IP:143' -X 'APPEND INBOX (Mon, 7 Feb > 1994 21:52:25 +0000) {310}' ' Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) From: Fred Foobar <[email protected]> Subject: afternoon meeting To: [email protected]

Using curl to POST obtains a different response than when using requests to POST

I am new to python programming and I have reached an impasse that I can't seem to solve. I am trying to use python requests module to to POST a request to a service in IBM Bluemix. It works fine when I use cURL to make the request but when...

How to copy email from Gmail to my server using PHP IMAP?

How can I copy email from Gmail to my server's /home/email directory after connecting to a Gmail mailbox using PHP's IMAP functionality? I want to retrieve every email as a file in MIME format and I want to download the complete MIME file with PHP, not just the body or...

json_decode is returning a null value instead of an array [on hold]

I am trying to search the keyword email in the decoded data. But it is not able to get the array type from json_decode. Here is the code $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => true, CURLOPT_URL => $url, CURLOPT_USERAGENT => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML,...

Laravel 5.1 AWS S3 Flysytem: AWS HTTP error: cURL error 6: Couldn't resolve host name

I'm on my local environment and are about to enable file uploading to AWS s3, using Laravel 5.1 Flysystem/Filesystem. All setup has been done. I have created a test form, and I'm trying to upload a file. When I push the submit button, I get this absolutely, only too lovable...

PHP - Using CURL to authenticate and download a remote File

I'm trying to use php to post variables to another php on a remote server and on the file at the remote server I want to read the file and force its download. The file on the remote server is not on a public folder, that's why I need to...

Unzip the archive with more than one entry

I'm trying to decompress ~8GB .zip file piped from curl command. Everything I have tried is being interrupted at <1GB and returns a message: ... has more than one entry--rest ignored I've tried: funzip, gunzip, gzip -d, zcat, ... also with different arguments - all end up in the above...

How to execute POST using CURL

How to execute POST using CURL, i have this basic .asp that receives the data via POST and show the result in .JSON format. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Response.ContentType = "application/json" Response.Write("{ ""responseCode"": " + Request("responseCode") + ", ""publication_id"": " + Request("publication_id") + ", ""version"": " + Request("version") + "}") %>...


I want send IMAP command so that I can receive IMAP response. So a short code that easy for undertanding but save space to prevent type all code and faster for the Overflow reader: SSL_write("a0001 login user pass") SSL_read = "* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN...

API Integration

Im new here and Im not a programmer but learning along the way. I have come up against a problem but in your explanation (if any - thanks) dont presume that I know. Hope you can help me solve this. Here are the details: Im trying to integrate Interpire EmailMarketer...

IMAP migration and changes to folder structure

I am using imapcopy on a ubuntu 14.04 server and telnet to migrate and respectively edit heavy imap inboxes accounts. I would like to flatten the folder structure, meaning that I want to select and copy all emails from all children folders into one "Import" folder. I cant seem to...

Permission denied Setuptools

I'm trying install setuptools in my Mac, but when I run command curl -o - | python show a message telling: Processing setuptools-17.1.1-py3.4.egg Removing /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools-17.1.1-py3.4.egg Copying setuptools-17.1.1-py3.4.egg to /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages Adding setuptools 17.1.1 to easy-install.pth file error: [Errno 13] Permission denied:...

Server-Sent Events Polling causing long delays

I have a connector that will call a RESP API using cURL and PHP. I need to call one method every second to check for new messages and then process them. I used the following 2 approaches to handle the messages AJAX Polling using SetInterval(): call the php script once...

Office 365 unified api Object reference not set to an instance of an object

I'm trying to use the new office365 unified api to query the users list and user file. I've created the application in azure management portal, and I gave the permission to the new api application (with the directory and files read) I've created both a client and a webapi application,...

Compile Curl Visual Studio - unresolved external symbol

I need to use a static library of libcurl and I found this github rep that generate the libraries. Now, I'm trying to compile a simple piece of code that use curl using the static library, libcurl_a.lib, but without success. At first, I miss the -DCURL_STATICLIB flag and I got...

CORS, Client vs. Server & Rails API GET Request

I've built a GET Rails API that checks for an access token and that the registered request.env["HTTP_X_REAL_IP"] matches the IP address that is registered within the admin panel of the app. Example request: The API works great when I'm making requests from a server by curling the request or...

PHP Multiple cURL requests to REST API stalls

Currently I have a system that sends multiple requests to a REST API. It is structured something like this: foreach ($data as $d) { $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_POST, 1); curl_setopt( $ch, CURLOPT_HTTPHEADER, (array of data here)); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec( $ch ); $retry...

file download with curl and php

I wrote a php function that downloads some (.exe) files using curl extension. The file gets successfully downloaded, but when I try to open it I get not compatible error. I opened it using notepad++ and there I see a '200' added to the beginning of the file. I can't...

Authenticate with through PHP cURL (SSL connect error)

I am trying to extract data from a Micorosft Dynamics CRM 2015 with PHP. From various sources i learned that i had to start with an authentication with I am sending an XML request using cURL that results in a SSL connect error. The XML request: <s:Envelope xmlns:s="" xmlns:a=""...

How to use curl return value in php script

I have two servers: A where WP is installed on one, and B where it's not. Application run on B is trying to use WP credentials for login. I have a login form on server B: <h1>Login</h1> <div> <form class="forma" id="form" action="login.php" method="POST"> <div class="form-group"> <label>Username</label> <input class="form-control" type="text" name="username"...

Understanding curl request

I got following line along with the response. How to force that connection is closed after the response? Connection #0 to host localhost left intact curl command: curl -v --user uname:password -H "Accept: application/xml" http://localhost:8090/services/VariableService/variableService/...

curl php response 204 to download zip file

I need a download a file to remote server. But i can't do it with curl in php. The code is: $ch = curl_init($source); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_BUFFERSIZE, 8096); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); var_dump(curl_exec($ch)); print_r(curl_getinfo($ch)); die; The result is: string(0) "" Array ( [url] => [content_type]...

What certificates does 'curl' use by default?

What certificates does 'curl' use by default? Example: curl -I -L fails on Ubuntu 15.04 with curl: (60) SSL certificate problem: unable to get local issuer certificate But when I add the root certificate (see and run curl -I -L --cacert downlaodedCert.pem everything is fine. So I...

how to keep curl from deleteing log.txt when adding new entry?

I am trying to do: create a bash script that downloads the Ubuntu iso and a file from my own ftp server. Then do a traceroute to my server and save route/date and avg speed of the two downloads to log.txt. Where i am stuck: This seems to do okay...

How to change the subject info of gmail into chinese character?

I got a string =?GB2312?B?zbO8xtGnu/m0ocq10bXP7sS/?= with $overview[0]->subject; in imap_fetch_overview function . How to change the subject info of gmail into chinese character?...

JavaScript/Node + cURL

I have a line of cURL: curl -X POST --form "[email protected] Harris - Thinking About You (Tez Cadey Remix)_165299184_soundcloud.mp3" I'm building a hybrid mobile app with Meteor/Ionic as the framework. Therefore, I have access to any Node library that leverages cURL. Can anyone: 1) Suggest one of the many...

Does cURL increase bounce rate on Google Analytics report?

While developing website up time monitoring application, I do send a cURL request to see whatever the site is running or down, If down then it also try to detect the reason. Therefore I send a cURL request. But my question is, does Google Analytics count it under bounce rate?...

php how to send this data threw curl

I have to send this data threw curl: -d '{"payer": { "default_payment_instrument":"BANK_ACCOUNT", "allowed_payment_instruments":["BANK_ACCOUNT"], "default_swift":"FIOBCZPP", "contact":{"first_name":"First", "last_name":"Last", "email":"[email protected]" } }, }' How am I supposed to save those data into fields variable? $fields = { "payer": { "default_payment_instrument":"BANK_ACCOUNT", "allowed_payment_instruments":["BANK_ACCOUNT"], "default_swift":"FIOBCZPP", "contact":{"first_name":"First", "last_name":"Last",...

Why can't curl download the ffmpeg-2.7.tar.bz2?

I'm working on OS X Yosemite 10.10.2. I want to use curl command to download the ffmpeg-2.7.tar.bz2 as following: curl -O It can't work. However it works fine with other url. The message as following when add the --verbose option: $ curl --verbose -O * Hostname was NOT...

sparql insert with where clause

How to insert insert query with "where" condition in 4store sparql As far as I have searched I got to know that we have to use curl command for the same.I tried using this Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","curl -i -d 'update=INSERT+DATA+{+?subject2+<>+?subject3+.+}+WHERE+{+?subject2+<http://localhost:2020/vocab/Schema_feature>+\""+first[0]+"\"+.+?subject3+<http://localhost:2020/vocab/Schema_feature>+\""+first[1]+"\"+.+}' http://localhost:8000/update/"});...

Slow CURL CentOS7 with “same” link

I just installed CentOS7 (3.10.0-229.4.2.el7.x86_64) with nginx (1.8.0). Here my hosts file: [[email protected]_main1 ~]# cat /etc/hosts localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 And problem: [[email protected]_main1 ~]# time curl {"OK"} real 0m0.162s user 0m0.003s sys 0m0.003s [[email protected]_main1 ~]# time curl...

How do I silence the HEAD of a curl request while using the silent flag?

When I run the curl command and direct the data to a file, I get back the content of the site as expected. $ curl "" > file.txt $ head file.txt Top of site ... However, this command shows a progress bar, which I do not want: % Total %...

python requests with redirection

Trying to authenticate on site, noticed that there were a redirect to Found that there were 302 POST with plain credentials in data form. Copying headers from Chrome can reproduce that in cURL, but still can't reach in requests module. Warning: page is full of russian letters, registration...