summaryrefslogtreecommitdiff
path: root/3rdParty
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-10-09 16:04:25 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2015-10-09 16:04:25 +0200
commitebf669cdbf7854f03113a937605658f100aefd48 (patch)
tree2c3b3a0d5095950e4ab57f3d992f31aa812fb717 /3rdParty
parent66e3a458b3de1bc3e8c4511d6c0cebbb6a346d23 (diff)
downloadaCms-ebf669cdbf7854f03113a937605658f100aefd48.tar.gz
aCms-ebf669cdbf7854f03113a937605658f100aefd48.tar.bz2
updated libquickmail to 0.1.20
Diffstat (limited to '3rdParty')
-rw-r--r--3rdParty/libquickmail/quickmail.c24
-rw-r--r--3rdParty/libquickmail/quickmailprog.c12
2 files changed, 20 insertions, 16 deletions
diff --git a/3rdParty/libquickmail/quickmail.c b/3rdParty/libquickmail/quickmail.c
index 249eeee..d6827ff 100644
--- a/3rdParty/libquickmail/quickmail.c
+++ b/3rdParty/libquickmail/quickmail.c
@@ -41,7 +41,7 @@
#define LIBQUICKMAIL_VERSION_MAJOR 0
#define LIBQUICKMAIL_VERSION_MINOR 1
-#define LIBQUICKMAIL_VERSION_MICRO 19
+#define LIBQUICKMAIL_VERSION_MICRO 20
#define VERSION_STRINGIZE_(major, minor, micro) #major"."#minor"."#micro
#define VERSION_STRINGIZE(major, minor, micro) VERSION_STRINGIZE_(major, minor, micro)
@@ -529,6 +529,7 @@ DLL_EXPORT_LIBQUICKMAIL char* quickmail_get_body (quickmail mailobj)
do {
if ((p = (char*)realloc(result, resultlen + BODY_BUFFER_SIZE)) == NULL) {
free(result);
+ result = NULL;
DEBUG_ERROR(ERRMSG_MEMORY_ALLOCATION_ERROR)
break;
}
@@ -646,26 +647,25 @@ DLL_EXPORT_LIBQUICKMAIL size_t quickmail_get_data (void* ptr, size_t size, size_
char* s;
//generate header part
char** p = &mailobj->buf;
- mailobj->buf = NULL;
str_append(p, "User-Agent: libquickmail v" LIBQUICKMAIL_VERSION NEWLINE);
if (mailobj->timestamp != 0) {
char timestamptext[32];
- if (strftime(timestamptext, sizeof(timestamptext), "%a, %d %b %Y %H:%M:%S %z", localtime(&mailobj->timestamp))) {
+ if (strftime(timestamptext, sizeof(timestamptext), "%a, %d %b %Y %H:%M:%S %z", localtime(&mailobj->timestamp))) {
str_append(p, "Date: ");
str_append(p, timestamptext);
str_append(p, NEWLINE);
}
-#ifdef _WIN32
+#ifdef _WIN32
//fallback method for Windows when %z (time zone offset) fails
- else if (strftime(timestamptext, sizeof(timestamptext), "%a, %d %b %Y %H:%M:%S", localtime(&mailobj->timestamp))) {
- TIME_ZONE_INFORMATION tzinfo;
- if (GetTimeZoneInformation(&tzinfo) != TIME_ZONE_ID_INVALID)
- sprintf(timestamptext + strlen(timestamptext), " %c%02i%02i", (tzinfo.Bias > 0 ? '-' : '+'), (int)-tzinfo.Bias / 60, (int)-tzinfo.Bias % 60);
+ else if (strftime(timestamptext, sizeof(timestamptext), "%a, %d %b %Y %H:%M:%S", localtime(&mailobj->timestamp))) {
+ TIME_ZONE_INFORMATION tzinfo;
+ if (GetTimeZoneInformation(&tzinfo) != TIME_ZONE_ID_INVALID)
+ sprintf(timestamptext + strlen(timestamptext), " %c%02i%02i", (tzinfo.Bias > 0 ? '-' : '+'), (int)-tzinfo.Bias / 60, (int)-tzinfo.Bias % 60);
str_append(p, "Date: ");
str_append(p, timestamptext);
str_append(p, NEWLINE);
}
-#endif
+#endif
}
if (mailobj->from && *mailobj->from) {
str_append(p, "From: <");
@@ -709,7 +709,7 @@ DLL_EXPORT_LIBQUICKMAIL size_t quickmail_get_data (void* ptr, size_t size, size_
str_append(p, mailobj->mime_boundary_body);
str_append(p, NEWLINE);
}
- mailobj->buflen = strlen(mailobj->buf);
+ mailobj->buflen = (mailobj->buf ? strlen(mailobj->buf) : 0);
mailobj->current++;
}
if (mailobj->buflen == 0 && mailobj->current == MAILPART_BODY) {
@@ -737,7 +737,7 @@ DLL_EXPORT_LIBQUICKMAIL size_t quickmail_get_data (void* ptr, size_t size, size_
mailobj->buf = str_append(&mailobj->buf, "Content-Type: ");
mailobj->buf = str_append(&mailobj->buf, (mailobj->bodylist && mailobj->current_attachment->filename ? mailobj->current_attachment->filename : default_mime_type));
mailobj->buf = str_append(&mailobj->buf, NEWLINE "Content-Transfer-Encoding: 8bit" NEWLINE "Content-Disposition: inline" NEWLINE NEWLINE);
- mailobj->buflen = strlen(mailobj->buf);
+ mailobj->buflen = (mailobj->buf ? strlen(mailobj->buf) : 0);
}
}
if (mailobj->buflen == 0 && mailobj->current_attachment && mailobj->current_attachment->handle) {
@@ -973,7 +973,7 @@ DLL_EXPORT_LIBQUICKMAIL const char* quickmail_send (quickmail mailobj, const cha
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
//set callback function for getting message body
curl_easy_setopt(curl, CURLOPT_READFUNCTION, quickmail_get_data);
- curl_easy_setopt(curl, CURLOPT_READDATA, mailobj);
+ curl_easy_setopt(curl, CURLOPT_READDATA, mailobj);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); //set CURLOPT_UPLOAD to 1 to not use VRFY and other unneeded commands
//enable debugging if requested
if (mailobj->debuglog) {
diff --git a/3rdParty/libquickmail/quickmailprog.c b/3rdParty/libquickmail/quickmailprog.c
index f15f52f..c47bed9 100644
--- a/3rdParty/libquickmail/quickmailprog.c
+++ b/3rdParty/libquickmail/quickmailprog.c
@@ -59,7 +59,11 @@
void show_help()
{
printf(
- "Usage: quickmail {-h server | -o filename} [-p port] [-u username] [-w password] -f email [-t email] [-c email] [-b email] [-s subject] [-m mimetype] [-d body] [-a file] [-v]\n" \
+ "Usage: quickmail"
+#ifdef NOCURL
+ "light"
+#endif
+ " {-h server | -o filename} [-p port] [-u username] [-w password] -f email [-t email] [-c email] [-b email] [-s subject] [-m mimetype] [-d body] [-a file] [-v]\n" \
"Parameters:\n" \
" -h server \thostname or IP address of SMTP server\n" \
" -o filename \tname of file to dump the mail content to (- for stdout)\n" \
@@ -99,9 +103,9 @@ int main (int argc, char *argv[])
//show version
#ifdef NOCURL
printf("quickmail %s\n", quickmail_get_version());
-#else
- {
- curl_version_info_data* curlversion = curl_version_info(CURLVERSION_NOW);
+#else
+ {
+ curl_version_info_data* curlversion = curl_version_info(CURLVERSION_NOW);
printf("quickmail %s (with libcurl %s)\n", quickmail_get_version(), (curlversion ? curlversion->version : curl_version()));
}
#endif