Edouard Tisserant 7 years ago
parent
commit
c762e2ec11
28 changed files with 1228 additions and 65 deletions
  1. +1
    -0
      .travis.yml
  2. +4
    -4
      build-mac/dependencies/prepare-cyrus-sasl.sh
  3. +10
    -8
      build-mac/libetpan.xcodeproj/project.pbxproj
  4. +7
    -7
      build-mac/update.sh
  5. +3
    -0
      build-windows/README.md
  6. +0
    -1
      build-windows/build_headers.list
  7. +1
    -1
      build-windows/gen-public-headers.sh
  8. +2
    -0
      build-windows/libetpan-config.h
  9. +1
    -1
      build-windows/libetpan.sln
  10. +200
    -3
      build-windows/libetpan/libetpan.vcxproj
  11. +591
    -0
      build-windows/libetpan/libetpan.vcxproj.filters
  12. +1
    -1
      libetpan-config.h.in
  13. +10
    -0
      src/data-types/mailstream_cfstream.c
  14. +25
    -0
      src/data-types/mailstream_low.c
  15. +4
    -0
      src/driver/interface/mailstorage_tools.c
  16. +22
    -3
      src/low-level/imap/mailimap.c
  17. +10
    -0
      src/low-level/imap/mailimap.h
  18. +2
    -2
      src/low-level/imap/mailimap_extension.c
  19. +2
    -2
      src/low-level/imap/mailimap_extension.h
  20. +243
    -0
      src/low-level/imap/mailimap_parser.c
  21. +41
    -14
      src/low-level/imap/mailimap_sender.c
  22. +2
    -0
      src/low-level/imap/mailimap_types.h
  23. +22
    -6
      src/low-level/imf/mailimf.c
  24. +1
    -1
      src/low-level/imf/mailimf.h
  25. +6
    -4
      src/low-level/imf/mailimf_write_generic.c
  26. +9
    -2
      src/low-level/mime/mailmime_decode.c
  27. +1
    -1
      src/low-level/mime/mailmime_decode.h
  28. +7
    -4
      travis/script.sh

+ 1
- 0
.travis.yml View File

@ -4,3 +4,4 @@ os:
language: c
before_script: travis/before-script.sh
script: travis/script.sh
osx_image: xcode7

+ 4
- 4
build-mac/dependencies/prepare-cyrus-sasl.sh View File

@ -111,27 +111,27 @@ LIB_NAME=$ARCHIVE
TARGETS="iPhoneOS iPhoneSimulator"
SDK_IOS_MIN_VERSION=7.0
SDK_IOS_VERSION="`xcodebuild -version -sdk 2>/dev/null | egrep SDKVersion | tail -n 1 | sed -E -n -e 's|SDKVersion: *(.*) *$|\1|p'`"
SDK_IOS_VERSION="`xcodebuild -showsdks 2>/dev/null | grep iphoneos | sed 's/.*iphoneos\(.*\)/\1/'`"
BUILD_DIR="$tmpdir/build"
INSTALL_PATH="${BUILD_DIR}/${LIB_NAME}/universal"
for TARGET in $TARGETS; do
DEVELOPER="$(xcode-select --print-path)"
SYSROOT="`xcodebuild -version -sdk 2>/dev/null | egrep $TARGET -B 3 | egrep '^Path: '| egrep $SDK_IOS_VERSION | sort -u | tail -n 1| cut -d ' ' -f 2`"
SDK_ID="$(echo "$TARGET$SDK_IOS_VERSION" | tr A-Z a-z)"
SYSROOT="$(xcodebuild -version -sdk "$SDK_ID" 2>/dev/null | egrep '^Path: ' | cut -d ' ' -f 2)"
case $TARGET in
(iPhoneOS)
ARCH=arm
MARCHS="armv7 armv7s arm64"
EXTRA_FLAGS="-miphoneos-version-min=$SDK_IOS_MIN_VERSION"
;;
(iPhoneSimulator)
ARCH=i386
MARCHS="i386 x86_64"
EXTRA_FLAGS="-miphoneos-version-min=$SDK_IOS_MIN_VERSION"
;;
esac
EXTRA_FLAGS="-fembed-bitcode -miphoneos-version-min=$SDK_IOS_MIN_VERSION"
for MARCH in $MARCHS; do
echo "building for $TARGET - $MARCH"


+ 10
- 8
build-mac/libetpan.xcodeproj/project.pbxproj View File

@ -2493,6 +2493,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "@loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = libetpan;
SDKROOT = macosx;
WRAPPER_EXTENSION = framework;
@ -2511,6 +2512,7 @@
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "@loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = libetpan;
SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = YES;
@ -2534,6 +2536,7 @@
OTHER_CFLAGS = (
"-DHAVE_CFNETWORK=1",
"-DHAVE_CONFIG_H=1",
"-DLIBETPAN_IOS_DISABLE_SSL=1",
);
};
name = Debug;
@ -2552,6 +2555,7 @@
OTHER_CFLAGS = (
"-DHAVE_CFNETWORK=1",
"-DHAVE_CONFIG_H=1",
"-DLIBETPAN_IOS_DISABLE_SSL=1",
);
};
name = Release;
@ -2591,6 +2595,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
ENABLE_BITCODE = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
@ -2599,11 +2604,8 @@
"$(SRCROOT)/libsasl-ios/include",
);
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LIBRARY_SEARCH_PATHS = "$(SRCROOT)/libsasl-ios/lib";
OTHER_CFLAGS = (
"$(inherited)",
"-DLIBETPAN_IOS_DISABLE_SSL=1",
);
PRODUCT_NAME = "etpan-ios";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
@ -2616,17 +2618,15 @@
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_BITCODE = YES;
GCC_MODEL_TUNING = G5;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/libsasl-ios/include",
);
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LIBRARY_SEARCH_PATHS = "$(SRCROOT)/libsasl-ios/lib";
OTHER_CFLAGS = (
"$(inherited)",
"-DLIBETPAN_IOS_DISABLE_SSL=1",
);
PRODUCT_NAME = "etpan-ios";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
@ -2644,6 +2644,7 @@
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = etpan;
SDKROOT = macosx;
SKIP_INSTALL = YES;
@ -2659,6 +2660,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
INSTALL_PATH = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = etpan;
SDKROOT = macosx;
SKIP_INSTALL = YES;


+ 7
- 7
build-mac/update.sh View File

@ -7,12 +7,12 @@ logfile="`pwd`/update.log"
cd ..
if test x$1 = xprepare ; then
if test "x$1" = xprepare ; then
echo preparing
./autogen.sh > "$logfile" 2>&1
tar czf build-mac/autogen-result.tar.gz `find . -name '*.in'` configure install-sh config.sub missing config.guess
exit 0
elif test x$1 = xprepare-clean ; then
elif test "x$1" = xprepare-clean ; then
if test -f Makefile ; then
make maintainer-clean >/dev/null
cd build-mac
@ -22,16 +22,16 @@ elif test x$1 = xprepare-clean ; then
exit 0
fi
if test x$SRCROOT = x ; then
if test "x$SRCROOT" = x ; then
echo Should be run from Xcode
exit 1
fi
if test x$ACTION = x ; then
if test "x$ACTION" = x ; then
ACTION=build
fi
if test x$ACTION = xbuild ; then
if test "x$ACTION" = xbuild -o "x$ACTION" = xinstall ; then
md5 build-mac/autogen-result.tar.gz > build-mac/autogen-result.md5.new
if ! cmp -s build-mac/autogen-result.md5 build-mac/autogen-result.md5.new ; then
@ -53,14 +53,14 @@ if test x$ACTION = xbuild ; then
make libetpan-config.h >> "$logfile" 2>&1
md5 build-mac/autogen-result.tar.gz > build-mac/autogen-result.md5
fi
if test x$PLATFORM_NAME = xiphoneos -o x$PLATFORM_NAME = xiphonesimulator ; then
if test "x$PLATFORM_NAME" = xiphoneos -o "x$PLATFORM_NAME" = xiphonesimulator ; then
if test ! -d build-mac/libsasl-ios ; then
# build dependencies for iOS
cd build-mac
sh ./prepare-ios.sh
fi
fi
elif test x$ACTION = xclean ; then
elif test "x$ACTION" = xclean ; then
if test -f Makefile ; then
make distclean >/dev/null
cd build-mac


+ 3
- 0
build-windows/README.md View File

@ -10,8 +10,10 @@ In case you just need a binary build of libEtPan:
Also, you'll need all the dependencies, download the most recent binary builds in:
- [Cyrus SASL](http://d.etpan.org/mailcore2-deps/cyrus-sasl-win32/)
- [zlib](http://d.etpan.org/mailcore2-deps/zlib-win32/)
- [OpenSSL](http://d.etpan.org/mailcore2-deps/misc-win32/)
- [SASL](http://d.etpan.org/mailcore2-deps/cyrus-sasl-win32/)
### Build using Visual Studio 2013 ###
@ -19,6 +21,7 @@ You'll need all the dependencies, download the most recent binary builds in:
- [zlib](http://d.etpan.org/mailcore2-deps/zlib-win32/)
- [OpenSSL](http://d.etpan.org/mailcore2-deps/misc-win32/)
- [SASL](http://d.etpan.org/mailcore2-deps/cyrus-sasl-win32/)
#### Instructions for zlib ####


+ 0
- 1
build-windows/build_headers.list View File

@ -152,7 +152,6 @@ src\low-level\smtp\mailsmtp_socket.h
src\low-level\smtp\mailsmtp_ssl.h
src\low-level\smtp\mailsmtp_types.h
src\main\libetpan.h
src\main\libetpan_version.h
src\windows\win_etpan.h
build-windows\libetpan-config.h
build-windows\libetpan_version.h

+ 1
- 1
build-windows/gen-public-headers.sh View File

@ -23,7 +23,7 @@ list_headers()
}
cd ../src
list_headers libetpan.h | sort
list_headers libetpan.h | grep -v libetpan_version.h | sort
echo src\\windows\\win_etpan.h
echo build-windows\\libetpan-config.h
echo build-windows\\libetpan_version.h

+ 2
- 0
build-windows/libetpan-config.h View File

@ -80,7 +80,9 @@
#include <limits.h>
#ifdef _MSC_VER
# define MMAP_UNAVAILABLE
# ifndef __cplusplus
# define inline __inline
# endif
#else
# include <sys/param.h>
#endif


+ 1
- 1
build-windows/libetpan.sln View File

@ -4,7 +4,7 @@ VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B2C11050-3E46-4E10-B734-F9203A75AA46}"
ProjectSection(SolutionItems) = preProject
README.txt = README.txt
README.md = README.md
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libetpan", "libetpan\libetpan.vcxproj", "{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"


+ 200
- 3
build-windows/libetpan/libetpan.vcxproj View File

@ -100,7 +100,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/DLL %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>libsasl.lib;zdll.lib;Ws2_32.lib;ssleay32.lib;libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libsasl2.lib;zlib.lib;Ws2_32.lib;ssleay32MDd.lib;libeay32MDd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>../../third-party/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>C;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@ -132,7 +132,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/DLL %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>libsasl2.dll;zlib.lib;Ws2_32.lib;ssleay32MDd.lib;libeay32MDd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libsasl2.lib;zlib.lib;Ws2_32.lib;ssleay32MDd.lib;libeay32MDd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>../../third-party/lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>C;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@ -405,8 +405,205 @@ build_headers.bat
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\data-types\base64.h" />
<ClInclude Include="..\..\src\data-types\carray.h" />
<ClInclude Include="..\..\src\data-types\charconv.h" />
<ClInclude Include="..\..\src\data-types\chash.h" />
<ClInclude Include="..\..\src\data-types\clist.h" />
<ClInclude Include="..\..\src\data-types\connect.h" />
<ClInclude Include="..\..\src\data-types\hmac-md5.h" />
<ClInclude Include="..\..\src\data-types\mail.h" />
<ClInclude Include="..\..\src\data-types\maillock.h" />
<ClInclude Include="..\..\src\data-types\mailsasl.h" />
<ClInclude Include="..\..\src\data-types\mailsasl_private.h" />
<ClInclude Include="..\..\src\data-types\mailsem.h" />
<ClInclude Include="..\..\src\data-types\mailstream.h" />
<ClInclude Include="..\..\src\data-types\mailstream_cancel.h" />
<ClInclude Include="..\..\src\data-types\mailstream_cancel_types.h" />
<ClInclude Include="..\..\src\data-types\mailstream_cfstream.h" />
<ClInclude Include="..\..\src\data-types\mailstream_compress.h" />
<ClInclude Include="..\..\src\data-types\mailstream_helper.h" />
<ClInclude Include="..\..\src\data-types\mailstream_low.h" />
<ClInclude Include="..\..\src\data-types\mailstream_socket.h" />
<ClInclude Include="..\..\src\data-types\mailstream_ssl.h" />
<ClInclude Include="..\..\src\data-types\mailstream_ssl_private.h" />
<ClInclude Include="..\..\src\data-types\mailstream_types.h" />
<ClInclude Include="..\..\src\data-types\mail_cache_db.h" />
<ClInclude Include="..\..\src\data-types\mail_cache_db_types.h" />
<ClInclude Include="..\..\src\data-types\md5.h" />
<ClInclude Include="..\..\src\data-types\md5global.h" />
<ClInclude Include="..\..\src\data-types\mmapstring.h" />
<ClInclude Include="..\..\src\data-types\mmapstring_private.h" />
<ClInclude Include="..\..\src\data-types\timeutils.h" />
<ClInclude Include="..\..\src\driver\implementation\data-message\data_message_driver.h" />
<ClInclude Include="..\..\src\driver\implementation\feed\feeddriver.h" />
<ClInclude Include="..\..\src\driver\implementation\feed\feeddriver_message.h" />
<ClInclude Include="..\..\src\driver\implementation\feed\feeddriver_types.h" />
<ClInclude Include="..\..\src\driver\implementation\feed\feedstorage.h" />
<ClInclude Include="..\..\src\driver\implementation\hotmail\hotmailstorage.h" />
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver.h" />
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_cached.h" />
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_cached_message.h" />
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_message.h" />
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_tools.h" />
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_tools_private.h" />
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_types.h" />
<ClInclude Include="..\..\src\driver\implementation\imap\imapstorage.h" />
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver.h" />
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_cached.h" />
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_cached_message.h" />
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_message.h" />
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_tools.h" />
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_types.h" />
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirstorage.h" />
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver.h" />
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_cached.h" />
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_cached_message.h" />
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_message.h" />
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_tools.h" />
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_types.h" />
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxstorage.h" />
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver.h" />
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_cached.h" />
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_cached_message.h" />
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_message.h" />
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_tools.h" />
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_types.h" />
<ClInclude Include="..\..\src\driver\implementation\mh\mhstorage.h" />
<ClInclude Include="..\..\src\driver\implementation\mime-message\mime_message_driver.h" />
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver.h" />
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_cached.h" />
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_cached_message.h" />
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_message.h" />
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_tools.h" />
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_types.h" />
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpstorage.h" />
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver.h" />
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_cached.h" />
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_cached_message.h" />
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_message.h" />
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_tools.h" />
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_types.h" />
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3storage.h" />
<ClInclude Include="..\..\src\driver\interface\maildriver.h" />
<ClInclude Include="..\..\src\driver\interface\maildriver_errors.h" />
<ClInclude Include="..\..\src\driver\interface\maildriver_tools.h" />
<ClInclude Include="..\..\src\driver\interface\maildriver_types.h" />
<ClInclude Include="..\..\src\driver\interface\maildriver_types_helper.h" />
<ClInclude Include="..\..\src\driver\interface\mailfolder.h" />
<ClInclude Include="..\..\src\driver\interface\mailmessage.h" />
<ClInclude Include="..\..\src\driver\interface\mailmessage_tools.h" />
<ClInclude Include="..\..\src\driver\interface\mailmessage_types.h" />
<ClInclude Include="..\..\src\driver\interface\mailstorage.h" />
<ClInclude Include="..\..\src\driver\interface\mailstorage_tools.h" />
<ClInclude Include="..\..\src\driver\interface\mailstorage_types.h" />
<ClInclude Include="..\..\src\driver\tools\generic_cache.h" />
<ClInclude Include="..\..\src\driver\tools\generic_cache_types.h" />
<ClInclude Include="..\..\src\driver\tools\imfcache.h" />
<ClInclude Include="..\..\src\driver\tools\mailthread.h" />
<ClInclude Include="..\..\src\driver\tools\mailthread_types.h" />
<ClInclude Include="..\..\src\low-level\feed\date.h" />
<ClInclude Include="..\..\src\low-level\feed\newsfeed.h" />
<ClInclude Include="..\..\src\low-level\feed\newsfeed_item.h" />
<ClInclude Include="..\..\src\low-level\feed\newsfeed_item_enclosure.h" />
<ClInclude Include="..\..\src\low-level\feed\newsfeed_private.h" />
<ClInclude Include="..\..\src\low-level\feed\newsfeed_types.h" />
<ClInclude Include="..\..\src\low-level\feed\parser.h" />
<ClInclude Include="..\..\src\low-level\feed\parser_atom03.h" />
<ClInclude Include="..\..\src\low-level\feed\parser_atom10.h" />
<ClInclude Include="..\..\src\low-level\feed\parser_rdf.h" />
<ClInclude Include="..\..\src\low-level\feed\parser_rss20.h" />
<ClInclude Include="..\..\src\low-level\imap\acl.h" />
<ClInclude Include="..\..\src\low-level\imap\acl_parser.h" />
<ClInclude Include="..\..\src\low-level\imap\acl_sender.h" />
<ClInclude Include="..\..\src\low-level\imap\acl_types.h" />
<ClInclude Include="..\..\src\low-level\imap\annotatemore.h" />
<ClInclude Include="..\..\src\low-level\imap\annotatemore_parser.h" />
<ClInclude Include="..\..\src\low-level\imap\annotatemore_sender.h" />
<ClInclude Include="..\..\src\low-level\imap\annotatemore_types.h" />
<ClInclude Include="..\..\src\low-level\imap\condstore.h" />
<ClInclude Include="..\..\src\low-level\imap\condstore_private.h" />
<ClInclude Include="..\..\src\low-level\imap\condstore_types.h" />
<ClInclude Include="..\..\src\low-level\imap\enable.h" />
<ClInclude Include="..\..\src\low-level\imap\idle.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_compress.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_extension.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_extension_types.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_helper.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_id.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_id_parser.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_id_sender.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_id_types.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_keywords.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_oauth2.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_parser.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_print.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_sender.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_socket.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_sort.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_sort_types.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_ssl.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_types.h" />
<ClInclude Include="..\..\src\low-level\imap\mailimap_types_helper.h" />
<ClInclude Include="..\..\src\low-level\imap\namespace.h" />
<ClInclude Include="..\..\src\low-level\imap\namespace_parser.h" />
<ClInclude Include="..\..\src\low-level\imap\namespace_sender.h" />
<ClInclude Include="..\..\src\low-level\imap\namespace_types.h" />
<ClInclude Include="..\..\src\low-level\imap\qresync.h" />
<ClInclude Include="..\..\src\low-level\imap\qresync_private.h" />
<ClInclude Include="..\..\src\low-level\imap\qresync_types.h" />
<ClInclude Include="..\..\src\low-level\imap\quota.h" />
<ClInclude Include="..\..\src\low-level\imap\quota_parser.h" />
<ClInclude Include="..\..\src\low-level\imap\quota_sender.h" />
<ClInclude Include="..\..\src\low-level\imap\quota_types.h" />
<ClInclude Include="..\..\src\low-level\imap\uidplus.h" />
<ClInclude Include="..\..\src\low-level\imap\uidplus_parser.h" />
<ClInclude Include="..\..\src\low-level\imap\uidplus_sender.h" />
<ClInclude Include="..\..\src\low-level\imap\uidplus_types.h" />
<ClInclude Include="..\..\src\low-level\imap\xgmlabels.h" />
<ClInclude Include="..\..\src\low-level\imap\xgmmsgid.h" />
<ClInclude Include="..\..\src\low-level\imap\xgmthrid.h" />
<ClInclude Include="..\..\src\low-level\imap\xlist.h" />
<ClInclude Include="..\..\src\low-level\imf\mailimf.h" />
<ClInclude Include="..\..\src\low-level\imf\mailimf_types.h" />
<ClInclude Include="..\..\src\low-level\imf\mailimf_types_helper.h" />
<ClInclude Include="..\..\src\low-level\imf\mailimf_write.h" />
<ClInclude Include="..\..\src\low-level\imf\mailimf_write_file.h" />
<ClInclude Include="..\..\src\low-level\imf\mailimf_write_generic.h" />
<ClInclude Include="..\..\src\low-level\imf\mailimf_write_mem.h" />
<ClInclude Include="..\..\src\low-level\maildir\maildir.h" />
<ClInclude Include="..\..\src\low-level\maildir\maildir_types.h" />
<ClInclude Include="..\..\src\low-level\mbox\mailmbox.h" />
<ClInclude Include="..\..\src\low-level\mbox\mailmbox_parse.h" />
<ClInclude Include="..\..\src\low-level\mbox\mailmbox_types.h" />
<ClInclude Include="..\..\src\low-level\mh\mailmh.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime_content.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime_decode.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime_disposition.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime_types.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime_types_helper.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime_write.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime_write_file.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime_write_generic.h" />
<ClInclude Include="..\..\src\low-level\mime\mailmime_write_mem.h" />
<ClInclude Include="..\..\src\low-level\nntp\newsnntp.h" />
<ClInclude Include="..\..\src\low-level\nntp\newsnntp_socket.h" />
<ClInclude Include="..\..\src\low-level\nntp\newsnntp_ssl.h" />
<ClInclude Include="..\..\src\low-level\nntp\newsnntp_types.h" />
<ClInclude Include="..\..\src\low-level\pop3\mailpop3.h" />
<ClInclude Include="..\..\src\low-level\pop3\mailpop3_helper.h" />
<ClInclude Include="..\..\src\low-level\pop3\mailpop3_socket.h" />
<ClInclude Include="..\..\src\low-level\pop3\mailpop3_ssl.h" />
<ClInclude Include="..\..\src\low-level\pop3\mailpop3_types.h" />
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp.h" />
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_helper.h" />
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_oauth2.h" />
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_private.h" />
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_socket.h" />
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_ssl.h" />
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_types.h" />
<ClInclude Include="..\..\src\windows\win_etpan.h" />
<ClInclude Include="..\libetpan-config.h" />
<ClInclude Include="..\libetpan_version.h" />
@ -415,4 +612,4 @@ build_headers.bat
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

+ 591
- 0
build-windows/libetpan/libetpan.vcxproj.filters View File

@ -641,6 +641,597 @@
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_oauth2.h">
<Filter>Source Files\low-level\smtp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\base64.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\carray.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\charconv.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\chash.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\clist.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\connect.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\hmac-md5.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mail.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mail_cache_db.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mail_cache_db_types.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\maillock.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailsasl.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailsasl_private.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_cancel.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_cancel_types.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_cfstream.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_compress.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_helper.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_low.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_socket.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_ssl.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_ssl_private.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mailstream_types.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\md5.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\md5global.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mmapstring.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\mmapstring_private.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\data-types\timeutils.h">
<Filter>Source Files\datatypes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\data-message\data_message_driver.h">
<Filter>Source Files\driver\implementation\data-message</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\feed\feeddriver.h">
<Filter>Source Files\driver\implementation\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\feed\feeddriver_message.h">
<Filter>Source Files\driver\implementation\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\feed\feeddriver_types.h">
<Filter>Source Files\driver\implementation\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\feed\feedstorage.h">
<Filter>Source Files\driver\implementation\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\hotmail\hotmailstorage.h">
<Filter>Source Files\driver\implementation\hotmail</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver.h">
<Filter>Source Files\driver\implementation\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_cached.h">
<Filter>Source Files\driver\implementation\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_cached_message.h">
<Filter>Source Files\driver\implementation\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_message.h">
<Filter>Source Files\driver\implementation\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_tools.h">
<Filter>Source Files\driver\implementation\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_tools_private.h">
<Filter>Source Files\driver\implementation\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\imap\imapdriver_types.h">
<Filter>Source Files\driver\implementation\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\imap\imapstorage.h">
<Filter>Source Files\driver\implementation\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver.h">
<Filter>Source Files\driver\implementation\maildir</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_cached.h">
<Filter>Source Files\driver\implementation\maildir</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_cached_message.h">
<Filter>Source Files\driver\implementation\maildir</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_message.h">
<Filter>Source Files\driver\implementation\maildir</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_tools.h">
<Filter>Source Files\driver\implementation\maildir</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirdriver_types.h">
<Filter>Source Files\driver\implementation\maildir</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\maildir\maildirstorage.h">
<Filter>Source Files\driver\implementation\maildir</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver.h">
<Filter>Source Files\driver\implementation\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_cached.h">
<Filter>Source Files\driver\implementation\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_cached_message.h">
<Filter>Source Files\driver\implementation\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_message.h">
<Filter>Source Files\driver\implementation\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_tools.h">
<Filter>Source Files\driver\implementation\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxdriver_types.h">
<Filter>Source Files\driver\implementation\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mbox\mboxstorage.h">
<Filter>Source Files\driver\implementation\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver.h">
<Filter>Source Files\driver\implementation\mh</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_cached.h">
<Filter>Source Files\driver\implementation\mh</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_cached_message.h">
<Filter>Source Files\driver\implementation\mh</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_message.h">
<Filter>Source Files\driver\implementation\mh</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_tools.h">
<Filter>Source Files\driver\implementation\mh</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mh\mhdriver_types.h">
<Filter>Source Files\driver\implementation\mh</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mh\mhstorage.h">
<Filter>Source Files\driver\implementation\mh</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\mime-message\mime_message_driver.h">
<Filter>Source Files\driver\implementation\mime-message</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver.h">
<Filter>Source Files\driver\implementation\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_cached.h">
<Filter>Source Files\driver\implementation\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_cached_message.h">
<Filter>Source Files\driver\implementation\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_message.h">
<Filter>Source Files\driver\implementation\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_tools.h">
<Filter>Source Files\driver\implementation\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpdriver_types.h">
<Filter>Source Files\driver\implementation\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\nntp\nntpstorage.h">
<Filter>Source Files\driver\implementation\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver.h">
<Filter>Source Files\driver\implementation\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_cached.h">
<Filter>Source Files\driver\implementation\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_cached_message.h">
<Filter>Source Files\driver\implementation\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_message.h">
<Filter>Source Files\driver\implementation\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_tools.h">
<Filter>Source Files\driver\implementation\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3driver_types.h">
<Filter>Source Files\driver\implementation\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\implementation\pop3\pop3storage.h">
<Filter>Source Files\driver\implementation\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\maildriver.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\maildriver_errors.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\maildriver_tools.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\maildriver_types.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\maildriver_types_helper.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\mailfolder.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\mailmessage.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\mailmessage_tools.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\mailmessage_types.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\mailstorage.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\mailstorage_tools.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\interface\mailstorage_types.h">
<Filter>Source Files\driver\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\tools\generic_cache.h">
<Filter>Source Files\driver\tools</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\tools\generic_cache_types.h">
<Filter>Source Files\driver\tools</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\tools\imfcache.h">
<Filter>Source Files\driver\tools</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\tools\mailthread.h">
<Filter>Source Files\driver\tools</Filter>
</ClInclude>
<ClInclude Include="..\..\src\driver\tools\mailthread_types.h">
<Filter>Source Files\driver\tools</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\date.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\newsfeed.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\newsfeed_item.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\newsfeed_item_enclosure.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\newsfeed_private.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\newsfeed_types.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\parser.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\parser_atom03.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\parser_atom10.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\parser_rdf.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\feed\parser_rss20.h">
<Filter>Source Files\low-level\feed</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\acl.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\acl_parser.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\acl_sender.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\acl_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\annotatemore.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\annotatemore_parser.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\annotatemore_sender.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\annotatemore_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\condstore.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\condstore_private.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\condstore_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\enable.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\idle.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_compress.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_extension.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_extension_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_helper.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_id.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_id_parser.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_id_sender.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_id_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_keywords.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_oauth2.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_parser.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_print.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_sender.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_socket.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_sort.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_sort_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_ssl.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\mailimap_types_helper.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\namespace.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\namespace_parser.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\namespace_sender.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\namespace_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\qresync.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\qresync_private.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\qresync_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\quota.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\quota_parser.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\quota_sender.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\quota_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\uidplus.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\uidplus_parser.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\uidplus_sender.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\uidplus_types.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\xgmlabels.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\xgmmsgid.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\xgmthrid.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imap\xlist.h">
<Filter>Source Files\low-level\imap</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imf\mailimf.h">
<Filter>Source Files\low-level\imf</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imf\mailimf_types.h">
<Filter>Source Files\low-level\imf</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imf\mailimf_types_helper.h">
<Filter>Source Files\low-level\imf</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imf\mailimf_write.h">
<Filter>Source Files\low-level\imf</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imf\mailimf_write_file.h">
<Filter>Source Files\low-level\imf</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imf\mailimf_write_generic.h">
<Filter>Source Files\low-level\imf</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\imf\mailimf_write_mem.h">
<Filter>Source Files\low-level\imf</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\maildir\maildir.h">
<Filter>Source Files\low-level\maildir</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\maildir\maildir_types.h">
<Filter>Source Files\low-level\maildir</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mbox\mailmbox.h">
<Filter>Source Files\low-level\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mbox\mailmbox_parse.h">
<Filter>Source Files\low-level\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mbox\mailmbox_types.h">
<Filter>Source Files\low-level\mbox</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mh\mailmh.h">
<Filter>Source Files\low-level\mh</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime_content.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime_decode.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime_disposition.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime_types.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime_types_helper.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime_write.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime_write_file.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime_write_generic.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\mime\mailmime_write_mem.h">
<Filter>Source Files\low-level\mime</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\nntp\newsnntp.h">
<Filter>Source Files\low-level\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\nntp\newsnntp_socket.h">
<Filter>Source Files\low-level\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\nntp\newsnntp_ssl.h">
<Filter>Source Files\low-level\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\nntp\newsnntp_types.h">
<Filter>Source Files\low-level\nntp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\pop3\mailpop3.h">
<Filter>Source Files\low-level\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\pop3\mailpop3_helper.h">
<Filter>Source Files\low-level\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\pop3\mailpop3_socket.h">
<Filter>Source Files\low-level\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\pop3\mailpop3_ssl.h">
<Filter>Source Files\low-level\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\pop3\mailpop3_types.h">
<Filter>Source Files\low-level\pop3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp.h">
<Filter>Source Files\low-level\smtp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_helper.h">
<Filter>Source Files\low-level\smtp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_private.h">
<Filter>Source Files\low-level\smtp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_socket.h">
<Filter>Source Files\low-level\smtp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_ssl.h">
<Filter>Source Files\low-level\smtp</Filter>
</ClInclude>
<ClInclude Include="..\..\src\low-level\smtp\mailsmtp_types.h">
<Filter>Source Files\low-level\smtp</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\build_headers.list">


+ 1
- 1
libetpan-config.h.in View File

@ -9,7 +9,7 @@
@if WIN32
@ define MMAP_UNAVAILABLE
@endif
@ifdef _MSC_VER
@if defined(_MSC_VER) && !defined(__cplusplus)
@ define inline __inline
@endif
#ifdef HAVE_LIMITS_H


+ 10
- 0
src/data-types/mailstream_cfstream.c View File

@ -1192,6 +1192,11 @@ static carray * mailstream_low_cfstream_get_certificate_chain(mailstream_low * s
for(i = 0 ; i < count ; i ++) {
SecCertificateRef cert = (SecCertificateRef) SecTrustGetCertificateAtIndex(secTrust, i);
CFDataRef data = SecCertificateCopyData(cert);
if (data == NULL) {
carray_free(result);
CFRelease(secTrust);
return NULL;
}
CFIndex length = CFDataGetLength(data);
const UInt8 * bytes = CFDataGetBytePtr(data);
MMAPString * str = mmap_string_sized_new(length);
@ -1209,6 +1214,11 @@ static carray * mailstream_low_cfstream_get_certificate_chain(mailstream_low * s
for(i = 0 ; i < count ; i ++) {
SecCertificateRef cert = (SecCertificateRef) CFArrayGetValueAtIndex(certs, i);
CFDataRef data = SecCertificateCopyData(cert);
if (data == NULL) {
carray_free(result);
CFRelease(certs);
return NULL;
}
CFIndex length = CFDataGetLength(data);
const UInt8 * bytes = CFDataGetBytePtr(data);
MMAPString * str = mmap_string_sized_new(length);


+ 25
- 0
src/data-types/mailstream_low.c View File

@ -454,6 +454,30 @@ int mailstream_low_wait_idle(mailstream_low * low, struct mailstream_cancel * id
cancel_fd = mailstream_cancel_get_fd(mailstream_low_get_cancel(low));
FD_ZERO(&readfds);
#ifdef WIN32
HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL);
WSAEventSelect(fd, event, FD_READ | FD_CLOSE);
FD_SET(event, &readfds);
FD_SET(idle_fd, &readfds);
FD_SET(cancel_fd, &readfds);
r = WaitForMultipleObjects(readfds.fd_count, readfds.fd_array, FALSE, max_idle_delay * 1000);
WSAEventSelect(fd, event, 0);
CloseHandle(event);
if (r == WAIT_TIMEOUT) {
return MAILSTREAM_IDLE_TIMEOUT;
}
else if (r == WAIT_OBJECT_0){
return MAILSTREAM_IDLE_HASDATA;
}
else if (r == WAIT_OBJECT_0 + 1){
return MAILSTREAM_IDLE_INTERRUPTED;
}
else if (r == WAIT_OBJECT_0 + 2){
return MAILSTREAM_IDLE_CANCELLED;
}
DWORD i = GetLastError();
return MAILSTREAM_IDLE_ERROR;
#else
FD_SET(fd, &readfds);
FD_SET(idle_fd, &readfds);
FD_SET(cancel_fd, &readfds);
@ -494,6 +518,7 @@ int mailstream_low_wait_idle(mailstream_low * low, struct mailstream_cancel * id
}
return MAILSTREAM_IDLE_ERROR;
}
#endif
}
int mailstream_low_setup_idle(mailstream_low * low)


+ 4
- 0
src/driver/interface/mailstorage_tools.c View File

@ -307,7 +307,11 @@ int mailstorage_generic_connect_with_local_address(mailsession_driver * driver,
if (stream == NULL) {
res = MAIL_ERROR_STREAM;
#ifdef WIN32
closesocket(fd);
#else
Close(fd);
#endif
goto err;
}


+ 22
- 3
src/low-level/imap/mailimap.c View File

@ -2309,7 +2309,12 @@ int mailimap_send_current_tag(mailimap * session)
int r;
session->imap_tag ++;
snprintf(tag_str, 15, "%i", session->imap_tag);
if(mailimap_is_163_workaround_enabled(session))
snprintf(tag_str, 15, "C%i", session->imap_tag);
else
snprintf(tag_str, 15, "%i", session->imap_tag);
r = mailimap_tag_send(session->imap_stream, tag_str);
if (r != MAILIMAP_NO_ERROR)
@ -2384,7 +2389,11 @@ int mailimap_parse_response(mailimap * session,
return MAILIMAP_ERROR_FATAL;
}
snprintf(tag_str, 15, "%i", session->imap_tag);
if(mailimap_is_163_workaround_enabled(session))
snprintf(tag_str, 15, "C%i", session->imap_tag);
else
snprintf(tag_str, 15, "%i", session->imap_tag);
if (strcmp(response->rsp_resp_done->rsp_data.rsp_tagged->rsp_tag, tag_str) != 0) {
mailimap_response_free(response);
return MAILIMAP_ERROR_PROTOCOL;
@ -2502,7 +2511,7 @@ mailimap * mailimap_new(size_t imap_progr_rate,
f->imap_logger = NULL;
f->imap_logger_context = NULL;
f->is_163_workaround_enabled = 0;
return f;
free_stream_buffer:
@ -2590,3 +2599,13 @@ void mailimap_set_logger(mailimap * session, void (* logger)(mailimap * session,
session->imap_logger = logger;
session->imap_logger_context = logger_context;
}
LIBETPAN_EXPORT
void mailimap_set_163_workaround_enabled(mailimap * session, int enabled) {
session->is_163_workaround_enabled = enabled;
}
LIBETPAN_EXPORT
int mailimap_is_163_workaround_enabled(mailimap * session) {
return session->is_163_workaround_enabled;
}

+ 10
- 0
src/low-level/imap/mailimap.h View File

@ -803,6 +803,16 @@ LIBETPAN_EXPORT
void mailimap_set_logger(mailimap * session, void (* logger)(mailimap * session, int log_type,
const char * str, size_t size, void * context), void * logger_context);
#ifndef LIBETPAN_HAS_MAILIMAP_163_WORKAROUND
#define LIBETPAN_HAS_MAILIMAP_163_WORKAROUND 1
#endif
LIBETPAN_EXPORT
int mailimap_is_163_workaround_enabled(mailimap * session);
LIBETPAN_EXPORT
void mailimap_set_163_workaround_enabled(mailimap * session, int enabled);
#ifdef __cplusplus
}
#endif


+ 2
- 2
src/low-level/imap/mailimap_extension.c View File

@ -189,7 +189,7 @@ void mailimap_extension_data_store(mailimap * session,
}
LIBETPAN_EXPORT
int mailimap_has_extension(mailimap * session, char * extension_name)
int mailimap_has_extension(mailimap * session, const char * extension_name)
{
if (session->imap_connection_info != NULL) {
if (session->imap_connection_info->imap_capability != NULL) {
@ -214,7 +214,7 @@ int mailimap_has_extension(mailimap * session, char * extension_name)
}
LIBETPAN_EXPORT
int mailimap_has_authentication(mailimap * session, char * authentication_name)
int mailimap_has_authentication(mailimap * session, const char * authentication_name)
{
if (session->imap_connection_info != NULL) {
if (session->imap_connection_info->imap_capability != NULL) {


+ 2
- 2
src/low-level/imap/mailimap_extension.h View File

@ -99,10 +99,10 @@ void mailimap_extension_data_store(mailimap * session,
*/
LIBETPAN_EXPORT
int mailimap_has_extension(mailimap * session, char * extension_name);
int mailimap_has_extension(mailimap * session, const char * extension_name);
LIBETPAN_EXPORT
int mailimap_has_authentication(mailimap * session, char * authentication_name);
int mailimap_has_authentication(mailimap * session, const char * authentication_name);
#ifdef __cplusplus
}


+ 243
- 0
src/low-level/imap/mailimap_parser.c View File

@ -768,6 +768,24 @@ mailimap_string_parse_progress(mailstream * fd, MMAPString * buffer,
static int has_crlf(MMAPString * buffer, size_t index);
static int mailimap_address_list_parse(mailstream * fd, MMAPString * buffer,
size_t * indx,
clist ** result,
size_t progr_rate,
progress_function * progr_fun);
static int mailimap_envelope_parse_full(mailstream * fd, MMAPString * buffer,
size_t * indx,
struct mailimap_envelope ** result,
size_t progr_rate,
progress_function * progr_fun);
static int mailimap_envelope_parse_workaround_qq_mail(mailstream * fd, MMAPString * buffer,
size_t * indx,
struct mailimap_envelope ** result,
size_t progr_rate,
progress_function * progr_fun);
/* ************************************************************************* */
/* ************************************************************************* */
/* ************************************************************************* */
@ -1514,6 +1532,14 @@ static int mailimap_addr_host_parse(mailstream * fd, MMAPString * buffer,
size_t progr_rate,
progress_function * progr_fun)
{
int r;
/* workaround for qq.com IMAP Server. */
r = mailimap_token_case_insensitive_parse(fd, buffer, indx, "\"qq.com\\\"");
if (r == MAILIMAP_NO_ERROR) {
return r;
}
return mailimap_nstring_parse(fd, buffer, indx, result, NULL,
progr_rate, progr_fun);
}
@ -4613,6 +4639,26 @@ static int mailimap_envelope_parse(mailstream * fd, MMAPString * buffer,
struct mailimap_envelope ** result,
size_t progr_rate,
progress_function * progr_fun)
{
int r;
r = mailimap_envelope_parse_full(fd, buffer, indx, result, progr_rate, progr_fun);
if (r == MAILIMAP_NO_ERROR) {
return MAILIMAP_NO_ERROR;
}
else if (r != MAILIMAP_ERROR_PARSE) {
return r;
}
/* workaround for qq.com IMAP Server. */
r = mailimap_envelope_parse_workaround_qq_mail(fd, buffer, indx, result, progr_rate, progr_fun);
return r;
}
static int mailimap_envelope_parse_full(mailstream * fd, MMAPString * buffer,
size_t * indx,
struct mailimap_envelope ** result,
size_t progr_rate,
progress_function * progr_fun)
{
size_t cur_token;
char * date;
@ -4814,6 +4860,203 @@ static int mailimap_envelope_parse(mailstream * fd, MMAPString * buffer,
return res;
}
static int mailimap_envelope_parse_workaround_qq_mail(mailstream * fd, MMAPString * buffer,
size_t * indx,
struct mailimap_envelope ** result,
size_t progr_rate,
progress_function * progr_fun)
{
size_t cur_token;
char * date;
char * subject;
struct mailimap_env_from * from;
char * in_reply_to;
char * message_id;
struct mailimap_envelope * envelope;
int r;
int res;
char * first_string;
char * second_string;
int has_first_string;
int has_second_string;
date = NULL;
subject = NULL;
from = NULL;
in_reply_to = NULL;
message_id = NULL;
first_string = NULL;
second_string = NULL;
cur_token = * indx;
r = mailimap_oparenth_parse(fd, buffer, &cur_token);
if (r != MAILIMAP_NO_ERROR) {
res = r;
goto err;
}
r = mailimap_env_date_parse(fd, buffer, &cur_token, &date,
progr_rate, progr_fun);
if (r != MAILIMAP_NO_ERROR) {
res = r;
goto err;
}
r = mailimap_space_parse(fd, buffer, &cur_token);
if (r != MAILIMAP_NO_ERROR) {
res = r;
goto date;
}
r = mailimap_env_subject_parse(fd, buffer, &cur_token, &subject,
progr_rate, progr_fun);
if (r != MAILIMAP_NO_ERROR) {
res = r;
goto date;
}
r = mailimap_space_parse(fd, buffer, &cur_token);
if (r != MAILIMAP_NO_ERROR) {
res = r;
goto subject;
}
r = mailimap_env_from_parse(fd, buffer, &cur_token, &from,
progr_rate, progr_fun);
if ((r != MAILIMAP_NO_ERROR) && (r != MAILIMAP_ERROR_PARSE)) {
res = r;
goto subject;
}
if (from == NULL) {
clist * list;
struct mailimap_address * addr;
addr = mailimap_address_new("", NULL, "", "");
if (addr == NULL) {
goto subject;
}
list = clist_new();
if (list == NULL) {
mailimap_address_free(addr);
goto subject;
}
r = clist_append(list, addr);
if (r < 0) {
clist_free(list);
mailimap_address_free(addr);
goto subject;
}
from = mailimap_env_from_new(list);
if (from == NULL) {
clist_free(list);
mailimap_address_free(addr);
goto subject;
}
}
while (1) {
clist * list;
r = mailimap_space_parse(fd, buffer, &cur_token);
if (r == MAILIMAP_ERROR_PARSE) {
break;
}
else if (r != MAILIMAP_NO_ERROR) {
res = r;
goto from;
}
r = mailimap_address_list_parse(fd, buffer, &cur_token, &list,
progr_rate, progr_fun);
if (r == MAILIMAP_ERROR_PARSE) {
break;
}
else if (r != MAILIMAP_NO_ERROR) {
res = r;
goto from;
}
if (list != NULL) {
clist_foreach(list, (clist_func) mailimap_address_free, NULL);
clist_free(list);
}
}
has_first_string = 0;
r = mailimap_nstring_parse(fd, buffer, &cur_token, &first_string, NULL,
progr_rate, progr_fun);
if (r == MAILIMAP_NO_ERROR) {
has_first_string = 1;
}
else if (r == MAILIMAP_ERROR_PARSE) {
// Do nothing.
}
else {
res = r;
goto from;
}
r = mailimap_space_parse(fd, buffer, &cur_token);
// ignore errors.
has_second_string = 0;
r = mailimap_nstring_parse(fd, buffer, &cur_token, &second_string, NULL,
progr_rate, progr_fun);
if (r == MAILIMAP_NO_ERROR) {
has_second_string = 1;
}
else if (r == MAILIMAP_ERROR_PARSE) {
// Do nothing.
}
else {
res = r;
goto first_string;
}
if (has_first_string && has_second_string) {
in_reply_to = first_string;
message_id = second_string;
}
else if (has_first_string) {
message_id = first_string;
}
r = mailimap_cparenth_parse(fd, buffer, &cur_token);
if (r != MAILIMAP_NO_ERROR) {
res = r;
goto second_string;
}
envelope = mailimap_envelope_new(date, subject, from, NULL, NULL, NULL,
NULL, NULL, in_reply_to, message_id);
if (envelope == NULL) {
res = MAILIMAP_ERROR_MEMORY;
goto second_string;
}
* result = envelope;
* indx = cur_token;
return MAILIMAP_NO_ERROR;
second_string:
free(second_string);
first_string:
free(first_string);
from:
mailimap_env_from_free(from);
subject:
mailimap_env_subject_free(date);
date:
mailimap_env_date_free(date);
err:
return res;
}
/*
"(" 1*address ")" / nil
*/


+ 41
- 14
src/low-level/imap/mailimap_sender.c View File

@ -184,6 +184,11 @@ static int mailimap_astring_literalplus_send(mailstream * fd, const char * astri
static int
mailimap_literalplus_count_send(mailstream * fd, size_t count);
static int search_key_notoplevel_send(mailstream * fd,
struct mailimap_search_key * key);
static int search_key_literalplus_notoplevel_send(mailstream * fd,
struct mailimap_search_key * key);
@ -2252,7 +2257,7 @@ int mailimap_uid_search_literalplus_send(mailstream * fd, const char * charset,
static int search_key_send(mailstream * fd,
struct mailimap_search_key * key,
int literalplus_enabled)
int literalplus_enabled, int toplevel)
{
int r;
@ -2479,7 +2484,7 @@ static int search_key_send(mailstream * fd,
r = mailimap_space_send(fd);
if (r != MAILIMAP_NO_ERROR)
return r;
r = mailimap_search_key_send(fd, key->sk_data.sk_not);
r = search_key_send(fd, key->sk_data.sk_not, literalplus_enabled, 0);
if (r != MAILIMAP_NO_ERROR)
return r;
return MAILIMAP_NO_ERROR;
@ -2491,13 +2496,13 @@ static int search_key_send(mailstream * fd,
r = mailimap_space_send(fd);
if (r != MAILIMAP_NO_ERROR)
return r;
r = mailimap_search_key_send(fd, key->sk_data.sk_or.sk_or1);
r = search_key_send(fd, key->sk_data.sk_or.sk_or1, literalplus_enabled, 0);
if (r != MAILIMAP_NO_ERROR)
return r;
r = mailimap_space_send(fd);
if (r != MAILIMAP_NO_ERROR)
return r;
r = mailimap_search_key_send(fd, key->sk_data.sk_or.sk_or2);
r = search_key_send(fd, key->sk_data.sk_or.sk_or2, literalplus_enabled, 0);
if (r != MAILIMAP_NO_ERROR)
return r;
return MAILIMAP_NO_ERROR;
@ -2605,18 +2610,28 @@ static int search_key_send(mailstream * fd,
return MAILIMAP_NO_ERROR;
case MAILIMAP_SEARCH_KEY_MULTIPLE:
r = mailimap_oparenth_send(fd);
if (r != MAILIMAP_NO_ERROR)
return r;
if (!toplevel) {
r = mailimap_oparenth_send(fd);
if (r != MAILIMAP_NO_ERROR)
return r;
}
r = mailimap_struct_spaced_list_send(fd, key->sk_data.sk_multiple,
(mailimap_struct_sender *) mailimap_search_key_send);
if (literalplus_enabled) {
r = mailimap_struct_spaced_list_send(fd, key->sk_data.sk_multiple,
(mailimap_struct_sender *) search_key_literalplus_notoplevel_send);
}
else {
r = mailimap_struct_spaced_list_send(fd, key->sk_data.sk_multiple,
(mailimap_struct_sender *) search_key_notoplevel_send);
}
if (r != MAILIMAP_NO_ERROR)
return r;
r = mailimap_cparenth_send(fd);
if (r != MAILIMAP_NO_ERROR)
return r;
if (!toplevel) {
r = mailimap_cparenth_send(fd);
if (r != MAILIMAP_NO_ERROR)
return r;
}
return MAILIMAP_NO_ERROR;
case MAILIMAP_SEARCH_KEY_MODSEQ:
@ -2682,16 +2697,28 @@ static int search_key_send(mailstream * fd,
}
}
static int search_key_notoplevel_send(mailstream * fd,
struct mailimap_search_key * key)
{
return search_key_send(fd, key, 0, 0);
}
static int search_key_literalplus_notoplevel_send(mailstream * fd,
struct mailimap_search_key * key)
{
return search_key_send(fd, key, 1, 0);
}
int mailimap_search_key_send(mailstream * fd,
struct mailimap_search_key * key