include <sys/types.h> for off_t
patch from "lorenzo martignoni" <lorenzo.martignoni@technologist.com> - fixed uploading of message to IMAP server
This commit is contained in:
parent
91d2f60584
commit
77358f1706
18
imap.c
18
imap.c
|
@ -968,11 +968,8 @@ imap_append_message (imap_t * imap, int fd, message_t * msg)
|
||||||
sizeof (flagstr) - strlen (flagstr), ") ");
|
sizeof (flagstr) - strlen (flagstr), ") ");
|
||||||
}
|
}
|
||||||
|
|
||||||
send_server (imap->sock, "APPEND %s%s %s{%d}\r\n",
|
send_server (imap->sock, "APPEND %s%s %s{%d}",
|
||||||
imap->prefix, imap->box->box, flagstr, msg->size + lines);
|
imap->prefix, imap->box->box, flagstr, msg->size + lines);
|
||||||
socket_write (imap->sock, buf, strlen (buf));
|
|
||||||
if (Verbose)
|
|
||||||
fputs (buf, stdout);
|
|
||||||
|
|
||||||
if (buffer_gets (imap->buf, &s))
|
if (buffer_gets (imap->buf, &s))
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -980,7 +977,10 @@ imap_append_message (imap_t * imap, int fd, message_t * msg)
|
||||||
puts (s);
|
puts (s);
|
||||||
|
|
||||||
if (*s != '+')
|
if (*s != '+')
|
||||||
|
{
|
||||||
|
puts ("Error, expected `+' from server (aborting)");
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* rewind */
|
/* rewind */
|
||||||
lseek (fd, 0, 0);
|
lseek (fd, 0, 0);
|
||||||
|
@ -1002,11 +1002,11 @@ imap_append_message (imap_t * imap, int fd, message_t * msg)
|
||||||
end++;
|
end++;
|
||||||
if (start != end)
|
if (start != end)
|
||||||
socket_write (imap->sock, buf + start, end - start);
|
socket_write (imap->sock, buf + start, end - start);
|
||||||
/* if (Verbose)
|
/* only send a crlf if we actually hit the end of a line. we
|
||||||
{
|
* might be in the middle of a line in which case we don't
|
||||||
buf[end] = 0;
|
* send one.
|
||||||
puts (buf + start);
|
*/
|
||||||
} */
|
if (end != len)
|
||||||
socket_write (imap->sock, "\r\n", 2);
|
socket_write (imap->sock, "\r\n", 2);
|
||||||
start = end + 1;
|
start = end + 1;
|
||||||
}
|
}
|
||||||
|
|
1
isync.h
1
isync.h
|
@ -18,6 +18,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#if HAVE_LIBSSL
|
#if HAVE_LIBSSL
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user