Giter VIP home page Giter VIP logo

libetpan's People

Contributors

alex2grad avatar alltom avatar chunga avatar codafi avatar colinleroy avatar coredumped avatar darovskikhandrei avatar dinhvh avatar dunemaster avatar eesheesh avatar eworm-de avatar fcoulombegoogle avatar foxinushka avatar haithngn avatar libec avatar madalexuk avatar matthias-lay avatar miximka avatar mones avatar mronge avatar pitiphong-p avatar r10s avatar raniervf avatar rezso avatar sbigaret avatar tapouillo avatar yamori813 avatar yorkie avatar yuklai avatar zhanleewo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libetpan's Issues

CoreFoundation/CoreFoundation.h: No such file or directory

Hi

Trying to compile the latest git (at 05/10/2011) on linux, its giving this:

make[5]: Entering directory /home/higuita/build/claws-mail/libetpan/src/data-types' /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -D_REENTRANT -O2 -fPIC -W -Wall -MT mailstream_cfstream.lo -MD -MP -MF .deps/mailstream_cfstream.Tpo -c -o mailstream_cfstream.lo mailstream_cfstream.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -D_REENTRANT -O2 -fPIC -W -Wall -MT mailstream_cfstream.lo -MD -MP -MF .deps/mailstream_cfstream.Tpo -c mailstream_cfstream.c -fPIC -DPIC -o .libs/mailstream_cfstream.o mailstream_cfstream.c:34:43: fatal error: CoreFoundation/CoreFoundation.h: No such file or directory compilation terminated. make[5]: *** [mailstream_cfstream.lo] Error 1 make[5]: Leaving directory/home/higuita/build/claws-mail/libetpan/src/data-types'
make[4]: *** [all] Error 2
make[4]: Leaving directory /home/higuita/build/claws-mail/libetpan/src/data-types' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory/home/higuita/build/claws-mail/libetpan/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory /home/higuita/build/claws-mail/libetpan/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/higuita/build/claws-mail/libetpan'
make: *** [all] Error 2

CoreFoundation sounds as a MacOS thing...

thanks

Microsoft Exchange Server 2003 IMAP - login stream error

Microsoft Exchange 2003 IMAP is not RFC strict, which makes libetpan useless with it. E.g. log from Claws-Mail with libetpan16 1.1:

[12:41:05] * message: Account 'xxxxxxxxxxxx': Connecting to IMAP4 server:
10.0.1.15...
[12:41:05] IMAP4< * OK Microsoft Exchange Server 2003 IMAP4rev1 server version
6.5.7638.1 (xxxxxxxxxxxx) ready.
[12:41:05] * message: IMAP connection is un-authenticated
[12:41:09] IMAP4> 1 CAPABILITY
[12:41:09] IMAP4< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS
MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN
[12:41:09] IMAP4< 1 OK CAPABILITY completed.
[12:41:09] IMAP4> Logging xxxxxxxxxxxx to 10.0.1.15 using LOGIN
[12:41:09] IMAP4< CAPABILITY completed.
[12:41:09] ** warning: IMAP error on 10.0.1.15: stream error
[12:41:09] ** warning: IMAP4 connection broken
[12:41:09] IMAP4< Error logging in to 10.0.1.15

Exchange responses with extra invalid line after "1 OK":
[12:41:09] IMAP4< 1 OK CAPABILITY completed.
[12:41:09] IMAP4< CAPABILITY completed.

Is it possible to write some workarounds for Exchange sh*t^W IMAP?

Proper TLS certificate verification capabilities

Claws-Mail bug 2199 (at http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=2199) claims that libEtPan allows access to the server certificate when establishing a TLS-protected connection, but not the entire certificate chain in the case of a server certificate not directly signed by a root CA. I don't know if this is true or not, but if it is, it needs fixing! Either libEtPan needs to do actual certificate verification itself, or else the complete presented chain needs to be exposed to the client application who can do that checking. Without this, there is no way for the client to verify the certificates because it cannot get hold of the intermediate certificates that make up the chain.

windows: Incorrect write(read) in case send returnes WSAEWOULDBLOCK

Version: libetpan-0.58

Problem is in src/data-types/mailstream_socket.c
mailstream_low_socket_write function

Here is code:
return send(socket_data->fd, buf, count, 0);

Actually it may return -1 and WSAGetLastError() in that case could be WSAEWOULDBLOCK
It indicates that it's impossible to write in socket at the moment
but it's not critical. In this case we must just try to write again (obtaining select for FD_WRITE )

As a solution this function may just return 0 in that case, something like

size_t ret = send(socket_data->fd, buf, count, 0);
if (ret <= 0) {
int le = WSAGetLastError();
if (le == WSAEWOULDBLOCK)
return 0;
}

return ret;

This problem is well reproducible on MS Exchange server with big emails.

Undefined symbols for architecture x86_64

I am trying the build the project on Mac while the following errors occurred:

"_mailstream_low_tls_open_with_callback_timeout", referenced from:
_mailimap_socket_starttls_with_callback in mailimap_socket.o
_mailpop3_socket_starttls_with_callback in mailpop3_socket.o
_mailsmtp_socket_starttls_with_callback in mailsmtp_socket.o
"_mailstream_ssl_open", referenced from:
_mailstorage_generic_connect_with_local_address in mailstorage_tools.o
"_mailstream_ssl_open_with_callback_timeout", referenced from:
_mailimap_ssl_connect_voip_with_callback in mailimap_ssl.o
_newsnntp_ssl_connect_with_callback in newsnntp_ssl.o
_mailpop3_ssl_connect_with_callback in mailpop3_ssl.o
_mailsmtp_ssl_connect_with_callback in mailsmtp_ssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation).

Are there some files missing or other issues? Thanks.

Regards,
Shuanglong

windows: ipv6 support does not work properly

The function static int verify_sock_errors(int s) in connect.c returns -1 if success under win
because, upon successful completion, getsockopt() return nonzero under Win and zero undex Unix/Linux

I suggest fix:

ifdef WIN32

if (getsockopt(s, SOL_SOCKET, SO_ERROR, &val, &len) == 0) { //Nonzero if the function is successful; otherwise 0

else

if (getsockopt(s, SOL_SOCKET, SO_ERROR, &val, &len) != 0) { //Upon successful completion, getsockopt() shall return 0; otherwise, -1 shall be returned

endif

instead
if (getsockopt(s, SOL_SOCKET, SO_ERROR, &val, &len) < 0) {

rfc822: Non-standard Date: header parsing

One of Debian users has submitted a bug report
against libetpan package, requesting non-standard
Date: header parsing.

Details are at http://bugs.debian.org/303898

invalid date:

DATE: Sat, Apr 09 2005 06:39:52 -0700

date format should look like this :

Date: Sat, 9 Apr 2005 16:36:30 +0200

with 9 before Apr

Compilation error

Under slackware 14.0 with gcc 4.7.1 I get this this error while compiling :

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../src/data-types -DDEBUG -D_REENTRANT -g -O2 -O2 -g -W -Wall -MT mailimap_id_sender.lo -MD -MP -MF .deps/mailimap_id_sender.Tpo -c mailimap_id_sender.c -fPIC -DPIC -o .libs/mailimap_id_sender.o
mailimap_id_sender.c: In function 'mailimap_id_param_send':
mailimap_id_sender.c:60:28: error: 'NULL' undeclared (first use in this function)
mailimap_id_sender.c:60:28: note: each undeclared identifier is reported only once for each function it appears in
make[7]: *** [mailimap_id_sender.lo] Erreur 1
make[7] : on quitte le répertoire « /home/charles/temp/libetpan/src/low-level/imap »
make[6]: *** [all] Erreur 2
make[6] : on quitte le répertoire « /home/charles/temp/libetpan/src/low-level/imap »
make[5]: *** [all-recursive] Erreur 1
make[5] : on quitte le répertoire « /home/charles/temp/libetpan/src/low-level »
make[4]: *** [all] Erreur 2
make[4] : on quitte le répertoire « /home/charles/temp/libetpan/src/low-level »
make[3]: *** [all-recursive] Erreur 1
make[3] : on quitte le répertoire « /home/charles/temp/libetpan/src »
make[2]: *** [all] Erreur 2
make[2] : on quitte le répertoire « /home/charles/temp/libetpan/src »
make[1]: *** [all-recursive] Erreur 1
make[1] : on quitte le répertoire « /home/charles/temp/libetpan »
make: *** [all] Erreur 2

Please find the patch to fix this : (change NULL to 0)

diff --git a/src/low-level/imap/mailimap_id_sender.c b/src/low-level/imap/mailimap_id_sender.c
index 33fd38a..9b8c9a0 100644
--- a/src/low-level/imap/mailimap_id_sender.c
+++ b/src/low-level/imap/mailimap_id_sender.c
@@ -57,7 +57,7 @@ static int mailimap_id_param_send(mailstream * fd, struct mailimap_id_param * pa
if (r != MAILIMAP_NO_ERROR)
return r;

  • if (param->idpa_value == NULL) {
  • if (param->idpa_value == 0) {
    r = mailimap_token_send(fd, "NIL");
    if (r != MAILIMAP_NO_ERROR)
    return r;

windows: HANDLE leaks

CreateEvent call returns HANDLE object
This HANDLE must be closed otherwise HANDLE leakage will occur (it leads to non-paged pool exhaustion).

in mailstream_socket.c and in mailstream_ssl.c
CloseHandle(event) must be called after WaitForMultipleObjects()

This fix must be done for both read and write operations.

Handle update of build-mac/autogen-result.tar.gz gracefully (was: Having trouble building in Xcode)

When I try to build libetpan ios in xcode I'm getting a build failed and this error:

rsync: link_stat "/Users/mjmayank/Downloads/libetpan/build-mac/../include/libetpan/." failed: No such file or directory (2)
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(992) [sender=2.6.9]
Command /bin/sh failed with exit code 23

I'm also unable to compile anything through the command line. I'm getting this error there: config.status: error: cannot find input file: `src/Makefile.in'

I'm not sure if the two are related. Just in case it's relevant, I'm interested in using libetpan to access IMAP email using XOauth2 authentication.

Unable to retrieve UNSEEN messages

I'm working with the latest libetpan source and as silly as it might sound I'm having a hard time trying to retrieve the list of UNSEEN messages from any type of IMAP server.
In the past I used to work with a version earlier than the CONDSTORE patch but if I try to use the latest one all UID searches fail.
I hope someone can point me in the right direction to find my answers, here's my code:

    clist *unseenMails = clist_new();
    struct mailimap_search_key *sKey = mailimap_search_key_new(MAILIMAP_SEARCH_KEY_UNSEEN, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0);
    result = mailimap_uid_search(imap, (const char *)NULL, sKey, &unseenMails);
    if (result  != MAILIMAP_NO_ERROR) {
        if (imap->imap_response == 0) {
            imapLog << "CRITICAL: Can't find unseen messages, IMAP SEARCH failed miserably" << pmm::NL;
        }
        else {
            pmm::imapLog << "CRITICAL: MailFetcher: " << imapFetch.mailAccountInfo.email() << " SEARCH imap response=" << imap->imap_response << pmm::NL;
        }
    }
    else {
        //Do something with the UID list here
    }
  • result always end up with MAILIMAP_ERROR_UID_SEARCH
  • imap->imap_response ends up with: "SEARCH completed (Success)"
  • No UNSEEN UIDs are ever returned

Excessive quoting in mailmime_quoted_printable_write_driver()

I'm looking at all of the characters that get written in hex in mailmime_quoted_printable_write_driver() and it seems that this routine is overly aggressive (or pessimistic) in what gets rewritten:

int mailmime_quoted_printable_write_driver(int (* do_write)(void , const char *
, size_t), void * data, int * col, int istext,
const char * text, size_t size)
{
...
case '!':
case '"':
case '#':
case '$':
case '@':
case '[':
case '':
case ']':
case '^':
case '`':
case '{':
case '|':
case '}':
case '~':
case '=':
case '?':
case '
':
case 'F': /_ there is no more 'From' at the beginning of a line */
r = write_remaining(do_write, data, col, &start, &len);
if (r != MAILIMF_NO_ERROR)
return r;
start = text + i + 1;

        snprintf(hexstr, 6, "=%02X", ch);

        r = mailimf_string_write_driver(do_write, data, col, hexstr, 3);
        if (r != MAILIMF_NO_ERROR)
          return r;
        i ++;
        break;

I'm not sure why anything OTHER than '=' needs to be escaped?

All of these are 7-bit safe characters from NVT.

I'd be inclined to remove everything but '='.

As that's all that's really required. Per RFC-2045, section 6.7 "Quoted-Printable Content-Transfer-Encoding":

(2)   (Literal representation) Octets with decimal values of
      33 through 60 inclusive, and 62 through 126, inclusive,
      MAY be represented as the US-ASCII characters which
      correspond to those octets (EXCLAMATION POINT through
      LESS THAN, and GREATER THAN through TILDE,
      respectively).

Although reading RFC-1521 (now obsolete), "Appendix B -- General Guidelines For Sending Email Data" says:

  (6) Many mail domains use variations on the ASCII character set,
  or use character sets such as EBCDIC which contain most but not
  all of the US-ASCII characters.  The correct translation of
  characters not in the "invariant" set cannot be depended on across
  character converting gateways.  For example, this situation is a
  problem when sending uuencoded information across BITNET, an
  EBCDIC system.  Similar problems can occur without crossing a
  gateway, since many Internet hosts use character sets other than
  ASCII internally.  The definition of Printable Strings in X.400
  adds further restrictions in certain special cases.  In
  particular, the only characters that are known to be consistent
  across all gateways are the 73 characters that correspond to the
  upper and lower case letters A-Z and a-z, the 10 digits 0-9, and
  the following eleven special characters:

                    "'"  (ASCII code 39)
                    "("  (ASCII code 40)
                    ")"  (ASCII code 41)
                    "+"  (ASCII code 43)
                    ","  (ASCII code 44)
                    "-"  (ASCII code 45)
                    "."  (ASCII code 46)
                    "/"  (ASCII code 47)
                    ":"  (ASCII code 58)
                    "="  (ASCII code 61)
                    "?"  (ASCII code 63)

  A maximally portable mail representation, such as the base64
  encoding, will confine itself to relatively short lines of text in
  which the only meaningful characters are taken from this set of 73
  characters.

Are we really worried about EBCDIC and X.400 compatibility???? This section continues as:

  (7) Some mail transport agents will corrupt data that includes
  certain literal strings.  In particular, a period (".") alone on a
  line is known to be corrupted by some (incorrect) SMTP
  implementations, and a line that starts with the five characters
  "From " (the fifth character is a SPACE) are commonly corrupted as
  well.  A careful composition agent can prevent these corruptions
  by encoding the data (e.g., in the quoted-printable encoding,
  "=46rom " in place of "From " at the start of a line, and "=2E" in
  place of "." alone on a line.

Please note that the above list is NOT a list of recommended
practices for MTAs. RFC 821 MTAs are prohibited from altering the
character of white space or wrapping long lines. These BAD and
illegal practices are known to occur on established networks, and
implementations should be robust in dealing with the bad effects they
can cause.

Given that converting punctuation into HEX is NOT a recommended practice, why are we doing it anyway?

Some of these concerns were a lot more relevant in 1993 when this was written. These days the "^From " bugs, etc. are anachronisms.

gnutls: libetpan uses obsolete gnutls interfaces

Hi

I've got following bug report for libetpan debian package:


This package is using some functions which are marked deprecated in
newer versions of GnuTLS (>=2.12.x). (They are not yet removed, though.)
These functions will be removed in future releases. GnuTLS 2.12.x is
already available in experimental.

Excerpt from buildlog:

mailstream_ssl.c:459:3: warning: 'gnutls_protocol_set_priority' is deprecated (declared at /usr/include/gnutls/compat.h:344)
mailstream_ssl.c:460:3: warning: 'gnutls_cipher_set_priority' is deprecated (declared at /usr/include/gnutls/compat.h:335)
mailstream_ssl.c:461:3: warning: 'gnutls_kx_set_priority' is deprecated (declared at /usr/include/gnutls/compat.h:342)

mailstream_ssl.c:462:3: warning: 'gnutls_mac_set_priority' is deprecated (declared at /usr/include/gnutls/compat.h:337)

The gnutls_*_set_priority family of functions has been marked deprecated
in 2.12.x. These functions have been superceded by
gnutls_priority_set_direct(). The replacement function was added in gnutls
stable release 2.2.0 (released 2007-12-14).


Bug report is at http://bugs.debian.org/624071

Could you please fix the library to avoid using obsolete interfaces?

SMTP SSL connection with callback

No callback function is called when smtp connection is created using " mailsmtp_ssl_connect_with_callback() " function. The reason behind it may be " mailstream_ssl_open() " is called inside " mailsmtp_ssl_connect_with_callback() " rather than
" mailstream_ssl_open_with_callback() " . Correct me if I am wrong.

SSL: return more precise error when ssl connection failed

in mailimap_ssl.c mailimap_ssl_connect returns MAILIMAP_ERROR_CONNECTION_REFUSED when no ssl connection can be achieved. Please use a different return-value when it is only the ssl-stream that cannot be opened but the tcp connection succeeded.

IMAP: 'New' message flag not set correctly

Fetching the flags attribute (MAILIMAP_FETCH_ATT_FLAGS) of a mail with the call mailimap_fetch_type_new_fetch_att_list_add(...) returns 0 for a message which should have the flag MAIL_FLAG_NEW. Anyways, the method mailmessage_get_flags(...) does it's job correctly.

Can anybody verify this?

I'm using libetpan 1.0 on iOS 4.2

Fail to build on window 7 , visual studio express 2008

getting compilation errors "

1>Compiling...
1>mailstream_cfstream.c
1>d:\dev\cpp\imap\src\data-types\mailstream_cfstream.c(44) : fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory
1>acl.c
1>d:\dev\cpp\imap\src\low-level\imap\mailimap.h(57) : fatal error C1083: Cannot open include file: 'libetpan/mailimap_id.h': No such file or directory
1>acl_parser.c
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(2972) : error C2061: syntax error : identifier 'uint64_t'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(2973) : error C2059: syntax error : '}'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(2974) : error C2059: syntax error : '}'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(2975) : error C2059: syntax error : '}'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3256) : error C2061: syntax error : identifier 'uint8_t'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3257) : error C2061: syntax error : identifier 'sel_has_recent'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3257) : error C2059: syntax error : ';'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3257) : error C2059: syntax error : ':'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3258) : error C2059: syntax error : '}'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_parser.h(203) : error C2143: syntax error : missing ')' before ''
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_parser.h(203) : error C2081: 'uint64_t' : name in formal parameter list illegal
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_parser.h(203) : error C2143: syntax error : missing '{' before '
'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_parser.h(203) : error C2059: syntax error : ')'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_parser.h(206) : error C2143: syntax error : missing ')' before ''
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_parser.h(206) : error C2081: 'uint64_t' : name in formal parameter list illegal
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_parser.h(206) : error C2143: syntax error : missing '{' before '
'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_parser.h(206) : error C2059: syntax error : ')'
1>acl_sender.c
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(2972) : error C2061: syntax error : identifier 'uint64_t'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(2973) : error C2059: syntax error : '}'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(2974) : error C2059: syntax error : '}'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(2975) : error C2059: syntax error : '}'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3256) : error C2061: syntax error : identifier 'uint8_t'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3257) : error C2061: syntax error : identifier 'sel_has_recent'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3257) : error C2059: syntax error : ';'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3257) : error C2059: syntax error : ':'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_types.h(3258) : error C2059: syntax error : '}'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(129) : error C2146: syntax error : missing ')' before identifier 'mod_sequence_valzer'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(129) : error C2081: 'uint64_t' : name in formal parameter list illegal
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(129) : error C2061: syntax error : identifier 'mod_sequence_valzer'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(129) : error C2059: syntax error : ';'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(129) : error C2059: syntax error : ','
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(130) : error C2059: syntax error : ')'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(134) : error C2146: syntax error : missing ')' before identifier 'mod_sequence_valzer'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(134) : error C2081: 'uint64_t' : name in formal parameter list illegal
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(134) : error C2061: syntax error : identifier 'mod_sequence_valzer'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(134) : error C2059: syntax error : ';'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(134) : error C2059: syntax error : ','
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(135) : error C2059: syntax error : ')'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(195) : error C2146: syntax error : missing ')' before identifier 'modseq'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(195) : error C2081: 'uint64_t' : name in formal parameter list illegal
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(195) : error C2061: syntax error : identifier 'modseq'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(195) : error C2059: syntax error : ';'
1>d:\dev\cpp\imap\src\low-level\imap\mailimap_sender.h(195) : error C2059: syntax error : ')'
1>acl_types.c

Should replace ./configure with autogen.sh.

The README.md mentions running ./configure to build libetpan, but this does not work, because there is no ./configure file to run.

I just happened to find the ./autogen.sh file, which seems to create ./configure for you, and then run it for you too.

So, you guys should probably just replace mentioning ./configure with ./autogen.sh, and perhaps also mention needing GNU AutoTools or whatever dependencies not leaving a ./configure around for users who are not developers.

Furthermore, even your releases ( https://github.com/dinhviethoa/libetpan/releases ) do not have a ./configure pre-generated for users who are not developers. Which is perhaps a bug beyond replacing ./configure with ./autogen.sh. Because do you really want to require users who arn't developers to install GNU AutoTools or whatever build system autogen.sh uses?

Does libetpan support Gmail OAuth 2.0?

The Gmail IMAP and SMTP servers have been extended to support authorization via the industry-standard OAuth 2.0 protocol.

The SASL XOAUTH2 mechanism enables clients to provide OAuth 2.0 credentials for authentication. SASL XOAUTH2 protocol documentation

That is to say we should use SASL XOAUTH mechanism for IMAP authentication while using OAuth 2.0.

I wonder how to do this based on current libetpan. I found only IMAP_AUTH_TYPE_PLAIN is used. Should I change IMAP_AUTH_TYPE? Also, I am wondering if I need to extend cyrus-sasl...

libetpan/libetpan-config.h not found

I followed the instructions exactly (I ran ./update.sh) on the build-mac folder..

yet when i run the application on libetpan ios target, it complains that libetpan/libetpan-config.h file not found.. (appears in line 109 in libetpan/src/low-level/imap/mailimap_types.h) although it clearly exists in there.. i tried copying it into the 'compile sources' in the build phases tab.. but i still get that error message.. any ideas?

Ask for batch operation for some IMAP commands.

I found that some IMAP command can operated on multiple message at once eg. STORE, COPY etc., but libETPan is send these command with only 1 message. If I want to add the new function to operate these command with multiple messages, should I add the new function in the mailsession_driver or add it by create a new extension?

Connection Refused Error

Hi, I am using libEtPan in my iOS app. Thank you for your great library!

I've submitted my app to App Store recently. However, my binary was rejected because the review team couldn't connect to the mail account I had provided (A Yahoo! mail account). Luckily, I got log. It seems that the IMAP and SMTP configuration is OK.

Incoming Server - imap.mail.yahoo.com
Outgoing Server - smtp.mail.yahoo.com
Incoming Port - 993 (requires SSL)
Outgoing Port - 465 (requires SSL/TLS)

I found they had passed IMAP. But there was an error when they tried to connect to the SMTP server. Specifically, it's an MAILSMTP_ERROR_CONNECTION_REFUSED error. With investigation, I found this kind of error was returned if a connection couldn't be established.

I've submitted my app for twice. The same problem. (Everything is OK in my environment.)
Is it possible that the review team tested my app behind a firewall? Or would any other reasons cause such problem?

Very much appreciated for your advice or suggestion! Thanks.

POP3: APOP authentication does not work

Hi,

APOP authentication does not work with the mail applet from cairo-dock (http://glx-dock.org/). Here is a Wireshark trace:

There is a first connection attempt:
==============================8<------------------------------
+OK POP3 ready 1462299066.1311785279@pop3-g25

APOP xxx 05e4340e6dbba8e96609321897e1adb3

-ERR [AUTH] Error logging in.

USER xxx

QUIT

------------------------------>8==============================

Followed a second connection:
==============================8<------------------------------
+OK POP3 ready 358170752.1311785279@pop3-g25

USER xxx

+OK

PASS yyy

+OK server ready

LIST

+OK 0 messages

.

UIDL

+OK 0 messages

.

QUIT

+OK pop.free.fr Zimbra POP3 server closing connection

------------------------------>8==============================

However, other applications (typically popfile) can use APOP on that server:
==============================8<------------------------------
+OK POP3 ready 267995928.1311785279@pop6-g25

APOP xxx 4b238b45673286be5c5739cfee03f995

+OK server ready

LIST

+OK 0 messages

.

UIDL

+OK 0 messages

.

QUIT

+OK pop.free.fr Zimbra POP3 server closing connection

------------------------------>8==============================

This is with version 1.0 of libetpan installed from the 64-bits ArchLinux package.

Segfault in src/data-types/mailstream.c

Hello,

I`m currently using WIFI connection at home which is losing assocation with my home
network a lot lately. This is I think culprit for claws-mail crashing on me for the 4th time
this month while sitting in tray and checking my POP3/IMAP/NNTP accounts every
20 minutes. Libetpan seems to be not coping with this situation well.

claws-mail version: 3.7.10
libetpan version: 1.1

Here's backtrace:

Claws Mail version 3.7.10
GTK+ version 2.24.6 / GLib 2.28.8
Locale: pl_PL.ISO8859-2 (charset: ISO-8859-2)
Features: IPv6 iconv compface GnuTLS GNU/aspell libetpan libSM
Operating system: FreeBSD 8.2-STABLE (i386)

C Library: Nieznany

[New Thread 2a864d80 (LWP 100290/claws-mail)]
[New Thread 29801140 (LWP 100139/initial thread)]
[Switching to Thread 2a864d80 (LWP 100290/claws-mail)]
0x295e1d49 in wait4 () from /lib/libc.so.7
#0 0x295e1d49 in wait4 () from /lib/libc.so.7

No symbol table info available.
#1 0x295bad13 in waitpid () from /lib/libc.so.7

No symbol table info available.
#2 0x28c75652 in waitpid () from /lib/libthr.so.3

No symbol table info available.
#3 0x080d6d47 in crash_handler (sig=11) at crash.c:541

pid = 6133
crashed_ = 1

#4

No symbol table info available.
#5 0x291b2735 in mailstream_set_privacy (s=0x0, can_be_public=1)

at mailstream.c:322

No locals.
#6 0x29200a46 in send_command_private (f=0x2c5826a0,

command=0xbf9fed2b "MODE READER\r\n", can_be_published=1)
at newsnntp.c:2519
r = 0

#7 0x29200a10 in send_command (f=0x2c5826a0,

command=0xbf9fed2b "MODE READER\r\n") at newsnntp.c:2512

No locals.
#8 0x291fea9a in newsnntp_mode_reader (f=0x2c5826a0) at newsnntp.c:1298

command = "MODE READER\r\n\000í\237żâ*_)\204M\206*\200M\206*\210í\237ż/p\"\b\200˝e+Ç85\b\a\000\000\000@źe+\200č\205-\001\000\000\000@źe+<\000\000\000\001\000\000\000\200˝e+ŕł\202*\000\000\000\000\224Ů$)\204M\206*\030î\237ż\224Ů$)\204M\206*\200M\206*Čí\237żůü\032)Ȳ\202* \000\000\000\004\2059\b\020 \000\000\036\000\000\000 \000\000\000\0002h+Ä\220Ç(\200˝e+\200M\206*\204M\206*(#\033)\200˝e+\000ŕe+\036\000\000\000\224Ů$)\204M\206*\200M\206*\030î\237żůü\032)\000˛\202"...
response = 0x838412c "8>8\b"
r = 713444740

#9 0x082288f5 in mode_reader_run (op=0x2d802b40) at nntp-thread.c:875

param = (struct mode_reader_param *) 0xbfbfe570
result = (struct mode_reader_result *) 0xbfbfe56c
r = 710555208

#10 0x0824c853 in thread_run (data=0x2a5a3640) at etpan-thread-manager.c:344

do_quit = 0
op = (struct etpan_thread_op *) 0x2d802b40
thread = (struct etpan_thread *) 0x2a5a3640
r = 0

#11 0x28c7373f in pthread_getprio () from /lib/libthr.so.3

No symbol table info available.
#12 0x00000000 in ?? ()

No symbol table info available.

build problems

when building the latest tip in slackware64 i'm getting this:

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -D_REENTRANT -O2 -fPIC -W -Wall -MT mailstream_cancel.lo -MD -MP -MF .deps/mailstream_cancel.Tpo -c mailstream_cancel.c -fPIC -DPIC -o .libs/mailstream_cancel.o
mv -f .deps/mailsem.Tpo .deps/mailsem.Plo
/bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -D_REENTRANT -O2 -fPIC -W -Wall -MT mailstream_cfstream.lo -MD -MP -MF .deps/mailstream_cfstream.Tpo -c -o mailstream_cfstream.lo mailstream_cfstream.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -D_REENTRANT -O2 -fPIC -W -Wall -MT timeutils.lo -MD -MP -MF .deps/timeutils.Tpo -c timeutils.c -fPIC -DPIC -o .libs/timeutils.o
mailstream_cancel.c: In function ‘mailstream_cancel_notify’:
mailstream_cancel.c:135:7: warning: variable ‘r’ set but not used [-Wunused-but-set-variable]
mailstream_cancel.c: In function ‘mailstream_cancel_ack’:
mailstream_cancel.c:157:7: warning: variable ‘r’ set but not used [-Wunused-but-set-variable]
mailstream_cancel.c: In function ‘mailstream_cancel_get_fd’:
mailstream_cancel.c:181:39: warning: variable ‘ms_internal’ set but not used [-Wunused-but-set-variable]
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -D_REENTRANT -O2 -fPIC -W -Wall -MT mailstream_cancel.lo -MD -MP -MF .deps/mailstream_cancel.Tpo -c mailstream_cancel.c -o mailstream_cancel.o >/dev/null 2>&1
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -D_REENTRANT -O2 -fPIC -W -Wall -MT timeutils.lo -MD -MP -MF .deps/timeutils.Tpo -c timeutils.c -o timeutils.o >/dev/null 2>&1
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -D_REENTRANT -O2 -fPIC -W -Wall -MT mailstream_cfstream.lo -MD -MP -MF .deps/mailstream_cfstream.Tpo -c mailstream_cfstream.c -fPIC -DPIC -o .libs/mailstream_cfstream.o
mailstream_cfstream.c: In function ‘mailstream_cfstream_open_voip’:
mailstream_cfstream.c:182:57: warning: unused parameter ‘hostname’ [-Wunused-parameter]
mailstream_cfstream.c:182:75: warning: unused parameter ‘port’ [-Wunused-parameter]
mailstream_cfstream.c:182:85: warning: unused parameter ‘voip_enabled’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_low_cfstream_open_voip’:
mailstream_cfstream.c:417:65: warning: unused parameter ‘hostname’ [-Wunused-parameter]
mailstream_cfstream.c:417:83: warning: unused parameter ‘port’ [-Wunused-parameter]
mailstream_cfstream.c:417:93: warning: unused parameter ‘voip_enabled’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_low_cfstream_close’:
mailstream_cfstream.c:484:59: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_low_cfstream_free’:
mailstream_cfstream.c:504:59: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_low_cfstream_get_fd’:
mailstream_cfstream.c:520:3: error: unknown type name ‘CFDataRef’
mailstream_cfstream.c:520:34: warning: initialization makes integer from pointer without a cast [enabled by default]
mailstream_cfstream.c:521:3: error: unknown type name ‘CFSocketNativeHandle’
mailstream_cfstream.c:522:3: error: unknown type name ‘CFIndex’
mailstream_cfstream.c:523:3: error: unknown type name ‘CFIndex’
mailstream_cfstream.c:530:21: error: dereferencing pointer to incomplete type
mailstream_cfstream.c:533:25: error: ‘CFDataRef’ undeclared (first use in this function)
mailstream_cfstream.c:533:25: note: each undeclared identifier is reported only once for each function it appears in
mailstream_cfstream.c:533:35: error: expected ‘;’ before ‘CFReadStreamCopyProperty’
mailstream_cfstream.c:537:3: warning: implicit declaration of function ‘CFDataGetLength’ [-Wimplicit-function-declaration]
mailstream_cfstream.c:538:23: error: ‘CFIndex’ undeclared (first use in this function)
mailstream_cfstream.c:538:31: error: expected ‘;’ before ‘sizeof’
mailstream_cfstream.c:541:5: warning: implicit declaration of function ‘CFRelease’ [-Wimplicit-function-declaration]
mailstream_cfstream.c:545:3: warning: implicit declaration of function ‘CFDataGetBytes’ [-Wimplicit-function-declaration]
mailstream_cfstream.c:545:3: warning: implicit declaration of function ‘CFRangeMake’ [-Wimplicit-function-declaration]
mailstream_cfstream.c:545:95: error: ‘UInt8’ undeclared (first use in this function)
mailstream_cfstream.c:545:102: error: expected expression before ‘)’ token
mailstream_cfstream.c: In function ‘mailstream_low_cfstream_read’:
mailstream_cfstream.c:753:62: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c:754:52: warning: unused parameter ‘buf’ [-Wunused-parameter]
mailstream_cfstream.c:754:64: warning: unused parameter ‘count’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_low_cfstream_write’:
mailstream_cfstream.c:784:63: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c:785:59: warning: unused parameter ‘buf’ [-Wunused-parameter]
mailstream_cfstream.c:785:71: warning: unused parameter ‘count’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_low_cfstream_cancel’:
mailstream_cfstream.c:839:61: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_set_ssl_enabled’:
mailstream_cfstream.c:859:54: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c:859:61: warning: unused parameter ‘ssl_enabled’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_is_ssl_enabled’:
mailstream_cfstream.c:934:53: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_set_ssl_verification_mask’:
mailstream_cfstream.c:945:65: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c:945:72: warning: unused parameter ‘verification_mask’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_set_ssl_peer_name’:
mailstream_cfstream.c:954:57: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c:954:73: warning: unused parameter ‘peer_name’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_set_ssl_is_server’:
mailstream_cfstream.c:970:57: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c:970:64: warning: unused parameter ‘is_server’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_set_ssl_level’:
mailstream_cfstream.c:979:53: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c:979:60: warning: unused parameter ‘ssl_level’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_wait_idle’:
mailstream_cfstream.c:988:48: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c:988:55: warning: unused parameter ‘max_idle_delay’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_setup_idle’:
mailstream_cfstream.c:1026:50: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_unsetup_idle’:
mailstream_cfstream.c:1039:52: warning: unused parameter ‘s’ [-Wunused-parameter]
mailstream_cfstream.c: In function ‘mailstream_cfstream_interrupt_idle’:
mailstream_cfstream.c:1052:54: warning: unused parameter ‘s’ [-Wunused-parameter]
mv -f .deps/mailstream_cancel.Tpo .deps/mailstream_cancel.Plo
make[5]: *** [mailstream_cfstream.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
mv -f .deps/timeutils.Tpo .deps/timeutils.Plo
make[5]: Leaving directory /home/higuita/build/claws-mail/libetpan/src/data-types' make[4]: *** [all] Error 2 make[4]: Leaving directory/home/higuita/build/claws-mail/libetpan/src/data-types'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory /home/higuita/build/claws-mail/libetpan/src' make[2]: *** [all] Error 2 make[2]: Leaving directory/home/higuita/build/claws-mail/libetpan/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/higuita/build/claws-mail/libetpan'
make: *** [all] Error 2

thanks

Closing session

How to close IMAP session ? does sending "LOGOUT" command closes session?,.i am seeing strange behavior , when i send LOGOUT command on my server i am seeing logout command but closesession never gets called.,when i send LOGIN command it opens new session but when i LOGOUT it does not close session i guess..kindly help me.

Parse Error in Bodystructure breaks mailstream on special spam mail (imap handle)

mail is attached. INLINE cuz I cant add it as attachment.

after parse error (-5) the mailstream is not in sync any more.

test code and mailstreamdebug below.

if you want the whole mail no problem. its just spam. I check if I can put it somewhere reachable from the internet.

Greetz


#include 
#include 

int main()
{
    mailimap *imap_connection = NULL;
    char *username = "myuser";
    char *password = "mypassword";
    uint32_t mail_uid;
    int err;

    {
        mailstream_low *old_stream_low;
        mailstream_low *new_stream_low;
        int fd;

        mailstream_debug = 1;

        imap_connection = mailimap_new(0, NULL);
        err = mailimap_socket_connect(imap_connection, "localhost", 143);
        mailimap_starttls(imap_connection);
        old_stream_low = mailstream_get_low(imap_connection->imap_stream);
        fd = mailstream_low_get_fd(old_stream_low);
        new_stream_low = mailstream_low_ssl_open(fd);
        mailstream_low_free(old_stream_low);
        mailstream_set_low(imap_connection->imap_stream, new_stream_low);
    }


    err = mailimap_login(imap_connection, username, password);
    printf("mailimap_login: %d\n", err);
    err = mailimap_select(imap_connection, "LTA/10");
    printf("mailimap_select: %d\n", err);

    for (mail_uid = 752; mail_uid < 760; ++mail_uid) {
        printf("-----------------\n");
        printf("mail uid is: %u\n", mail_uid);
        {
            struct mailimap_set * set = mailimap_set_new_single(mail_uid);
            struct mailimap_fetch_att* fetch_uid = mailimap_fetch_att_new_uid();
            struct mailimap_fetch_att* fetch_att_bs = mailimap_fetch_att_new_bodystructure();
            struct mailimap_fetch_type* fetch_type = mailimap_fetch_type_new_fetch_att_list_empty();
            mailimap_fetch_type_new_fetch_att_list_add(fetch_type, fetch_uid);
            mailimap_fetch_type_new_fetch_att_list_add(fetch_type, fetch_att_bs);
            clist * res = NULL;

            printf("calling mailimap_uid_fetch\n");
            err = mailimap_uid_fetch(imap_connection, set, fetch_type, &res);
            printf("mailimap_uid_fetch (uid + bodystructure): %d\n", err);

            if (fetch_type) {
                mailimap_fetch_type_free(fetch_type);
            }
            if (res) {
                mailimap_fetch_list_free(res);
            }
            if (set) {
                mailimap_set_free(set);
            }
        }
        if (err) {
            continue;
        }

        {
            struct mailimap_set * set = mailimap_set_new_single(mail_uid);
            struct mailimap_fetch_att* mail_header_att = mailimap_fetch_att_new_rfc822_header();
            struct mailimap_fetch_type* fetch_type = mailimap_fetch_type_new_fetch_att_list_empty();
            mailimap_fetch_type_new_fetch_att_list_add(fetch_type, mail_header_att);
            clist * res = NULL;

            printf("calling mailimap_uid_fetch\n");
            err = mailimap_uid_fetch(imap_connection, set, fetch_type, &res);
            printf("mailimap_uid_fetch (header): %d\n", err);

            if (fetch_type) {
                mailimap_fetch_type_free(fetch_type);
            }
            if (res) {
                mailimap_fetch_list_free(res);
            }
            if (set) {
                mailimap_set_free(set);
            }
        }
    }

    return 0;
}


>>>>>>> send >>>>>>
6 UID FETCH 753 (UID BODYSTRUCTURE)

>>>>>>> end send >>>>>>
<<<<<<< read <<<<<<
* 753 FETCH (UID 753 BODYSTRUCTURE (("text" "plain" ("charset" "UTF-8") NIL NIL "7bit" 142 11 NIL NIL NIL NIL)( (("=?Windows-1251?B?yvDo8fLo7eAg0e7q7uvu4uA=?=" NIL "ornroxieg" "yahoo.co.uk")) (("=?Windows-1251?B?yvDo8fLo7eAg0e7q7uvu4uA=?=" NIL "ornroxieg" "yahoo.co.uk")) (("=?Windows-1251?B?yvDo8fLo7eAg0e7q7uvu4uA=?=" NIL "ornroxieg" "yahoo.co.uk")) ((NIL NIL "suport" "saleff.ru")) NIL NIL NIL "<[email protected]>") ("text" "html" ("charset" "Windows-1251") NIL NIL "8bit" 24146 577 NIL NIL NIL NIL) 639 NIL ("attachment" ("filename" "evil.eml")) NIL NIL) "mixed" ("boundary" "=-bcC328BF6XEYj5NukQCl") NIL NIL NIL))
6 OK Fetch completed.

<<<<<<< end read <<<<<<
753 FETCH (UID 753 BODYSTRUCTURE (("text" "plain" ("charset" "UTF-8") NIL NIL "7bit" 142 11 NIL NIL NIL NIL)("m (("=?Windows-1251?B?yvDo8fLo7eAg0e7q7uvu4uA=?=" NIL "ornroxieg" "yahoo.co.uk")) (("=?Windows-1251?B?yvDo8fLo7eAg0e7q7uvu4uA=?=" NIL "ornroxieg" "yahoo.co.uk")) (("=?Windows-1251?B?yvDo8fLo7eAg0e7q7uvu4uA=?=" NIL "ornroxieg" "yahoo.co.uk")) ((NIL NIL "suport" "saleff.ru")) NIL NIL NIL "<[email protected]>") ("text" "html" ("charset" "Windows-1251") NIL NIL "8bit" 24146 577 NIL NIL NIL NIL) 639 NIL ("attachment" ("filename" "evil.eml")) NIL NIL) "mixed" ("boundary" "=-bcC328BF6XEYj5NukQCl") NIL NIL NIL))
>>>>>>> send >>>>>>
7 UID FETCH 754 (UID BODYSTRUCTURE)

>>>>>>> end send >>>>>>
>>>>>>> send >>>>>>
8 UID FETCH 755 (UID BODYSTRUCTURE)

>>>>>>> end send >>>>>>
<<<<<<< read <<<<<<
* 754 FETCH (UID 754 BODYSTRUCTURE (("text" "plain" ("charset" "UTF-8") NIL NIL "7bit" 327 12 NIL NIL NIL NIL)("text" "x-log" ("name" "libetpan-stream-debug.log" "charset" "UTF-8") NIL NIL "quoted-printable" 41046 934 NIL ("attachment" ("filename" "libetpan-stream-debug.log")) NIL NIL) "mixed" ("boundary" "=-679Ofk71cz/diTim9n95") NIL NIL NIL))
7 OK Fetch completed.

<<<<<<< end read <<<<<<
>>>>>>> send >>>>>>
9 UID FETCH 756 (UID BODYSTRUCTURE)

>>>>>>> end send >>>>>>
......

example mail:
``
Received: (qmail 28129 invoked by uid 0); 23 Jan 2012 03:56:47 -0000
Received: from firewall-server.securepoint.local (HELO mta.realsecure.de)
(192.168.3.1) by uma.securepoint.local with ESMTPS; 23 Jan 2012 03:56:47
-0000
Received: from www.kastor.casio.de (www.kastor.casio.de [213.128.133.99])
by mta.realsecure.de (8.14.4/8.14.4) with ESMTP id q0N3uisX016871
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for
[email protected]; Mon, 23 Jan 2012 04:56:46 +0100
Received: from nm23-vm1.bullet.mail.ukl.yahoo.com
(nm23-vm1.bullet.mail.ukl.yahoo.com [217.146.177.100]) by
www.kastor.casio.de (8.14.3/8.14.3/Debian-5+lenny1) with SMTP id
q0N3xT6r018072 for [email protected]; Mon, 23 Jan 2012
04:59:34 +0100
Received: from [217.146.183.209] by nm23.bullet.mail.ukl.yahoo.com with
NNFMP; 23 Jan 2012 03:56:38 -0000
Received: from [77.238.184.78] by tm2.bullet.mail.ukl.yahoo.com with NNFMP;
23 Jan 2012 03:56:38 -0000
Received: from [127.0.0.1] by smtp147.mail.ukl.yahoo.com with NNFMP; 23 Jan
2012 03:56:38 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk;
s=s1024; t=1327290998; bh=x9cCIYIfYAvWQOfLZm80wLWa/dxIFy5OsAQC8cLT0wg=;
h=X-Yahoo-Newman-Id:Message-ID:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Date:From:To:Subject:X-Mailer:X-Priority:MIME-Version:Content-Type:Content-Transfer-Encoding;
b=wlwNtNw8ZIDGqfLojQwkiuT4MpvPi+WmTL8BpzXKLUfoWq9NbS1CR/rPMeoDyhVGX8JGfZMgprQ4NkvnEEg9QNakh5mVRwCDq3CkY2SwED1J2j9IE83FsPWvFYt8ZwyRFdPT/Q4BrUDvc5vennvLBiofzj2qNBf+Gd7lqjPkW4E=
X-Yahoo-Newman-Id: [email protected]
Message-ID: [email protected]
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: toUUNXcVM1mmDql53aIjuTERuNMHXtYU0EoMVFMbJ6E38Qb
2DOlRPTWPPlrTX1dPOV682xpkTfmxUpLzZerN20R9wvMGq8upmxd9r7Jby7B
CZCyH4vicOSdUz0erpvWkW14rLVmNBEhWe.muYhbZtWkk1WmdPAvi2MHR286
KuDuXxUvTcH3q0Jme54lnxvcPsonN.ejUYXqCnwKe5IQCNRewJap9KE8dgrf
KXp4.Zjj2fQT.c.mnUcUN.gHwq0ijfBGeuzxYDYmZ8.xICB_DhcqoTFou_CL
3UJVGVX6dt3RW4q7yDasBQYdATCIjkazSTUnvzMJE2yoIXj5Cik3cjuHHkzC
UAx4fDgunHBO9d2I.8MtgENoChHQfur0-
X-Yahoo-SMTP: Xhnvu06swBDez5hHQdB_opTJRkSLCQ--
Received: from 188.249.155.250 ([email protected] with login) by
smtp147.mail.ukl.yahoo.com with SMTP; 23 Jan 2012 03:56:36 +0000 GMT
Date: Mon, 23 Jan 2012 07:55:04 +0400
From: =?Windows-1251?B?yvDo8fLo7eAg0e7q7uvu4uA=?= [email protected]
To: [email protected]
Subject:
X-Mailer: The Bat! (v3.85.03) Professional
X-Priority: 3 (Normal)
MIME-Version: 1.0
Content-Type: text/html; charset=Windows-1251
X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-3.0
(mta.realsecure.de [87.139.55.127]); Mon, 23 Jan 2012 04:56:46 +0100 (CET)
X-Securepoint-SPID: 28135
X-Securepoint-SID:
2012012303562400000878274500-ac63837eacd885c1ebf8c35099f2ac9e43a6b958
X-Securepoint-SKIM: v=1; a=rsa/sha256; c=simple/simple;
d=uma.securepoint.local; q=local/txt;
bh=JmWJjRBwQIhCoiXxvjq5xd4hDUi1Ges0mMHGr9Hdzv8=;
h=From:From:Sender:Reply-To:To:To:Cc:Bcc:Date:Date:Subject:Subject:Message-ID:Message-ID:In-Reply-To:
References:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Bcc:Resent-Date:Resent-Message-ID:
MIME-Version:MIME-Version:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:
Content-ID:Content-Description:Content-Disposition:X-Securepoint-SPID:X-Securepoint-SPID:
X-Securepoint-SID:X-Securepoint-SID;
b=bb7tIy8kVSGflJOFR5CH9YQGZX2GA9twMSWtz5f+1O0oAAAAIQAAAFD8BAggAAAA
IQAAAAAAAAABAAAAIPgECCAAAABJAAAA8P0ECAAAAAAAAAAAAAAAAAAAAAAAAAAA
wPUECAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=;
Content-Transfer-Encoding: 8bit

<title></title>

���������� ���
��. ����� �������� �.10 ��.22
t/f. (495)626-15-26, 229--80--26

�����-���� �� ��������������

�������������� ��������
(����������� ��� ������ �������������� ������ � �� ���������)

10-12�.�. ������ 21000 ������
15-17�.�. ������ 17500 ������
1 ����� ������ 15000 ������
���������� �������  14000 ������

�������� 64 ����� ��� ������ (����������� ��� ���������)
(�������� ������� �������)

��� ������ ���� ���������� ���� � ������
��� ������� ������ 7-8 ������� ���� 35000 ������
��� ������� ������ 10-12 ������� ���� 19000 ������
��� ������� ������ 15-17 ������� ���� 17000 ������

������ �� �� ���� �������� ������� + 100 ����

�������� 64 ����� ���������� �������
(����������� �� ���������)
(�������� ������� �������)

��� ������ ���� ���������� ���� � ������
��� ������� ���������� ������� 10-12 ������� ���� 17500 ������
��� ������� ���������� ������� 15-17 ������� ���� 16000 ������
��� ������� ���������� ������� 1 ����� 13000 ������

�������� 64 ����� ������ (������ ������ ��, ����� ������ � �����������) (����������� �� ���������)
(�������� ������� �������)

��� ������ ���� ���������� ���� � ������
��� ������� �� 23-25 ������� ���� 21000 ������
��� ������� �� ���������� 18000 ������

 

������ ���� ���������� ���� ���������� ���������
������� 6-7 �� 14 ����
30/90
60/180
90/360
�����
250����  
500����+�/��
850����+�/��
1400����+�/��
6200�
��� 3 �. �  ��� ������ 1 ���
2 ����
14 500 �
+�/�� 100 $
������ 10-19 �.�. 180 ��. 180 ����
�������� 7 -10 �.�     �� 15 ��. 180����+1000
�� 22 200����+1000
30/90 350����+1000
90/180 400����+1000
180/360 700����+1000
������� 5-7 ���.���� �� 14����
30/90
60/180
90/360
300����+�/� 
450����+�/�
700 ����+�/�
1200����+�/�
������� 8 ���. ���� �� 11 220
�� 17 230
�� 28 240
2-� ����. ����� 220
�������� 4-5�.� ��� ������
�� 15 ��. 180+�/�
15 ������ 200+�/�
30 ������ 250+�/�
30/90 350����+�/�
30 ������� 350����+�/�
60/180 380����+�/�
90/360 520����+�/�
���������
 
3-4 �.�.��� ������ 7-10����
10-15����

30/90
60/180
90/360
150����+��
200����+��

500 + �/�
600 + �/�
900 + �/�
    15 �� 210 ����
    21 �� 260 ����
������ 3-5 �.�. 1 ��� 320 ����
    45��/������ 340 ����
    30/90 450 ����
    60/180 700 ����
     90/360  1000 ����
�������  5-7 �.�.
2 ���.���
30/90
90/360
250 ����
950 ����
������
�����
  �� 8��
�� 15��
30 ���� ��/��
�� 22��

30/90�����
30/90����

90/90
90/180����
180/365
180
210
250/330
280
4
50 + �/�
500 + �/�
550 + �/�
800
800 + �/�
������
������
7 �.�. 30/90
45/180����
90/180����
90/365����
180/365����/�����
3����
500 + �/�
600 + �/�
800
800 + �/�
1200
3600
����� 6 � � �� 90/90 ���� 250 ����
���� 8-9 �� 90/360 110 ����
����� 12� 6� 4� 3���  6��� ��� 4500/5400/6600�
6000/6900/8100�
15000/15900/17100
���������� 12 �.� 90/180 1100 ����
������   8 �� 110 ����
  15 ��. 130 ����
7/4 � �� 8/30 ���, ��� 200 ����
  15/30 ���, ��� 210 ����
  30/90 ���, ����� 220 ����
  45/180 ��� 280 ����
������� 14�.� 90/365 300 ����
�������� 5 �.� �� 5 ������ 100 ��������
��������   14 ��. ���������
�������� 12 �.�. �� 15 �. 220 ����
    �� 15 �. 180+�/��
��������� 10 �.�. � ���������� 30 ������� 270+�/��
30/90 ������ 500+�/��
60/180 ������ 600+�/�
90/360 700+�/�
�������
 
5 �.�.��� ������//�/�� �� 14 �.�. 8��
14��
��� ����
8-14���
30/30

30/90
60/180
90/365
1�
2�
3�
100+��
120+��
250+��
280+��
330+��

400 + �/�
500 + �/�
700 + �/�
1000
2000
3500
�����
 
10-12 �.� �� 8 ���� ����
�� 14����
30/90
90/360
90/360
150/270
170/300
450
900
1100
  2 �.� 14 ��. 800 �
������ 3 �.� 14 ��. 650 �
  8 �.�. 14 ��. 500 �
  8 �.�. 7 �� 270
  5-7�.� 180/360 1500
��������� 5-7 �.� ��8/14
30/90
45/180
90/365
290� 320+��
400 + �/�
550 + �/�
700 + �/�
������ 12 �.� 90/90 450 ��������
������� 7-8 �.�. �� 7
��10
�� 14
200 ����
220 ����
240 ����

���������� ����� � ������, ���������, ���������, ��������

������ ����� �������� ������������� ������������, �� ���������� ��� ���������� ������������ ������������ ����������� �� ����� ����, ��������������� ������� �� ������ � ������, � ����� ������������ ������. ����� �� ����� ��������� ������ �� ��� ���������� ����.

tt/f. (495)626--15--26, 229-80--26

 

 

``

libetpan-prepare-ios build failed

tool:Xcode 4.6
system:Mac OS X 10.7.5
error:
running prepare-cyrus-sasl.sh
prepare sources
patching file lib/client.c
building tools
generated makemd5i386 properly
building for iPhoneOS - armv7
-arch armv7 -isysroot /Applications/Xcode -Os -miphoneos-version-min=7.0
prepare-cyrus-sasl.sh: line 145: test: /Applications/Xcode: binary operator expected
prepare-cyrus-sasl.sh: line 152: test: /Applications/Xcode: binary operator expected
prepare-cyrus-sasl.sh: line 157: test: /Applications/Xcode: binary operator expected
CONFIGURE FAILED
Command /bin/sh failed with exit code 1
I need you help!

mailimap_uid_fetch comment missing

mailimap_uid_fetch has the same comment as mailimap_fetch in https://github.com/dinhviethoa/libetpan/blob/master/src/low-level/imap/mailimap.h

/*
mailimap_fetch()

This function will retrieve data associated with the given message
numbers.

@param session IMAP session
@param set set of message unique identifiers
@param fetch_type type of information to be retrieved
@param result The result of this command is a clist
and it is stored into (* result). Each element of the clist is a
(struct mailimap_msg_att *).

@return the return code is one of MAILIMAP_ERROR_XXX or
MAILIMAP_NO_ERROR codes
*/

please update

Using imap_search results.

Hello!

I am trying to get messages from gmail mailbox in given date interval. I tried imap_search and imap_uid_search (what is the difference, by the way?). The clist_count(searchResult) is ok, it behaves as expected. The problem is, how to use this result (list of uids, right)? I tried to use code from imap-sample, but in fetch_msg function clist_count(fetch_result) after calling mailimap_uid_fetch is 0. Is uid become invalid?The error code of mailimap_uid_fetch is 0. Am i missing somethins in using uids?

Thanks!

Is there Some Example Code to Parse Email Header and Attachment?

I have read the Example Code in Tests Directory. but i still don't understand How to Pase Each Part of a EMail.
For Example, I have got the EMail Message Content in data of bytes. How do I get the Subject,From,Receiver,and Attachment Part From the data?
I Notice there was a Example Code called Parse-MIME in Tests Directory. but it seems too hard for me to understand and use.
could anyone supply me some sample code to parse each part of a Email?

Does it support smime?

As the title ,I want to send a mail which could be encrypted,in other words,How can I build a .p7m packbag with recipient's publicKey(certificate).And also I want to parse a mail which is encrypted by my publicKey use my privateKey.How can I do those?Is somewhere some examples?thanks~~

POP3: No mailpop3_stat function

libEtPan appears not to expose the POP3 STAT command.

LIST can be used to get the same information as STAT but requires more information to be sent from the server, making it less ideal for this purpose.

Does not build with MinGW

after './autogen.sh' the makefile errors with the following error:

make: *** No rule to make target `/c/libetpan-00c7589/libetpan-config', needed by `../stamp-prepare'.  Stop.

The file `/c/libetpan-00c7589/libetpan-config' is present, however. 

Then I had to change the configure.ac to had to add the gdi32 line:

  SSLLIBS=""
  AC_CHECK_HEADER(openssl/ssl.h, [
   AC_CHECK_LIB(rsaref, main, [SSLLIBS="-lrsaref"])
   AC_CHECK_LIB(gdi32, main, [SSLLIBS="-lgdi32"])
   AC_CHECK_LIB(crypto, main, [SSLLIBS="-lcrypto $SSLLIBS"], [], [$SSLLIBS])
   AC_CHECK_LIB(ssl, SSL_library_init, with_openssl=yes, [], [$SSLLIBS])])

Then I had to change config.h

/* #define HAVE_PTHREAD_H 0 */

I went through all Makefiles and commented out those files. It then compiles until I get to:

 gcc -DHAVE_CONFIG_H -I. -I../../..  -I../../../include -I../../../src/data-type
s -DDEBUG -D_REENTRANT  -mms-bitfields -I../../../src/windows -O2 -g -W -Wall -M
T mailsmtp.lo -MD -MP -MF .deps/mailsmtp.Tpo -c -o mailsmtp.lo mailsmtp.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../..
/../src/data-types -DDEBUG -D_REENTRANT -mms-bitfields -I../../../src/windows -O
2 -g -W -Wall -MT mailsmtp.lo -MD -MP -MF .deps/mailsmtp.Tpo -c mailsmtp.c  -DDL
L_EXPORT -DPIC -o .libs/mailsmtp.o
mailsmtp.c: In function 'get_hostname':
mailsmtp.c:247:3: error: unknown type name 'socklen_t'
mailsmtp.c:269:5: warning: implicit declaration of function 'getnameinfo' [-Wimp
licit-function-declaration]
mailsmtp.c:269:32: error: 'struct sockaddr' has no member named 'sa_len'

so, in win_etpan.h i edited it to include:

#include <ws2tcpip.h>

in mailsmtp.c i removed the #ifdef switch (~line 269):

    r = getnameinfo(&addr, sizeof(addr), hostname, HOSTNAME_SIZE, NULL, 0, NI_NUMERICHOST);

Then I get to:

I:/Programs/MinGW/msys/1.0/bin/sh.exe ../libtool --mode=compile windres `echo -D HAVE_CONFIG_H -I. -I..  | sed -e 's/-I/--include-dir /g;s/-D/--define /g'` -i versioninfo.rc -o versioninfo.lo
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'

So I manually compiled it with:

I:/Programs/MinGW/msys/1.0/bin/sh.exe ../libtool --tag=CXX --mode=compile windres `echo -D HAVE_CONFIG_H -I. -I..  | sed -e 's/-I/--include-dir /g;s/-D/--define /g'` -i versioninfo.rc -o versioninfo.lo

build libetpan on mac (iphone)

i download a latest version of libetpan. and build in xcode on my macbook, but it does not generate the .a library file. there was a framework file, i don't know how to use it. please help me to build it.
i build libetpan use this manner: cd into build-mac directory, and execute the ./update.sh, then i open xcode, and build it. but it does not generate the .a library file. and it seems no error occur.

Build without openssl fails

I tried to compile 1.3.pre2 release with --with-openssl=no option, but it failed:

mailstream_ssl.c: In function 'locking_function':
mailstream_ssl.c:167:16: error: 'CRYPTO_LOCK' undeclared (first use in this function)

The build with openssl is successful.

unusual crash in mailstream_cancel_cancelled / libetpan 1.1

Any idea/hint what may have happened for this crash to occur due to the ms_internal ptr becoming invalid? This is with libetpan 1.1 and Claws Mail 3.9.0 for Fedora 17 accessing Google Mail via IMAP.

https://bugzilla.redhat.com/918664
Full backtrace: https://bugzilla.redhat.com/attachment.cgi?id=706152
#0 mailstream_cancel_cancelled (cancel=0x0) at mailstream_cancel.c:169

    cancelled = <optimized out>
    ms_internal = <error reading variable ms_internal (Cannot access memory at address 0x10)>

[...]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.