curl,imap , CURL IMAP APPEND command


CURL IMAP APPEND command

Question:

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]iam.edu
Message-Id: <[email protected]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
               C:
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?


Answer:

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

see http://curl.haxx.se/libcurl/c/imap-append.html


Related:


Server-Sent Events Polling causing long delays


javascript,php,jquery,curl,server-sent-events
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...

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


php,html,dom,curl
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 => "http://www.google.co.in/?gfe_rd=cr&ei=B5GBVezbDeHA8geU8pfYBw", CURLOPT_RETURNTRANSFER => 1, CURLOPT_USERAGENT => 'Webbot UA' )); $result = curl_exec($ch); curl_close($ch); if...

How to use curl return value in php script


php,wordpress,curl,login
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"...

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


curl,ffmpeg
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 http://ffmpeg.org/releases/ffmpeg-2.7.tar.bz2 It can't work. However it works fine with other url. The message as following when add the --verbose option: $ curl --verbose -O http://ffmpeg.org/releases/ffmpeg-2.7.tar.bz2 * Hostname was NOT...

Update JIRA ticket status using REST API


curl,jira,jira-rest-api,jira-rest-java-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...

curl php response 204 to download zip file


php,curl,remote-server
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] => http://example.com/example.zip [content_type]...

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


php,gmail,imap
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?...

Slow CURL CentOS7 with “same” link


curl,dns,centos,hosts
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 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 arm.site.com kpp.site.com w.site.com server.site.com And problem: [[email protected]_main1 ~]# time curl http://arm.site.com/test/fad/site/site?siteId=152 {"OK"} real 0m0.162s user 0m0.003s sys 0m0.003s [[email protected]_main1 ~]# time curl...

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


php,gmail,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...

Nutch 2.3 REST curl syntax


rest,curl,nutch
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...

How to execute POST using CURL


post,curl,asp-classic
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") + "}") %>...

python requests with redirection


python,authentication,redirect,curl,python-requests
Trying to authenticate on http://72.ru site, noticed that there were a redirect to https://loginka.ru/auth/. 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...

Rails 4 Api Users Post test failing


ruby-on-rails,curl,rails-api
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...

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


php,json,curl,error-handling
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,...

What certificates does 'curl' use by default?


curl,certificate
What certificates does 'curl' use by default? Example: curl -I -L https://cruises.webjet.com.au 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 https://www.ssllabs.com/ssltest/analyze.html?d=cruises.webjet.com.au&latest) and run curl -I -L --cacert downlaodedCert.pem https://cruises.webjet.com.au everything is fine. So I...

JSON decoding in golang


json,curl,go
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 ==...

Compile Curl Visual Studio - unresolved external symbol


c++,curl,static-libraries,unresolved-external
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


ruby-on-rails,ruby,api,curl,client
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: https://staging.mysite.com/api/v1/products?access_token=7b9f3cddd3914a6f45fa692997fe6dc9 The API works great when I'm making requests from a server by curling the request or...

JavaScript/Node + cURL


javascript,node.js,curl,meteor
I have a line of cURL: curl -X POST --form "[email protected] Harris - Thinking About You (Tez Cadey Remix)_165299184_soundcloud.mp3" https://api.idolondemand.com/1/api/async/recognizespeech/v1 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...

defining specific PHP curl options for specific web page retrieval


php,curl
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 = 'http://www.siriusxm.com/siriusxmu'; $agent= 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0'; $referer = 'http://www.siriusxm.com/channellineup/'; $header[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; $header[] = "Cache-Control: max-age=0"; $header[] = "Connection:...

IMAP migration and changes to folder structure


email,imap,dovecot
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...

API Integration


xml,api,curl
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 BAD [CLIENTBUG] Invalid tag


imap
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...

Sending XML in Curl PHP


php,xml,curl
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...

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


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

file download with curl and php


php,curl,download
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...

returning login status in php [CURL] [closed]


php,wordpress,curl,login
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 keep curl from deleteing log.txt when adding new entry?


bash,curl,logging
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...

PHP Multiple cURL requests to REST API stalls


php,rest,cakephp,curl
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...

PHP - Using CURL to authenticate and download a remote File


php,curl
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...

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


php,post,curl,encoding
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...

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


php,curl,geolocation,latitude-longitude
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 = "http://freegeoip.net/json/$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...

CURL IMAP APPEND command


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]

Filling a std string with memcpy does not set length


c++,curl
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 +...

Authenticate with login.microsoftonline.com through PHP cURL (SSL connect error)


php,ssl,curl,dynamics-crm-2015
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 login.microsoftonline.com. I am sending an XML request using cURL that results in a SSL connect error. The XML request: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"...

XML Post from form using curl PHP


php,xml,curl
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...

Does cURL increase bounce rate on Google Analytics report?


php,curl,google-analytics
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


php,arrays,object,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",...

Permission denied Setuptools


python,django,curl,setuptools
I'm trying install setuptools in my Mac, but when I run command curl https://bootstrap.pypa.io/ez_setup.py -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:...

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


curl,file-upload,amazon-s3,laravel-5,host
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...

sparql insert with where clause


curl,sparql,4store
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+<http://www.w3.org/2002/07/owl/sameAs>+?subject3+.+}+WHERE+{+?subject2+<http://localhost:2020/vocab/Schema_feature>+\""+first[0]+"\"+.+?subject3+<http://localhost:2020/vocab/Schema_feature>+\""+first[1]+"\"+.+}' http://localhost:8000/update/"});...

json response handling issue


php,json,curl
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" : "http://hotels.com/hotels/9000000/8640000/8633700/8633672/8633672_20_b.jpg" }, "language" : "en", "description"...

PHP - Search for item by UPC code in Itemmaster.com


php,curl,upc
This is the api: https://api.itemmaster.com/v2/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 ?

Unzip the archive with more than one entry


linux,curl,zip,pipe,archive
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...

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


php,curl,header,office365
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,...

Understanding curl request


curl
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/...

incessantly getting null values for reduce function


curl,couchdb
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" } ] },...

Wistia : Uploading file using curl and php


php,curl,wistia
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,...

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


python,curl
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...