==================
Languages are not equally supported in all packages. The following
-matrix shows the current state of internationalization, as of May 2001.
-The matrix shows, in regard of each package, for which languages PO
-files have been submitted to translation coordination, with a
+matrix shows the current state of internationalization, as of July
+2001. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
- Ready PO files bg cs da de el en eo es et fi fr gl hr id it
- +----------------------------------------------+
- a2ps | [] [] |
- bash | [] [] [] [] |
- bison | [] [] [] [] |
- clisp | [] [] [] [] |
- cpio | [] [] [] [] |
- diffutils | [] [] [] [] [] [] [] |
- enscript | [] [] |
- error | [] |
- fileutils | [] [] [] [] [] [] [] |
- findutils | [] [] [] [] [] [] [] [] |
- flex | [] [] [] |
- gawk | |
- gcal | |
- gcc | [] |
- gettext | [] [] [] [] [] [] [] [] [] |
- gnupg | [] [] [] [] [] |
- grep | [] [] [] |
- hello | [] [] [] [] [] [] [] [] [] |
- id-utils | [] [] |
- indent | [] [] [] [] [] |
- libc | [] [] [] [] [] [] [] [] |
- lilypond | |
- lynx | [] [] [] |
- m4 | [] [] [] [] [] [] [] |
- make | [] [] [] [] |
- parted | [] [] |
- ptx | [] [] [] [] [] [] [] |
- python | |
- recode | [] [] [] [] [] [] [] [] |
- sed | [] [] [] [] [] [] [] [] [] |
- sh-utils | [] [] [] [] [] [] [] [] [] |
- sharutils | [] [] [] [] [] [] [] |
- soundtracker | |
- sp | |
- tar | [] [] [] [] [] [] [] [] |
- texinfo | [] [] [] [] |
- textutils | [] [] [] [] [] [] [] |
- util-linux | [] |
- wdiff | [] [] [] [] [] [] [] |
- wget | [] [] [] [] [] [] [] [] [] |
- +----------------------------------------------+
- bg cs da de el en eo es et fi fr gl hr id it
- 0 14 21 27 10 1 8 20 13 1 28 17 0 9 11
+ Ready PO files bg cs da de el en eo es et fi fr gl he hr id it
+ +-------------------------------------------------+
+ a2ps | [] [] |
+ bash | [] [] [] [] |
+ bfd | |
+ binutils | |
+ bison | [] [] [] [] |
+ clisp | [] [] [] [] |
+ cpio | [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] [] |
+ enscript | [] [] |
+ error | [] [] |
+ fetchmail | |
+ fileutils | [] [] [] [] [] [] [] |
+ findutils | [] [] [] [] [] [] [] [] |
+ flex | [] [] [] |
+ freetype | |
+ gas | |
+ gawk | [] |
+ gcal | |
+ gcc | |
+ gettext | [] [] [] [] [] [] [] [] [] |
+ gnupg | [] [] [] [] [] [] |
+ gprof | |
+ grep | [] [] [] [] [] [] [] |
+ hello | [] [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] |
+ indent | [] [] [] [] [] |
+ jpilot | [] |
+ kbd | |
+ ld | |
+ libc | [] [] [] [] [] [] [] [] |
+ lilypond | |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] [] [] |
+ make | [] [] [] [] [] |
+ nano | [] [] |
+ opcodes | |
+ parted | [] [] |
+ ptx | [] [] [] [] [] [] [] |
+ python | |
+ recode | [] [] [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] [] |
+ sh-utils | [] [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] |
+ soundtracker | [] |
+ sp | |
+ tar | [] [] [] [] [] [] [] [] |
+ texinfo | [] [] [] [] [] |
+ textutils | [] [] [] [] [] [] [] |
+ util-linux | [] [] |
+ wdiff | [] [] |
+ wget | [] [] [] [] [] [] [] [] [] |
+ +-------------------------------------------------+
+ bg cs da de el en eo es et fi fr gl he hr id it
+ 0 13 23 30 11 1 8 21 13 1 29 22 3 0 8 10
- ja ko lv nl no pl pt pt_BR ru sk sl sv tr zh
- +----------------------------------------------+
- a2ps | [] [] [] | 5
- bash | | 4
- bison | [] [] [] | 7
- clisp | [] | 5
- cpio | [] [] [] [] [] | 9
- diffutils | [] [] [] | 10
- enscript | [] [] [] | 5
- error | | 1
- fileutils | [] [] [] [] [] [] [] [] [] | 16
- findutils | [] [] [] [] [] [] | 14
- flex | [] [] [] | 6
- gawk | | 0
- gcal | | 0
- gcc | [] | 2
- gettext | [] [] [] [] [] [] [] [] [] [] | 19
- gnupg | [] [] [] | 8
- grep | | 3
- hello | [] [] [] [] [] [] [] [] | 17
- id-utils | [] [] [] | 5
- indent | [] [] [] [] [] [] [] | 12
- libc | [] [] [] [] [] [] [] | 15
- lilypond | [] | 1
- lynx | [] [] [] [] [] | 8
- m4 | [] [] [] [] [] | 12
- make | [] [] [] [] [] | 9
- parted | [] [] [] | 5
- ptx | [] [] [] [] [] [] | 13
- python | | 0
- recode | [] [] [] | 11
- sed | [] [] [] [] [] [] [] | 16
- sh-utils | [] [] [] [] [] [] [] [] [] [] | 19
- sharutils | [] [] [] [] | 11
- soundtracker | | 0
- sp | | 0
- tar | [] [] [] [] [] [] [] [] | 16
- texinfo | [] [] | 6
- textutils | [] [] [] [] [] [] [] [] | 15
- util-linux | [] | 2
- wdiff | [] [] [] [] [] | 12
- wget | [] [] [] [] [] [] [] [] | 17
- +----------------------------------------------+
- 29 teams ja ko lv nl no pl pt pt_BR ru sk sl sv tr zh
- 40 domains 18 8 0 23 6 16 1 15 26 9 9 20 2 3 336
+ ja ko lv nl no pl pt pt_BR ru sk sl sv tr uk zh
+ +-------------------------------------------------+
+ a2ps | [] [] [] | 5
+ bash | | 4
+ bfd | | 0
+ binutils | | 0
+ bison | [] [] [] | 7
+ clisp | [] | 5
+ cpio | [] [] [] [] [] | 10
+ diffutils | [] [] [] | 10
+ enscript | [] [] [] | 5
+ error | [] | 3
+ fetchmail | | 0
+ fileutils | [] [] [] [] [] [] [] [] [] [] | 17
+ findutils | [] [] [] [] [] [] [] [] | 16
+ flex | [] [] [] | 6
+ freetype | | 0
+ gas | | 0
+ gawk | [] | 2
+ gcal | | 0
+ gcc | | 0
+ gettext | [] [] [] [] [] [] [] [] [] | 18
+ gnupg | [] [] [] [] | 10
+ gprof | | 0
+ grep | [] [] [] | 10
+ hello | [] [] [] [] [] [] [] [] [] [] [] | 21
+ id-utils | [] [] [] | 6
+ indent | [] [] [] [] [] [] [] | 12
+ jpilot | | 1
+ kbd | [] | 1
+ ld | | 0
+ libc | [] [] [] [] [] [] [] [] [] | 17
+ lilypond | [] [] | 2
+ lynx | [] [] [] [] [] | 8
+ m4 | [] [] [] [] [] | 12
+ make | [] [] [] [] [] [] [] | 12
+ nano | [] | 3
+ opcodes | | 0
+ parted | [] [] [] | 5
+ ptx | [] [] [] [] [] [] [] | 14
+ python | | 0
+ recode | [] [] [] [] | 13
+ sed | [] [] [] [] [] [] [] [] | 18
+ sh-utils | [] [] [] [] [] [] [] [] [] [] [] | 20
+ sharutils | [] [] [] [] | 11
+ soundtracker | | 1
+ sp | | 0
+ tar | [] [] [] [] [] [] [] [] [] | 17
+ texinfo | [] [] | 7
+ textutils | [] [] [] [] [] [] [] [] | 15
+ util-linux | [] [] | 4
+ wdiff | [] [] [] | 5
+ wget | [] [] [] [] [] [] [] | 16
+ +-------------------------------------------------+
+ 31 teams ja ko lv nl no pl pt pt_BR ru sk sl sv tr uk zh
+ 51 domains 17 9 1 23 6 17 1 13 26 9 11 20 19 2 2 369
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
lag between the mere existence a PO file and its wide availability in a
distribution.
- If May 2001 seems to be old, you may fetch a more recent copy of
+ If July 2001 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
-package. Of course the GNU Public License applies to your sources from
-then if you include `gettext' directly in your distribution on but
-since you are writing free software anyway this is no restriction.
-
- Once the sources are change appropriately and the setup can handle to
-use of `gettext' the only thing missing are the translations. The Free
-Translation Project is also available for packages which are not
+package. Of course the GNU General Public License applies to your
+sources from then on if you include `gettext' directly in your
+distribution but since you are writing free software anyway this is no
+restriction.
+
+ Once the sources are changed appropriately and the setup can handle
+to use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
+2001-08-27
+
+ * merged the color label feature from the claws branch (thanks to
+ Satoshi Nagayasu and Alfons Hoogervoost).
+ * src/colorlabel.[ch]: new. Renamed from labelcolors.[ch].
+ Renamed labelcolors_*() to colorlabel_*().
+ * src/summaryview.[ch]: added color label support.
+ * src/procmsg.h: added color label flags to the permanent flags.
+ * updated to gettext 0.10.39.
+
+2001-08-27
+
+ * src/account.c: account_clist_set_row(): fixed a bug that failed
+ to compile if SSL was not enabled.
+
+2001-08-26
+
+ * merged the SSL support from the claws branch (thanks to Christoph
+ Hohmann).
+ * src/ssl.[ch]: new.
+ * src/socket.[ch]: added ssl_read(), ssl_write(), ssl_gets(), and
+ ssl_getline().
+ sock_close(): call ssl_done_socket() if SSL is active.
+ * src/md5.[ch]: removed MD5_CTX typedef and use MD5_CONTEXT to
+ prevent type confliction.
+ * src/prefs_account.[ch]: added SSL tab, and modified the expression.
+ * src/esmtp.[ch]: added esmtp_ehlo(), and esmtp_starttls().
+ Removed SSL initialization and HELO from esmtp_starttls().
+ esmtp_auth(): removed use_smtp_auth from its arguments.
+ * src/send.c: send_smtp_open(): added SSL support.
+ * src/smtp.c: smtp_helo(): call esmtp_ehlo() if esmtp is true.
+
+2001-08-25
+
+ * src/mimeview.c: mimeview_open_with(): braced '%s' with single
+ quote.
+
2001-08-24
* src/main.c: open new account dialog if no account is set.
+2001-08-27 [paul]
+
+ * configure.in
+ change to version 0.5.3claws5
+
+ * sync with sylpheed 0.5.3cvs9
+ src/labelcolors.[ch] renamed to src/colorlabel.[ch]
+
2001-08-24 [christoph]
* src/filesel.c
+2001-08-27
+
+ * claws ¥Ö¥é¥ó¥Á¤«¤é¥«¥é¡¼¥é¥Ù¥ëµ¡Ç½¤ò¥Þ¡¼¥¸(Satoshi Nagayasu ¤µ¤ó
+ ¤È Alfons Hoogervoost ¤µ¤ó thanks)¡£
+ * src/colorlabel.[ch]: ¿·µ¬¡£labelcolors.[ch] ¤«¤é̾¾ÎÊѹ¹¡£
+ labelcolors_*() ¤ò colorlabel_*() ¤Ë²þ̾¡£
+ * src/summaryview.[ch]: ¥«¥é¡¼¥é¥Ù¥ë¤ËÂбþ¡£
+ * src/procmsg.h: ±Ê³¥Õ¥é¥°¤Ë¥«¥é¡¼¥é¥Ù¥ë¥Õ¥é¥°¤òÄɲá£
+ * gettext 0.10.39 ¤Ë¹¹¿·¡£
+
+2001-08-27
+
+ * src/account.c: account_clist_set_row(): SSL ¤¬Í¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤
+ ¾ì¹ç¤Ë¥³¥ó¥Ñ¥¤¥ë¤Ë¼ºÇÔ¤¹¤ë¥Ð¥°¤ò½¤Àµ¡£
+
+2001-08-26
+
+ * SSL Âбþ¤ò claws ¥Ö¥é¥ó¥Á¤«¤é¥Þ¡¼¥¸(Christoph Hohmann ¤µ¤ó thanks)¡£
+ * src/ssl.[ch]: ¿·µ¬¡£
+ * src/socket.[ch]: ssl_read(), ssl_write(), ssl_gets(), ¤½¤·¤Æ
+ ssl_getline() ¤òÄɲá£
+ sock_close(): SSL ¤¬Í¸ú¤Ê¤é ssl_done_socket() ¤ò¸Æ¤Ö¤è¤¦¤Ë¤·¤¿¡£
+ * src/md5.[ch]: ·¿¤Î¾×ÆͤòËɤ°¤¿¤á¤Ë MD5_CTX ¤Î typedef ¤òºï½ü¤·¡¢
+ MD5_CONTEXT ¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+ * src/prefs_account.[ch]: SSL ¥¿¥Ö¤òÄɲä·¡¢É½¸½¤òÊѹ¹¡£
+ * src/esmtp.[ch]: esmtp_ehlo() ¤È esmtp_starttls() ¤òÄɲá£
+ esmtp_starttls() ¤«¤é SSL ½é´ü²½¤È HELO ¤òºï½ü¡£
+ esmtp_auth(): °ú¿ô¤«¤é use_smtp_auth ¤òºï½ü¡£
+ * src/send.c: send_smtp_open(): SSL Âбþ¤òÄɲá£
+ * src/smtp.c: smtp_helo(): esmtp ¤¬¿¿¤Ê¤é esmtp_ehlo() ¤ò¸Æ¤Ö¤è¤¦¤Ë
+ ¤·¤¿¡£
+
+2001-08-25
+
+ * src/mimeview.c: mimeview_open_with(): '%s' ¤ò¥·¥ó¥°¥ë¥¯¥©¡¼¥È¤Ç
+ °Ï¤Ã¤¿¡£
+
2001-08-24
* src/main.c: ¥¢¥«¥¦¥ó¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¿·µ¬¥¢¥«¥¦¥ó¥È
/* Define if we use GPGME to support OpenPGP */
#undef USE_GPGME
-/* Define if we use GPGME to support OpenPGP */
+/* Define if you use OpenSSL to support SSL */
#undef USE_SSL
/* Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define. */
/* Used to test for a u32 typedef */
#undef HAVE_U32_TYPEDEF
+
#undef PACKAGE
#undef VERSION
MICRO_VERSION=3
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws4
+EXTRA_VERSION=claws5
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl
-2001-05-23 GNU <bug-gnu-utils@gnu.org>
+2001-07-24 GNU <bug-gnu-utils@gnu.org>
- * Version 0.10.38 released.
+ * Version 0.10.39 released.
# EUC-KR glibc aix hpux irix osf solaris freebsd yes
# EUC-TW glibc aix hpux irix osf solaris
# BIG5 glibc aix hpux osf solaris freebsd yes
-# BIG5HKSCS glibc
+# BIG5-HKSCS glibc
# GBK aix osf win32 dos
# GB18030 glibc
-# SJIS hpux osf solaris freebsd
+# SHIFT_JIS hpux osf solaris freebsd yes
# JOHAB glibc win32
# TIS-620 glibc aix hpux osf solaris
# VISCII glibc yes
echo "eucTW EUC-TW"
echo "hp15CN GB2312"
#echo "ccdc ?" # what is this?
- echo "SJIS SJIS"
+ echo "SJIS SHIFT_JIS"
echo "utf8 UTF-8"
;;
irix*)
echo "GBK GBK"
echo "KSC5601 CP949"
echo "sdeckanji EUC-JP"
- echo "SJIS SJIS"
+ echo "SJIS SHIFT_JIS"
echo "TACTIS TIS-620"
echo "UTF-8 UTF-8"
;;
echo "cns11643 EUC-TW"
echo "5601 EUC-KR"
echo "eucJP EUC-JP"
- echo "PCK SJIS"
+ echo "PCK SHIFT_JIS"
echo "TIS620.2533 TIS-620"
#echo "sun_eu_greek ?" # what is this?
echo "UTF-8 UTF-8"
echo "zh_TW.Big5 BIG5"
echo "zh_CN.EUC GB2312"
echo "ja_JP.EUC EUC-JP"
- echo "ja_JP.SJIS SJIS"
- echo "ja_JP.Shift_JIS SJIS"
+ echo "ja_JP.SJIS SHIFT_JIS"
+ echo "ja_JP.Shift_JIS SHIFT_JIS"
echo "ko_KR.EUC EUC-KR"
;;
beos*)
/* We cannot get the current working directory. Don't signal an
error but simply return the default string. */
FREE_BLOCKS (block_list);
+ __libc_rwlock_unlock (_nl_state_lock);
__set_errno (saved_errno);
return (plural == 0
? (char *) msgid1
/* Pointer to the contents of the charset.alias file, if it has already been
read, else NULL. Its format is:
ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
-static char * volatile charset_aliases;
+static const char * volatile charset_aliases;
/* Return a pointer to the contents of the charset.alias file. */
static const char *
get_charset_aliases ()
{
- char *cp;
+ const char *cp;
cp = charset_aliases;
if (cp == NULL)
imageview.c imageview.h \
mimeview.c mimeview.h \
summary_search.c summary_search.h \
+ colorlabel.c colorlabel.h \
folder.c folder.h \
procmsg.c procmsg.h \
procheader.c procheader.h \
md5.c md5.h \
rfc822.c rfc822.h \
socket.c socket.h \
+ ssl.c ssl.h \
automaton.c automaton.h \
session.c session.h \
smtp.c smtp.h \
editjpilot.c editjpilot.h \
editldap.c editldap.h \
editldap_basedn.c editldap_basedn.h \
- labelcolors.c labelcolors.h \
- ssl.c ssl.h \
gtkspell.c gtkspell.h gtkxtext.h \
template.c template.h \
prefs_templates.c prefs_templates.h \
#if USE_GPGME
" GPGME"
#endif
+#if USE_SSL
+ " SSL"
+#endif
#if USE_LDAP
" LDAP"
#endif
ac_prefs->protocol == A_APOP) &&
ac_prefs->recv_at_getall ? "*" : "";
text[COL_NAME] = ac_prefs->account_name;
-#if !USE_SSL
- text[COL_PROTOCOL] = ac_prefs->protocol == A_POP3 ? "POP3" :
- ac_prefs->protocol == A_APOP ? "APOP" :
- ac_prefs->protocol == A_IMAP4 ? "IMAP4" :
+#if USE_SSL
+ text[COL_PROTOCOL] = ac_prefs->protocol == A_POP3 ?
+ (ac_prefs->ssl_pop ? "POP3 (SSL)" : "POP3") :
+ ac_prefs->protocol == A_APOP ?
+ (ac_prefs->ssl_pop ?
+ "POP3 (APOP, SSL)" : "POP3 (APOP)") :
+ ac_prefs->protocol == A_IMAP4 ?
+ (ac_prefs->ssl_imap ? "IMAP4 (SSL)" : "IMAP4") :
ac_prefs->protocol == A_LOCAL ? "Local" :
- ac_prefs->protocol == A_NNTP ? "NNTP" : "";
+ ac_prefs->protocol == A_NNTP ? "NNTP" : "";
#else
- text[COL_PROTOCOL] = ac_prefs->protocol == A_POP3 ? (!ac_prefs->ssl_pop ? "POP3" : "POP3 (SSL)") :
- ac_prefs->protocol == A_APOP ? (!ac_prefs->ssl_pop ? "APOP" : "APOP (SSL)") :
- ac_prefs->protocol == A_IMAP4 ? (!ac_prefs->ssl_imap ? "IMAP4" : "IMAP4 (SSL)") :
+ text[COL_PROTOCOL] = ac_prefs->protocol == A_POP3 ? "POP3" :
+ ac_prefs->protocol == A_APOP ? "POP3 (APOP)" :
+ ac_prefs->protocol == A_IMAP4 ? "IMAP4" :
ac_prefs->protocol == A_LOCAL ? "Local" :
- ac_prefs->protocol == A_NNTP ? "NNTP" : "";
+ ac_prefs->protocol == A_NNTP ? "NNTP" : "";
#endif
text[COL_SERVER] = ac_prefs->protocol == A_NNTP
? ac_prefs->nntp_server : ac_prefs->recv_server;
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
static gint verbose = 1;
static gchar esmtp_response[MSGBUFSIZE];
-gint esmtp_auth_cram_md5(SockInfo *sock)
+gint esmtp_ehlo(SockInfo *sock, const gchar *hostname)
{
- gchar buf[MSGBUFSIZE];
+ sock_printf(sock, "EHLO %s\r\n", hostname);
+ if (verbose)
+ log_print("ESMTP> EHLO %s\n", hostname);
- g_snprintf(buf, sizeof(buf), "AUTH CRAM-MD5");
- sock_printf(sock, "%s\r\n", buf);
+ return esmtp_ok(sock);
+}
+gint esmtp_starttls(SockInfo *sock)
+{
+ sock_printf(sock, "STARTTLS\r\n");
if (verbose)
- log_print("ESMTP> %s\n", buf);
+ log_print("ESMTP> STARTTLS\n");
return esmtp_ok(sock);
}
-gint esmtp_auth_login(SockInfo *sock)
+gint esmtp_auth_cram_md5(SockInfo *sock)
{
- gchar buf[MSGBUFSIZE];
+ sock_printf(sock, "AUTH CRAM-MD5\r\n");
+ if (verbose)
+ log_print("ESMTP> AUTH CRAM-MD5\n");
- g_snprintf(buf, sizeof(buf), "AUTH LOGIN");
- sock_printf(sock, "%s\r\n", buf);
+ return esmtp_ok(sock);
+}
+gint esmtp_auth_login(SockInfo *sock)
+{
+ sock_printf(sock, "AUTH LOGIN\r\n");
if (verbose)
- log_print("ESMTP> %s\n", buf);
+ log_print("ESMTP> AUTH LOGIN\n");
return esmtp_ok(sock);
}
gint esmtp_auth(SockInfo *sock, SMTPAuthType authtype,
- const gchar *userid, const gchar *passwd,
- gboolean use_smtp_auth)
+ const gchar *userid, const gchar *passwd)
{
gchar buf[MSGBUFSIZE];
guchar hexdigest[33];
gchar *challenge, *response, *response64;
gint challengelen;
- /* const gchar delimiters[]=" "; */
gchar *token;
switch (authtype) {
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifndef __ESMTP_H__
#define __ESMTP_H__
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <glib.h>
+
#include "socket.h"
+#if USE_SSL
+# include "ssl.h"
+#endif
typedef enum
{
SMTPAUTH_DIGEST_MD5 = 3
} SMTPAuthType;
+gint esmtp_ehlo(SockInfo *sock, const gchar *hostname);
+gint esmtp_starttls(SockInfo *sock);
gint esmtp_auth_login(SockInfo *sock);
gint esmtp_auth_cram_md5(SockInfo *sock);
gint esmtp_auth(SockInfo *sock, SMTPAuthType authtype,
- const gchar *userid, const gchar *passwd,
- gboolean use_smtp_auth);
+ const gchar *userid, const gchar *passwd);
gint esmtp_ok(SockInfo *sock);
#endif /* __ESMTP_H__ */
break;
case MATCHING_ACTION_COLOR:
- MSG_SET_LABEL_VALUE(markflags, ma_tail->action->labelcolor);
+ MSG_SET_COLORLABEL_VALUE(markflags, ma_tail->action->labelcolor);
break;
/* UNCONTINUABLE */
#include "intl.h"
#include "imap.h"
#include "socket.h"
+#include "ssl.h"
#include "recv.h"
#include "procmsg.h"
#include "procheader.h"
#include "codeconv.h"
#include "utils.h"
#include "inputdialog.h"
-#include "ssl.h"
#define IMAP4_PORT 143
#if USE_SSL
guint32 last_uid);
static void imap_delete_all_cached_messages (FolderItem *item);
-#if !USE_SSL
+#if USE_SSL
static SockInfo *imap_open (const gchar *server,
gushort port,
- gchar *buf);
+ gchar *buf,
+ gboolean use_ssl);
#else
static SockInfo *imap_open (const gchar *server,
gushort port,
- gchar *buf,
- gboolean use_ssl);
+ gchar *buf);
#endif
static gint imap_set_message_flags (IMAPSession *session,
g_return_val_if_fail(folder->type == F_IMAP, NULL);
g_return_val_if_fail(folder->account != NULL, NULL);
-#if !USE_SSL
+#if USE_SSL
port = folder->account->set_imapport ? folder->account->imapport
- : IMAP4_PORT;
+ : folder->account->ssl_imap ? IMAPS_PORT : IMAP4_PORT;
#else
port = folder->account->set_imapport ? folder->account->imapport
- : (folder->account->ssl_imap ? IMAPS_PORT : IMAP4_PORT);
+ : IMAP4_PORT;
#endif
if (!rfolder->session) {
rfolder->session =
-#if !USE_SSL
+#if USE_SSL
imap_session_new(folder->account->recv_server, port,
folder->account->userid,
- folder->account->passwd);
+ folder->account->passwd,
+ folder->account->ssl_imap);
#else
imap_session_new(folder->account->recv_server, port,
folder->account->userid,
- folder->account->passwd,
- folder->account->ssl_imap);
+ folder->account->passwd);
#endif
if (rfolder->session)
imap_parse_namespace(IMAP_SESSION(rfolder->session),
folder->account->recv_server, port);
session_destroy(rfolder->session);
rfolder->session =
-#if !USE_SSL
+#if USE_SSL
imap_session_new(folder->account->recv_server, port,
folder->account->userid,
- folder->account->passwd);
+ folder->account->passwd,
+ folder->account->ssl_imap);
#else
imap_session_new(folder->account->recv_server, port,
folder->account->userid,
- folder->account->passwd,
- folder->account->ssl_imap);
+ folder->account->passwd);
#endif
if (rfolder->session)
imap_parse_namespace(IMAP_SESSION(rfolder->session),
return pass;
}
-#if !USE_SSL
-Session *imap_session_new(const gchar *server, gushort port,
- const gchar *user, const gchar *pass)
-#else
+#if USE_SSL
Session *imap_session_new(const gchar *server, gushort port,
const gchar *user, const gchar *pass,
gboolean use_ssl)
+#else
+Session *imap_session_new(const gchar *server, gushort port,
+ const gchar *user, const gchar *pass)
#endif
{
gchar buf[IMAPBUFSIZE];
log_message(_("creating IMAP4 connection to %s:%d ...\n"),
server, port);
-#if !USE_SSL
- if ((imap_sock = imap_open(server, port, buf)) == NULL)
-#else
+#if USE_SSL
if ((imap_sock = imap_open(server, port, buf, use_ssl)) == NULL)
+#else
+ if ((imap_sock = imap_open(server, port, buf)) == NULL)
#endif
return NULL;
if (imap_cmd_login(imap_sock, user, pass) != IMAP_SUCCESS) {
void imap_session_destroy(IMAPSession *session)
{
-#if USE_SSL
- ssl_done_socket(SESSION(session)->sock);
-#endif
sock_close(SESSION(session)->sock);
SESSION(session)->sock = NULL;
debug_print(_("done.\n"));
}
-#if !USE_SSL
-static SockInfo *imap_open(const gchar *server, gushort port, gchar *buf)
+#if USE_SSL
+static SockInfo *imap_open(const gchar *server, gushort port, gchar *buf,
+ gboolean use_ssl)
#else
-static SockInfo *imap_open(const gchar *server, gushort port, gchar *buf, gboolean use_ssl)
+static SockInfo *imap_open(const gchar *server, gushort port, gchar *buf)
#endif
{
SockInfo *sock;
}
#if USE_SSL
- if(use_ssl && !ssl_init_socket(sock)) {
+ if (use_ssl && !ssl_init_socket(sock)) {
sock_close(sock);
return NULL;
}
#include "account.h"
#include "procmsg.h"
#include "socket.h"
+#include "ssl.h"
#include "pop.h"
#include "recv.h"
#include "mbox.h"
inc_progress_dialog_clear(inc_dialog);
- gtk_clist_moveto(clist, num, 0, 1.0, 0.0);
+ gtk_clist_moveto(clist, num, -1, 1.0, 0.0);
pop3_state->user = g_strdup(pop3_state->ac_prefs->userid);
if (pop3_state->ac_prefs->passwd)
return new_msgs;
}
-
static IncState inc_pop3_session_do(IncSession *session)
{
Pop3State *pop3_state = session->pop3_state;
server = pop3_state->ac_prefs->recv_server;
#if USE_SSL
port = pop3_state->ac_prefs->set_popport ?
- pop3_state->ac_prefs->popport : (pop3_state->ac_prefs->ssl_pop ? 995 : 110);
+ pop3_state->ac_prefs->popport :
+ pop3_state->ac_prefs->ssl_pop ? 995 : 110;
#else
port = pop3_state->ac_prefs->set_popport ?
pop3_state->ac_prefs->popport : 110;
}
pop3_automaton_terminate(NULL, atm);
automaton_destroy(atm);
+ return INC_CONNECT_ERROR;
+ }
+#if USE_SSL
+ if (pop3_state->ac_prefs->ssl_pop && !ssl_init_socket(sockinfo)) {
+ pop3_automaton_terminate(NULL, atm);
+ automaton_destroy(atm);
return INC_CONNECT_ERROR;
}
+#endif
/* :WK: Hmmm, with the later sock_gdk_input, we have 2 references
* to the sock structure - implement a reference counter?? */
pop3_state->sockinfo = sockinfo;
atm->help_sock = sockinfo;
-#ifdef USE_SSL
- if(pop3_state->ac_prefs->ssl_pop) {
- if(!ssl_init_socket(sockinfo)) {
- pop3_automaton_terminate(NULL, atm);
- automaton_destroy(atm);
-
- return INC_CONNECT_ERROR;
- }
- } else {
- sockinfo->ssl = NULL;
- }
-#endif
-
log_verbosity_set(TRUE);
recv_set_ui_func(inc_pop3_recv_func, session);
recv_set_ui_func(NULL, NULL);
#if USE_THREADS
-/*
- pthread_join(sockinfo->connect_thr, NULL);
-*/
-#endif
-
-#if USE_SSL
- ssl_done_socket(sockinfo);
+ //pthread_join(sockinfo->connect_thr, NULL);
#endif
automaton_destroy(atm);
case POP3_GETAUTH_PASS_RECV:
case POP3_GETAUTH_APOP_SEND:
case POP3_GETAUTH_APOP_RECV:
- progress_dialog_set_label(dialog, _("Authorizing..."));
+ progress_dialog_set_label(dialog, _("Authenticating..."));
break;
case POP3_GETRANGE_STAT_SEND:
case POP3_GETRANGE_STAT_RECV:
# include <gpgme.h>
#endif
-#if USE_SSL
-# include "ssl.h"
-#endif
-
#include "intl.h"
#include "main.h"
#include "mainwindow.h"
#if USE_GPGME
# include "rfc2015.h"
#endif
+#if USE_SSL
+# include "ssl.h"
+#endif
gchar *prog_version;
gchar *startup_dir;
gtk_widget_push_colormap(gdk_imlib_get_colormap());
#endif
+#if USE_SSL
+ ssl_init();
+#endif
+
srandom((gint)time(NULL));
/* parse gtkrc files */
gpgme_register_idle(idle_function_for_gpgme);
#endif
-#if USE_SSL
- ssl_init();
-#endif
-
prefs_common_save_config();
prefs_filter_read_config();
prefs_filter_write_config();
gtk_main();
-#if USE_SSL
- ssl_done();
-#endif
-
return 0;
}
filename = get_socket_name();
unlink(filename);
+#if USE_SSL
+ ssl_done();
+#endif
+
gtk_main_quit();
}
md5_hex_digest(char *hexdigest, const unsigned char *s)
{
int i;
- MD5_CTX_syl context;
+ MD5_CONTEXT context;
unsigned char digest[16];
md5_init(&context);
const unsigned char* text, int text_len,
const unsigned char* key, int key_len)
{
- MD5_CTX_syl context;
+ MD5_CONTEXT context;
unsigned char k_ipad[64]; /* inner padding -
* key XORd with ipad
*/
memset(k_opad, 0, sizeof k_opad);
if (key_len > 64) {
/* if key is longer than 64 bytes reset it to key=MD5(key) */
- MD5_CTX_syl tctx;
+ MD5_CONTEXT tctx;
md5_init(&tctx);
md5_update(&tctx, key, key_len);
int finalized;
} MD5_CONTEXT;
-typedef MD5_CONTEXT MD5_CTX_syl;
-
void md5_init(MD5_CONTEXT *ctx);
void md5_update(MD5_CONTEXT *hd, const unsigned char *inbuf, size_t inlen);
void md5_final(unsigned char *digest, MD5_CONTEXT *ctx);
(_("Open with"),
_("Enter the command line to open file:\n"
"(`%s' will be replaced with file name)"),
- "gedit \"%s\"");
+ "gedit '%s'");
if (cmd) {
mimeview_view_file(filename, partinfo, cmd);
g_free(cmd);
#if USE_SSL
static struct SSLPrefs {
+ GtkWidget *receive_frame;
GtkWidget *pop_chkbtn;
GtkWidget *imap_chkbtn;
+ GtkWidget *send_frame;
GtkWidget *smtp_nossl_radiobtn;
GtkWidget *smtp_ssltunnel_radiobtn;
GtkWidget *smtp_sslstarttls_radiobtn;
#if USE_GPGME || USE_SSL
static void prefs_account_enum_set_data_from_radiobtn (PrefParam *pparam);
static void prefs_account_enum_set_radiobtn (PrefParam *pparam);
-#endif /* USE_GPGME */
+#endif /* USE_GPGME || USE_SSL */
static void prefs_account_nntpauth_toggled(GtkToggleButton *button,
gpointer user_data);
#endif /* USE_GPGME */
#if USE_SSL
- /* SSL Config */
- {"ssl_smtp", "FALSE", &tmp_ac_prefs.ssl_smtp, P_ENUM,
+ /* SSL */
+ {"ssl_smtp", "0", &tmp_ac_prefs.ssl_smtp, P_ENUM,
&ssl.smtp_nossl_radiobtn,
prefs_account_enum_set_data_from_radiobtn,
prefs_account_enum_set_radiobtn},
-
{"ssl_pop", "FALSE", &tmp_ac_prefs.ssl_pop, P_BOOL,
- &ssl.pop_chkbtn,
- prefs_set_data_from_toggle, prefs_set_toggle},
-
+ &ssl.pop_chkbtn, prefs_set_data_from_toggle, prefs_set_toggle},
{"ssl_imap", "FALSE", &tmp_ac_prefs.ssl_imap, P_BOOL,
- &ssl.imap_chkbtn,
- prefs_set_data_from_toggle, prefs_set_toggle},
+ &ssl.imap_chkbtn, prefs_set_data_from_toggle, prefs_set_toggle},
#endif /* USE_SSL */
/* Advanced */
#if USE_SSL
prefs_account_ssl_create();
SET_NOTEBOOK_LABEL(dialog.notebook, _("SSL"), page++);
-#endif /* USE_GPGME */
+#endif /* USE_SSL */
prefs_account_advanced_create();
SET_NOTEBOOK_LABEL(dialog.notebook, _("Advanced"), page++);
GtkWidget *smtp_ssltunnel_radiobtn;
GtkWidget *smtp_sslstarttls_radiobtn;
- /* Vertial Box */
vbox1 = gtk_vbox_new (FALSE, VSPACING);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
gtk_container_set_border_width (GTK_CONTAINER (vbox1), BOX_BORDER);
- /* Receive Options */
PACK_FRAME (vbox1, receive_frame, _("Receive"));
vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
gtk_container_add (GTK_CONTAINER (receive_frame), vbox2);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
- PACK_CHECK_BUTTON (vbox2, pop_chkbtn, _("Use SSL tunnel to connect to POP server"));
- PACK_CHECK_BUTTON (vbox2, imap_chkbtn, _("Use SSL tunnel to connect to IMAP server"));
+ PACK_CHECK_BUTTON (vbox2, pop_chkbtn,
+ _("Use SSL for POP3 connection"));
+ PACK_CHECK_BUTTON (vbox2, imap_chkbtn,
+ _("Use SSL for IMAP4 connection"));
- /* Send Options */
- PACK_FRAME (vbox1, send_frame, _("Send"));
+ PACK_FRAME (vbox1, send_frame, _("Send (SMTP)"));
vbox3 = gtk_vbox_new (FALSE, VSPACING_NARROW);
gtk_widget_show (vbox3);
gtk_container_add (GTK_CONTAINER (send_frame), vbox3);
gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);
- smtp_nossl_radiobtn = gtk_radio_button_new_with_label
- (NULL, _("No SSL for SMTP"));
+ smtp_nossl_radiobtn =
+ gtk_radio_button_new_with_label(NULL, _("Don't use SSL"));
gtk_widget_show (smtp_nossl_radiobtn);
gtk_box_pack_start (GTK_BOX (vbox3), smtp_nossl_radiobtn,
FALSE, FALSE, 0);
smtp_ssltunnel_radiobtn = gtk_radio_button_new_with_label_from_widget
(GTK_RADIO_BUTTON (smtp_nossl_radiobtn),
- _("Use SSL tunnel to connect to SMTP server"));
+ _("Use SSL for SMTP connection"));
gtk_widget_show (smtp_ssltunnel_radiobtn);
gtk_box_pack_start (GTK_BOX (vbox3), smtp_ssltunnel_radiobtn,
FALSE, FALSE, 0);
smtp_sslstarttls_radiobtn = gtk_radio_button_new_with_label_from_widget
(GTK_RADIO_BUTTON (smtp_nossl_radiobtn),
- _("Use STARTTLS command to start SMTP SSL session"));
+ _("Use STARTTLS command to start SSL session"));
gtk_widget_show (smtp_sslstarttls_radiobtn);
gtk_box_pack_start (GTK_BOX (vbox3), smtp_sslstarttls_radiobtn,
FALSE, FALSE, 0);
gtk_object_set_user_data (GTK_OBJECT (smtp_sslstarttls_radiobtn),
GINT_TO_POINTER (SSL_SMTP_STARTTLS));
- ssl.pop_chkbtn = pop_chkbtn;
- ssl.imap_chkbtn = imap_chkbtn;
- ssl.smtp_nossl_radiobtn = smtp_nossl_radiobtn;
- ssl.smtp_ssltunnel_radiobtn = smtp_ssltunnel_radiobtn;
+ ssl.receive_frame = receive_frame;
+ ssl.pop_chkbtn = pop_chkbtn;
+ ssl.imap_chkbtn = imap_chkbtn;
+
+ ssl.send_frame = send_frame;
+ ssl.smtp_nossl_radiobtn = smtp_nossl_radiobtn;
+ ssl.smtp_ssltunnel_radiobtn = smtp_ssltunnel_radiobtn;
ssl.smtp_sslstarttls_radiobtn = smtp_sslstarttls_radiobtn;
}
#endif /* USE_SSL */
(GTK_TOGGLE_BUTTON(basic.nntpauth_chkbtn), NULL);
gtk_widget_set_sensitive(receive.pop3_frame, FALSE);
gtk_widget_set_sensitive(receive.imap_frame, FALSE);
- gtk_widget_hide(advanced.popport_hbox);
- gtk_widget_hide(advanced.imapport_hbox);
- gtk_widget_show(advanced.nntpport_hbox);
-
#if USE_SSL
+ gtk_widget_set_sensitive(ssl.receive_frame, FALSE);
gtk_widget_set_sensitive(ssl.pop_chkbtn, FALSE);
gtk_widget_set_sensitive(ssl.imap_chkbtn, FALSE);
+ gtk_widget_set_sensitive(ssl.send_frame, FALSE);
#endif
+ gtk_widget_hide(advanced.popport_hbox);
+ gtk_widget_hide(advanced.imapport_hbox);
+ gtk_widget_show(advanced.nntpport_hbox);
break;
case A_LOCAL:
gtk_widget_set_sensitive(basic.inbox_label, TRUE);
gtk_widget_set_sensitive(basic.pass_entry, TRUE);
gtk_widget_set_sensitive(receive.pop3_frame, FALSE);
gtk_widget_set_sensitive(receive.imap_frame, FALSE);
- gtk_widget_hide(advanced.popport_hbox);
- gtk_widget_hide(advanced.imapport_hbox);
- gtk_widget_hide(advanced.nntpport_hbox);
prefs_account_mailcmd_toggled
(GTK_TOGGLE_BUTTON(basic.mailcmd_chkbtn), NULL);
#if USE_SSL
+ gtk_widget_set_sensitive(ssl.receive_frame, FALSE);
gtk_widget_set_sensitive(ssl.pop_chkbtn, FALSE);
gtk_widget_set_sensitive(ssl.imap_chkbtn, FALSE);
+ gtk_widget_set_sensitive(ssl.send_frame, TRUE);
#endif
+ gtk_widget_hide(advanced.popport_hbox);
+ gtk_widget_hide(advanced.imapport_hbox);
+ gtk_widget_hide(advanced.nntpport_hbox);
break;
case A_IMAP4:
gtk_widget_set_sensitive(basic.inbox_label, FALSE);
gtk_widget_set_sensitive(receive.imap_frame, TRUE);
gtk_widget_set_sensitive(basic.smtpserv_entry, TRUE);
gtk_widget_set_sensitive(basic.smtpserv_label, TRUE);
- gtk_widget_hide(advanced.popport_hbox);
- gtk_widget_show(advanced.imapport_hbox);
- gtk_widget_hide(advanced.nntpport_hbox);
#if USE_SSL
+ gtk_widget_set_sensitive(ssl.receive_frame, TRUE);
gtk_widget_set_sensitive(ssl.pop_chkbtn, FALSE);
gtk_widget_set_sensitive(ssl.imap_chkbtn, TRUE);
+ gtk_widget_set_sensitive(ssl.send_frame, TRUE);
#endif
+ gtk_widget_hide(advanced.popport_hbox);
+ gtk_widget_show(advanced.imapport_hbox);
+ gtk_widget_hide(advanced.nntpport_hbox);
break;
case A_POP3:
default:
gtk_widget_set_sensitive(receive.imap_frame, FALSE);
gtk_widget_set_sensitive(basic.smtpserv_entry, TRUE);
gtk_widget_set_sensitive(basic.smtpserv_label, TRUE);
- gtk_widget_show(advanced.popport_hbox);
- gtk_widget_hide(advanced.imapport_hbox);
- gtk_widget_hide(advanced.nntpport_hbox);
#if USE_SSL
+ gtk_widget_set_sensitive(ssl.receive_frame, TRUE);
gtk_widget_set_sensitive(ssl.pop_chkbtn, TRUE);
gtk_widget_set_sensitive(ssl.imap_chkbtn, FALSE);
+ gtk_widget_set_sensitive(ssl.send_frame, TRUE);
#endif
+ gtk_widget_show(advanced.popport_hbox);
+ gtk_widget_hide(advanced.imapport_hbox);
+ gtk_widget_hide(advanced.nntpport_hbox);
break;
}
gboolean use_mail_command;
gchar * mail_command;
+#if USE_SSL
+ /* SSL */
+ gboolean ssl_pop;
+ gboolean ssl_imap;
+ SSLSMTPType ssl_smtp;
+#endif /* USE_SSL */
+
+
/* Temporarily preserved password */
gchar *tmp_pass;
gchar *sign_key_id;
#endif /* USE_GPGME */
-#if USE_SSL
- /* SSL Config */
- gboolean ssl_pop;
- gboolean ssl_imap;
- SSLSMTPType ssl_smtp;
-#endif /* USE_SSL */
-
/* Advanced */
gboolean set_smtpport;
gushort smtpport;
gtk_box_pack_start (GTK_BOX (hbox1), dest_entry, TRUE, TRUE, 0);
color_optmenu = gtk_option_menu_new();
- gtk_option_menu_set_menu(GTK_OPTION_MENU(color_optmenu),
- labelcolors_create_color_menu());
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(color_optmenu),
+ colorlabel_create_color_menu());
// gtk_widget_set_usize(color_optmenu, -1, -1);
gtk_box_pack_start(GTK_BOX(hbox1), color_optmenu, TRUE, TRUE, 0);
}
break;
case ACTION_COLOR:
- labelcolor = labelcolors_get_color_menu_active_item(
+ labelcolor = colorlabel_get_color_menu_active_item(
gtk_option_menu_get_menu(GTK_OPTION_MENU(filtering.color_optmenu)));
destination = NULL;
break;
MSG_REALLY_DELETED = 1 << 6, /* mbox stuff */
-#define MSG_LABEL_SBIT (7) /* start bit message label */
-#define MAKE_MSG_LABEL(h, m, l) (((h) << (MSG_LABEL_SBIT+2)) | \
- ((m) << (MSG_LABEL_SBIT+1)) | \
- ((l) << (MSG_LABEL_SBIT+0)))
-
- MSG_LABEL = MAKE_MSG_LABEL(1, 1, 1),
- MSG_LABEL_NONE = MAKE_MSG_LABEL(0, 0, 0),
- MSG_LABEL_1 = MAKE_MSG_LABEL(0, 0, 1),
- MSG_LABEL_2 = MAKE_MSG_LABEL(0, 1, 0),
- MSG_LABEL_3 = MAKE_MSG_LABEL(0, 1, 1),
- MSG_LABEL_4 = MAKE_MSG_LABEL(1, 0, 0),
- MSG_LABEL_5 = MAKE_MSG_LABEL(1, 0, 1),
- MSG_LABEL_6 = MAKE_MSG_LABEL(1, 1, 0),
- MSG_LABEL_7 = MAKE_MSG_LABEL(1, 1, 1),
-
-#define MSG_LABEL_ORANGE (MSG_LABEL_1)
-#define MSG_LABEL_RED (MSG_LABEL_2)
-#define MSG_LABEL_PINK (MSG_LABEL_3)
-#define MSG_LABEL_SKYBLUE (MSG_LABEL_4)
-#define MSG_LABEL_BLUE (MSG_LABEL_5)
-#define MSG_LABEL_GREEN (MSG_LABEL_6)
-#define MSG_LABEL_BROWN (MSG_LABEL_7)
+#define MSG_CLABEL_SBIT (7) /* start bit of color label */
+#define MAKE_MSG_CLABEL(h, m, l) (((h) << (MSG_CLABEL_SBIT + 2)) | \
+ ((m) << (MSG_CLABEL_SBIT + 1)) | \
+ ((l) << (MSG_CLABEL_SBIT + 0)))
+
+ MSG_CLABEL_NONE = MAKE_MSG_CLABEL(0, 0, 0),
+ MSG_CLABEL_1 = MAKE_MSG_CLABEL(0, 0, 1),
+ MSG_CLABEL_2 = MAKE_MSG_CLABEL(0, 1, 0),
+ MSG_CLABEL_3 = MAKE_MSG_CLABEL(0, 1, 1),
+ MSG_CLABEL_4 = MAKE_MSG_CLABEL(1, 0, 0),
+ MSG_CLABEL_5 = MAKE_MSG_CLABEL(1, 0, 1),
+ MSG_CLABEL_6 = MAKE_MSG_CLABEL(1, 1, 0),
+ MSG_CLABEL_7 = MAKE_MSG_CLABEL(1, 1, 1),
+
+#define MSG_CLABEL_ORANGE MSG_CLABEL_1
+#define MSG_CLABEL_RED MSG_CLABEL_2
+#define MSG_CLABEL_PINK MSG_CLABEL_3
+#define MSG_CLABEL_SKYBLUE MSG_CLABEL_4
+#define MSG_CLABEL_BLUE MSG_CLABEL_5
+#define MSG_CLABEL_GREEN MSG_CLABEL_6
+#define MSG_CLABEL_BROWN MSG_CLABEL_7
MSG_IGNORE_THREAD = 1 << 10, /* ignore threads */
MSG_RESERVED_MAIN = 1 << 31 /* for sylpheed-main */
} MsgPermFlags;
+#define MSG_CLABEL_FLAG_MASK (MSG_CLABEL_7)
+
typedef enum
{
MSG_MOVE = 1 << 0,
MSG_COPY = 1 << 1,
-
+
MSG_QUEUED = 1 << 16,
MSG_DRAFT = 1 << 17,
MSG_ENCRYPTED = 1 << 18,
MSG_FILTERING = 1 << 25, /* claws: re/set by filtering */
MSG_MIME = 1 << 29,
+
MSG_CACHED = 1 << 31
} MsgTmpFlags;
-#define MSG_CACHED_FLAG_MASK (MSG_MIME)
+#define MSG_CACHED_FLAG_MASK (MSG_MIME)
#define MSG_SET_FLAGS(msg, flags) { (msg) |= (flags); }
#define MSG_UNSET_FLAGS(msg, flags) { (msg) &= ~(flags); }
#define MSG_IS_REPLIED(msg) (((msg).perm_flags & MSG_REPLIED) != 0)
#define MSG_IS_FORWARDED(msg) (((msg).perm_flags & MSG_FORWARDED) != 0)
+#define MSG_GET_COLORLABEL(msg) (((msg).perm_flags & MSG_CLABEL_FLAG_MASK))
+#define MSG_GET_COLORLABEL_VALUE(msg) (MSG_GET_COLORLABEL(msg) >> MSG_CLABEL_SBIT)
+#define MSG_SET_COLORLABEL_VALUE(msg, val) \
+ MSG_SET_PERM_FLAGS(msg, ((((guint)(val)) & 7) << MSG_CLABEL_SBIT))
+
#define MSG_IS_MOVE(msg) (((msg).tmp_flags & MSG_MOVE) != 0)
#define MSG_IS_COPY(msg) (((msg).tmp_flags & MSG_COPY) != 0)
/* Claws related flags */
#define MSG_IS_REALLY_DELETED(msg) (((msg).perm_flags & MSG_REALLY_DELETED) != 0)
#define MSG_IS_IGNORE_THREAD(msg) (((msg).perm_flags & MSG_IGNORE_THREAD) != 0)
-#define MSG_GET_LABEL(msg) (((msg).perm_flags & MSG_LABEL))
-#define MSG_GET_LABEL_VALUE(msg) (MSG_GET_LABEL(msg) >> MSG_LABEL_SBIT)
-/* 7 == nr. of colors excl. none */
-#define MSG_SET_LABEL_VALUE(msg, val) MSG_SET_PERM_FLAGS(msg, ((((unsigned)(val)) & 7) << MSG_LABEL_SBIT))
#define MSG_IS_FILTERING(msg) (((msg).tmp_flags & MSG_FILTERING) != 0)
#include "intl.h"
#include "send.h"
#include "socket.h"
+#include "ssl.h"
#include "smtp.h"
+#include "esmtp.h"
#include "prefs_account.h"
#include "account.h"
#include "compose.h"
gboolean cancelled;
};
-#if !USE_SSL
+#if USE_SSL
static gint send_message_smtp (GSList *to_list, const gchar *from,
const gchar *server, gushort port,
const gchar *domain, const gchar *userid,
const gchar *passwd, gboolean use_smtp_auth,
- FILE *fp);
-
+ SSLSMTPType ssl_type, FILE *fp);
static SockInfo *send_smtp_open (const gchar *server, gushort port,
- const gchar *domain, gboolean use_smtp_auth);
+ const gchar *domain, gboolean use_smtp_auth,
+ SSLSMTPType ssl_type);
#else
static gint send_message_smtp (GSList *to_list, const gchar *from,
const gchar *server, gushort port,
const gchar *domain, const gchar *userid,
const gchar *passwd, gboolean use_smtp_auth,
- FILE *fp, SSLSMTPType ssl);
-
+ FILE *fp);
static SockInfo *send_smtp_open (const gchar *server, gushort port,
- const gchar *domain, gboolean use_smtp_auth, SSLSMTPType ssl);
+ const gchar *domain, gboolean use_smtp_auth);
#endif
static SendProgressDialog *send_progress_dialog_create(void);
ac_prefs->mail_command,
fp);
} else {
-#if !USE_SSL
- port = ac_prefs->set_smtpport ? ac_prefs->smtpport : SMTP_PORT;
+#if USE_SSL
+ port = ac_prefs->set_smtpport ? ac_prefs->smtpport :
+ ac_prefs->ssl_smtp == SSL_SMTP_TUNNEL ? SSMTP_PORT : SMTP_PORT;
#else
- port = ac_prefs->set_smtpport ? ac_prefs->smtpport :
- (ac_prefs->ssl_smtp == SSL_SMTP_TUNNEL ? SSMTP_PORT : SMTP_PORT);
+ port = ac_prefs->set_smtpport ? ac_prefs->smtpport : SMTP_PORT;
#endif
- domain = ac_prefs->set_domain ? ac_prefs->domain : NULL;
+ domain = ac_prefs->set_domain ? ac_prefs->domain : NULL;
-#if !USE_SSL
- val = send_message_smtp(to_list, ac_prefs->address,
- ac_prefs->smtp_server, port, domain,
- ac_prefs->userid, ac_prefs->passwd,
- ac_prefs->use_smtp_auth, fp);
+#if USE_SSL
+ val = send_message_smtp(to_list, ac_prefs->address,
+ ac_prefs->smtp_server, port, domain,
+ ac_prefs->userid, ac_prefs->passwd,
+ ac_prefs->use_smtp_auth, ac_prefs->ssl_smtp,
+ fp);
#else
- val = send_message_smtp(to_list, ac_prefs->address,
- ac_prefs->smtp_server, port, domain,
- ac_prefs->userid, ac_prefs->passwd,
- ac_prefs->use_smtp_auth, fp,
- ac_prefs->ssl_smtp);
+ val = send_message_smtp(to_list, ac_prefs->address,
+ ac_prefs->smtp_server, port, domain,
+ ac_prefs->userid, ac_prefs->passwd,
+ ac_prefs->use_smtp_auth, fp);
#endif
}
}
if (ac) {
-#if !USE_SSL
- port = ac->set_smtpport ? ac->smtpport : SMTP_PORT;
+#if USE_SSL
+ port = ac->set_smtpport ? ac->smtpport :
+ ac->ssl_smtp == SSL_SMTP_TUNNEL ?
+ SSMTP_PORT : SMTP_PORT;
#else
- port = ac->set_smtpport ? ac->smtpport : (ac->ssl_smtp == SSL_SMTP_TUNNEL ? SSMTP_PORT : SMTP_PORT);
+ port = ac->set_smtpport ? ac->smtpport : SMTP_PORT;
#endif
domain = ac->set_domain ? ac->domain : NULL;
-#if !USE_SSL
+#if USE_SSL
val = send_message_smtp
(to_list, from, server, port, domain,
- ac->userid, ac->passwd, ac->use_smtp_auth, fp);
+ ac->userid, ac->passwd, ac->use_smtp_auth,
+ ac->ssl_smtp, fp);
#else
val = send_message_smtp
(to_list, from, server, port, domain,
- ac->userid, ac->passwd, ac->use_smtp_auth, fp, ac->ssl_smtp);
+ ac->userid, ac->passwd, ac->use_smtp_auth, fp);
#endif
} else {
g_warning(_("Account not found.\n"));
-#if !USE_SSL
+#if USE_SSL
val = send_message_smtp
(to_list, from, server, SMTP_PORT, NULL,
- NULL, NULL, FALSE, fp);
+ NULL, NULL, FALSE, FALSE, fp);
#else
val = send_message_smtp
(to_list, from, server, SMTP_PORT, NULL,
- NULL, NULL, FALSE, fp, FALSE);
+ NULL, NULL, FALSE, fp);
#endif
}
}
} \
}
-#if !USE_SSL
+#if USE_SSL
static gint send_message_smtp(GSList *to_list, const gchar *from,
const gchar *server, gushort port,
const gchar *domain, const gchar *userid,
const gchar *passwd, gboolean use_smtp_auth,
- FILE *fp)
+ SSLSMTPType ssl_type, FILE *fp)
#else
static gint send_message_smtp(GSList *to_list, const gchar *from,
const gchar *server, gushort port,
const gchar *domain, const gchar *userid,
const gchar *passwd, gboolean use_smtp_auth,
- FILE *fp, SSLSMTPType ssl)
+ FILE *fp)
#endif
{
SockInfo *smtp_sock = NULL;
gtk_clist_set_text(clist, 0, 2, _("Connecting"));
GTK_EVENTS_FLUSH();
-#if !USE_SSL
+#if USE_SSL
SEND_EXIT_IF_ERROR((smtp_sock = send_smtp_open
- (server, port, domain, use_smtp_auth)),
+ (server, port, domain, use_smtp_auth, ssl_type)),
"connecting to server");
#else
SEND_EXIT_IF_ERROR((smtp_sock = send_smtp_open
- (server, port, domain, use_smtp_auth, ssl)),
+ (server, port, domain, use_smtp_auth)),
"connecting to server");
#endif
SEND_EXIT_IF_NOTOK(smtp_eom(smtp_sock), "terminating data");
SEND_EXIT_IF_NOTOK(smtp_quit(smtp_sock), "sending QUIT");
-#if USE_SSL
- ssl_done_socket(smtp_sock);
-#endif
-
sock_close(smtp_sock);
send_progress_dialog_destroy(dialog);
return 0;
}
-#if !USE_SSL
+#if USE_SSL
static SockInfo *send_smtp_open(const gchar *server, gushort port,
- const gchar *domain, gboolean use_smtp_auth)
+ const gchar *domain, gboolean use_smtp_auth,
+ SSLSMTPType ssl_type)
#else
static SockInfo *send_smtp_open(const gchar *server, gushort port,
- const gchar *domain, gboolean use_smtp_auth, SSLSMTPType ssl)
+ const gchar *domain, gboolean use_smtp_auth)
#endif
{
SockInfo *sock;
}
#if USE_SSL
- if((ssl == SSL_SMTP_TUNNEL) && !ssl_init_socket(sock)) {
+ if (ssl_type == SSL_SMTP_TUNNEL && !ssl_init_socket(sock)) {
log_warning(_("SSL connection failed"));
sock_close(sock);
return NULL;
}
#endif
- if (smtp_ok(sock) == SM_OK) {
- val = smtp_helo(sock, domain ? domain : get_domain_name(),
- use_smtp_auth);
- if (val != SM_OK) {
- log_warning(_("Error occurred while sending HELO\n"));
- sock_close(sock);
- return NULL;
- }
+ if (smtp_ok(sock) != SM_OK) {
+ log_warning(_("Error occurred while connecting to %s:%d\n"),
+ server, port);
+ sock_close(sock);
+ return NULL;
}
#if USE_SSL
- if(ssl == SSL_SMTP_STARTTLS) {
- val = smtp_starttls(sock, domain ? domain : get_domain_name(),
- use_smtp_auth);
+ val = smtp_helo(sock, domain ? domain : get_domain_name(),
+ use_smtp_auth || ssl_type == SSL_SMTP_STARTTLS);
+#else
+ val = smtp_helo(sock, domain ? domain : get_domain_name(),
+ use_smtp_auth);
+#endif
+
+ if (val != SM_OK) {
+ log_warning(_("Error occurred while sending HELO\n"));
+ sock_close(sock);
+ return NULL;
+ }
+
+#if USE_SSL
+ if (ssl_type == SSL_SMTP_STARTTLS) {
+ val = esmtp_starttls(sock);
if (val != SM_OK) {
log_warning(_("Error occurred while sending STARTTLS\n"));
sock_close(sock);
return NULL;
}
+ if (!ssl_init_socket_with_method(sock, SSL_METHOD_TLSv1)) {
+ sock_close(sock);
+ return NULL;
+ }
+ val = esmtp_ehlo(sock, domain ? domain : get_domain_name());
+ if (val != SM_OK) {
+ log_warning(_("Error occurred while sending EHLO\n"));
+ sock_close(sock);
+ return NULL;
+ }
}
#endif
static gint verbose = 1;
static gchar smtp_response[MSGBUFSIZE];
-gint smtp_helo(SockInfo *sock, const char *hostname, gboolean use_smtp_auth)
+gint smtp_helo(SockInfo *sock, const gchar *hostname, gboolean esmtp)
{
- if (use_smtp_auth) {
- sock_printf(sock, "EHLO %s\r\n", hostname);
- if (verbose)
- log_print("ESMTP> EHLO %s\n", hostname);
-
- return esmtp_ok(sock);
- } else {
+ if (esmtp)
+ return esmtp_ehlo(sock, hostname);
+ else {
sock_printf(sock, "HELO %s\r\n", hostname);
if (verbose)
log_print("SMTP> HELO %s\n", hostname);
} else
authtype = SMTPAUTH_CRAM_MD5;
- esmtp_auth(sock, authtype, userid, passwd, use_smtp_auth);
+ esmtp_auth(sock, authtype, userid, passwd);
}
if (strchr(from, '<'))
return SM_UNRECOVERABLE;
}
-
-#if USE_SSL
-gint smtp_starttls(SockInfo *sock, const char *hostname, gboolean use_smtp_auth)
-{
- gint ret;
-
- sock_printf(sock, "STARTTLS\r\n", hostname);
- if (verbose)
- log_print("SMTP> STARTTLS\n", hostname);
-
- ret = smtp_ok(sock);
- if(ret != SM_OK)
- return ret;
-
- if(!ssl_init_socket_with_method(sock, SSL_METHOD_TLSv1)) {
- return SM_ERROR;
- }
-
- return smtp_helo(sock, hostname, use_smtp_auth);
-}
-#endif
\ No newline at end of file
#define ESMTP_SIZE 0x02
#define ESMTP_ETRN 0x04
-gint smtp_helo(SockInfo *sock, const char *hostname, gboolean use_smtp_auth);
+gint smtp_helo(SockInfo *sock, const gchar *hostname, gboolean esmtp);
gint smtp_from(SockInfo *sock, const gchar *from, const gchar *userid,
const gchar *passwd, gboolean use_smtp_auth);
gint smtp_rcpt(SockInfo *sock, const gchar *to);
#endif
#include "socket.h"
+#if USE_SSL
+# include "ssl.h"
+#endif
#if USE_GIO
#error USE_GIO is currently not supported
}
#endif /* !INET6 */
-#if 0
-SockInfo *sock_connect_nb(const gchar *hostname, gushort port)
-{
- gint sock;
- gint ret;
- SockInfo *sockinfo;
-
-#ifdef INET6
- if ((sock = sock_connect_by_getaddrinfo(hostname, port)) < 0)
- return NULL;
- if (set_nonblocking_mode(sock, TRUE) < 0) return NULL;
- ret = sock;
-#else
- if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- perror("socket");
- return NULL;
- }
-
- if (set_nonblocking_mode(sock, TRUE) < 0) return NULL;
-
- ret = sock_connect_by_hostname(sock, hostname, port);
-
- if (ret < 0 && errno != EINPROGRESS) {
- if (errno != 0) perror("connect");
- close(sock);
- return NULL;
- }
-#endif /* INET6 */
-
- sockinfo = g_new0(SockInfo, 1);
- sockinfo->sock = sock;
- sockinfo->hostname = g_strdup(hostname);
- sockinfo->port = port;
- sockinfo->state = CONN_LOOKUPSUCCESS;
-
- if (ret < 0 && errno == EINPROGRESS) return sockinfo;
-
- sockinfo->state = CONN_ESTABLISHED;
- return sockinfo;
-}
-#endif
-
SockInfo *sock_connect(const gchar *hostname, gushort port)
{
gint sock;
g_return_val_if_fail(sock != NULL, -1);
#if USE_SSL
- if(sock->ssl) {
+ if (sock->ssl)
return ssl_read(sock->ssl, buf, len);
- }
#endif
return fd_read(sock->sock, buf, len);
}
return read(fd, buf, len);
}
-#ifdef USE_SSL
+#if USE_SSL
gint ssl_read(SSL *ssl, gchar *buf, gint len)
{
return SSL_read(ssl, buf, len);
g_return_val_if_fail(sock != NULL, -1);
#if USE_SSL
- if(sock->ssl) {
+ if (sock->ssl)
return ssl_write(sock->ssl, buf, len);
- }
#endif
return fd_write(sock->sock, buf, len);
}
return wrlen;
}
-#ifdef USE_SSL
+#if USE_SSL
gint ssl_write(SSL *ssl, const gchar *buf, gint len)
{
gint n, wrlen = 0;
#if USE_SSL
gint ssl_gets(SSL *ssl, gchar *buf, gint len)
{
- gchar *buf2 = buf;
+ gchar *bp = buf;
gboolean newline = FALSE;
- gint n, count = 0;
+ gint n;
if (--len < 1)
return -1;
- while(len > 0 && !newline) {
- *buf2 = '\0';
- if((n = SSL_read(ssl, buf2, 1)) < 0)
+ while (len > 0 && !newline) {
+ *bp = '\0';
+ if ((n = SSL_read(ssl, bp, 1)) < 0)
return -1;
- if(*buf2 == '\n')
+ if (*bp == '\n')
newline = TRUE;
- buf2 += n;
- count += n;
+ bp += n;
}
- *buf2 = '\0';
- return count;
+ *bp = '\0';
+ return bp - buf;
}
#endif
g_return_val_if_fail(sock != NULL, -1);
#if USE_SSL
- if(sock->ssl) {
+ if (sock->ssl)
return ssl_gets(sock->ssl, buf, len);
- }
#endif
return fd_gets(sock->sock, buf, len);
}
g_return_val_if_fail(sock != NULL, NULL);
#if USE_SSL
- if(sock->ssl) {
+ if (sock->ssl)
return ssl_getline(sock->ssl);
- }
#endif
return fd_getline(sock->sock);
}
if (!sock)
return 0;
+#if USE_SSL
+ if (sock->ssl)
+ ssl_done_socket(sock);
+#endif
ret = fd_close(sock->sock);
g_free(sock->hostname);
g_free(sock);
GdkInputFunction function,
gpointer data);
-
/* Functions to directly work on FD. They are needed for pipes */
gint fd_connect_unix (const gchar *path);
gint fd_open_unix (const gchar *path);
gchar *fd_getline (gint sock);
gint fd_close (gint sock);
+/* Functions for SSL */
+#if USE_SSL
+gint ssl_read(SSL *ssl, gchar *buf, gint len);
+gint ssl_write(SSL *ssl, const gchar *buf, gint len);
+gint ssl_gets(SSL *ssl, gchar *buf, gint len);
+gchar *ssl_getline(SSL *ssl);
+#endif
+
#endif /* __SOCKET_H__ */
#if USE_SSL
+#include "defs.h"
+
+#include <glib.h>
+
#include "intl.h"
#include "utils.h"
#include "ssl.h"
-SSL_CTX *ssl_ctx_SSLv23;
-SSL_CTX *ssl_ctx_TLSv1;
+static SSL_CTX *ssl_ctx_SSLv23;
+static SSL_CTX *ssl_ctx_TLSv1;
-void ssl_init() {
- SSL_METHOD *meth;
-
+void ssl_init(void)
+{
SSL_library_init();
SSL_load_error_strings();
-
+
ssl_ctx_SSLv23 = SSL_CTX_new(SSLv23_client_method());
- if(ssl_ctx_SSLv23 == NULL) {
- debug_print(_("SSLv23 not available\n"));
+ if (ssl_ctx_SSLv23 == NULL) {
+ debug_print(_("SSLv23 not available\n"));
} else {
debug_print(_("SSLv23 available\n"));
}
ssl_ctx_TLSv1 = SSL_CTX_new(TLSv1_client_method());
- if(ssl_ctx_TLSv1 == NULL) {
- debug_print(_("TLSv1 not available\n"));
+ if (ssl_ctx_TLSv1 == NULL) {
+ debug_print(_("TLSv1 not available\n"));
} else {
debug_print(_("TLSv1 available\n"));
}
}
-void ssl_done() {
- if(ssl_ctx_SSLv23) {
- SSL_CTX_free(ssl_ctx_SSLv23);
+void ssl_done(void)
+{
+ if (ssl_ctx_SSLv23) {
+ SSL_CTX_free(ssl_ctx_SSLv23);
}
- if(ssl_ctx_TLSv1) {
- SSL_CTX_free(ssl_ctx_TLSv1);
+ if (ssl_ctx_TLSv1) {
+ SSL_CTX_free(ssl_ctx_TLSv1);
}
}
-gboolean ssl_init_socket(SockInfo *sockinfo) {
+gboolean ssl_init_socket(SockInfo *sockinfo)
+{
return ssl_init_socket_with_method(sockinfo, SSL_METHOD_SSLv23);
}
-gboolean ssl_init_socket_with_method(SockInfo *sockinfo, SSL_METHODs method) {
+gboolean ssl_init_socket_with_method(SockInfo *sockinfo, SSLMethod method)
+{
X509 *server_cert;
- int ret;
+ gint ret;
- switch(method) {
+ switch (method) {
case SSL_METHOD_SSLv23:
- if(!ssl_ctx_SSLv23) {
- log_warning(_("SSL method not available\n"));
+ if (!ssl_ctx_SSLv23) {
+ log_warning(_("SSL method not available\n"));
return FALSE;
}
sockinfo->ssl = SSL_new(ssl_ctx_SSLv23);
break;
case SSL_METHOD_TLSv1:
- if(!ssl_ctx_TLSv1) {
- log_warning(_("SSL method not available\n"));
+ if (!ssl_ctx_TLSv1) {
+ log_warning(_("SSL method not available\n"));
return FALSE;
}
sockinfo->ssl = SSL_new(ssl_ctx_TLSv1);
return FALSE;
break;
}
-
- if(sockinfo->ssl == NULL) {
- log_warning(_("Error creating ssl context\n"));
+ if (sockinfo->ssl == NULL) {
+ log_warning(_("Error creating ssl context\n"));
return FALSE;
}
SSL_set_fd(sockinfo->ssl, sockinfo->sock);
- if((ret = SSL_connect(sockinfo->ssl)) == -1) {
- log_warning(_("SSL connect failed (%s)\n"), ERR_error_string(ERR_get_error(), NULL));
-
+ if ((ret = SSL_connect(sockinfo->ssl)) == -1) {
+ log_warning(_("SSL connect failed (%s)\n"),
+ ERR_error_string(ERR_get_error(), NULL));
return FALSE;
}
/* Get server's certificate (note: beware of dynamic allocation) */
- if((server_cert = SSL_get_peer_certificate(sockinfo->ssl)) != NULL) {
- char *str;
-
+ if ((server_cert = SSL_get_peer_certificate(sockinfo->ssl)) != NULL) {
+ gchar *str;
+
log_print(_("Server certificate:\n"));
- if((str = X509_NAME_oneline(X509_get_subject_name (server_cert),0,0)) != NULL) {
+ if ((str = X509_NAME_oneline(X509_get_subject_name(server_cert), 0, 0)) != NULL) {
log_print(_(" Subject: %s\n"), str);
free(str);
}
-
- if((str = X509_NAME_oneline(X509_get_issuer_name (server_cert),0,0)) != NULL) {
+
+ if ((str = X509_NAME_oneline(X509_get_issuer_name(server_cert), 0, 0)) != NULL) {
log_print(_(" Issuer: %s\n"), str);
free(str);
}
X509_free(server_cert);
}
-
+
return TRUE;
}
-void ssl_done_socket(SockInfo *sockinfo) {
- if(sockinfo->ssl) {
+void ssl_done_socket(SockInfo *sockinfo)
+{
+ if (sockinfo->ssl) {
SSL_free(sockinfo->ssl);
}
}
-#endif /* USE_SSL */
\ No newline at end of file
+#endif /* USE_SSL */
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#if USE_SSL
-
#ifndef __SSL_H__
#define __SSL_H__
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if USE_SSL
+
+#include <glib.h>
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
typedef enum {
SSL_METHOD_SSLv23,
SSL_METHOD_TLSv1
-} SSL_METHODs;
+} SSLMethod;
-void ssl_init();
-void ssl_done();
+void ssl_init(void);
+void ssl_done(void);
gboolean ssl_init_socket(SockInfo *sockinfo);
-gboolean ssl_init_socket_with_method(SockInfo *sockinfo, SSL_METHODs method);
+gboolean ssl_init_socket_with_method(SockInfo *sockinfo, SSLMethod method);
void ssl_done_socket(SockInfo *sockinfo);
-#endif /* __SSL_H__ */
-
#endif /* USE_SSL */
+
+#endif /* __SSL_H__ */
#include "statusbar.h"
#include "filter.h"
#include "folder.h"
+#include "colorlabel.h"
#include "addressbook.h"
#include "addr_compl.h"
#include "scoring.h"
#include "prefs_folder_item.h"
#include "filtering.h"
-#include "labelcolors.h"
#include "pixmaps/dir-open.xpm"
#include "pixmaps/mark.xpm"
GtkCTreeNode *node,
gpointer data);
+static void summary_colorlabel_menu_item_activate_cb
+ (GtkWidget *widget,
+ gpointer data);
+static void summary_colorlabel_menu_item_activate_item_cb
+ (GtkMenuItem *label_menu_item,
+ gpointer data);
+static void summary_colorlabel_menu_create(SummaryView *summaryview);
+
/* callback functions */
static void summary_toggle_pressed (GtkWidget *eventbox,
GdkEventButton *event,
{N_("/Select _all"), NULL, summary_select_all, 0, NULL}
};
-#define LABEL_COLORS_ELEMS labelcolors_get_color_count()
-
-static void label_menu_item_activate_cb(GtkWidget *widget, gpointer data)
-{
- guint color = GPOINTER_TO_UINT(data);
- SummaryView *view = gtk_object_get_data(GTK_OBJECT(widget), "view");
-
- g_return_if_fail(view);
-
- /* "dont_toggle" state set? */
- if (gtk_object_get_data(GTK_OBJECT(view->label_menu), "dont_toggle"))
- return;
-
- summary_set_label(view, color, NULL);
-}
-
-/* summary_set_label_color() - labelcolor parameter is the color *flag*
- * for the messsage; not the color index */
-void summary_set_label_color(GtkCTree *ctree, GtkCTreeNode *node,
- guint labelcolor)
-{
- GdkColor color;
- GtkStyle *style, *prev_style, *ctree_style;
- MsgInfo *msginfo;
- gint color_index;
-
- color_index = labelcolor == 0 ? -1 : (gint) labelcolor - 1;
-
- ctree_style = gtk_widget_get_style(GTK_WIDGET(ctree));
-
- prev_style = gtk_ctree_node_get_row_style(ctree, node);
-
- if (!prev_style)
- prev_style = ctree_style;
-
- style = gtk_style_copy(prev_style);
-
- if (color_index < 0 || color_index >= LABEL_COLORS_ELEMS) {
- color_index = 0;
- color.red = ctree_style->fg[GTK_STATE_NORMAL].red;
- color.green = ctree_style->fg[GTK_STATE_NORMAL].green;
- color.blue = ctree_style->fg[GTK_STATE_NORMAL].blue;
- style->fg[GTK_STATE_NORMAL] = color;
-
- color.red = ctree_style->fg[GTK_STATE_SELECTED].red;
- color.green = ctree_style->fg[GTK_STATE_SELECTED].green;
- color.blue = ctree_style->fg[GTK_STATE_SELECTED].blue;
- style->fg[GTK_STATE_SELECTED] = color;
- gtk_ctree_node_set_row_style(ctree, node, style);
- }
- else {
- color = labelcolors_get_color(color_index);
- }
-
- msginfo = gtk_ctree_node_get_row_data(ctree, node);
-
- MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_LABEL);
- MSG_SET_LABEL_VALUE(msginfo->flags, labelcolor);
-
- if ( style ) {
- style->fg[GTK_STATE_NORMAL] = color;
- style->fg[GTK_STATE_SELECTED] = color;
- gtk_ctree_node_set_row_style(ctree, node, style);
- }
-}
-
-void summary_set_label(SummaryView *summaryview, guint labelcolor, GtkWidget *widget)
-{
- GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
- GtkCList *clist = GTK_CLIST(summaryview->ctree);
- GList *cur;
-
- for (cur = clist->selection; cur != NULL; cur = cur->next)
- summary_set_label_color(ctree, GTK_CTREE_NODE(cur->data), labelcolor);
-}
-
-static void label_menu_item_activate_item_cb(GtkMenuItem *label_menu_item, gpointer data)
-{
- SummaryView *summaryview;
- GtkMenuShell *label_menu;
- GtkCheckMenuItem **items;
- int n;
- GList *cur, *sel;
-
- summaryview = (SummaryView *) data;
- g_return_if_fail(summaryview);
- if (NULL == (sel = GTK_CLIST(summaryview->ctree)->selection))
- return;
-
- label_menu = GTK_MENU_SHELL(summaryview->label_menu);
- g_return_if_fail(label_menu);
-
- items = alloca( (LABEL_COLORS_ELEMS + 1) * sizeof(GtkWidget *));
- g_return_if_fail(items);
-
- /* NOTE: don't return prematurely because we set the "dont_toggle" state
- * for check menu items */
- gtk_object_set_data(GTK_OBJECT(label_menu), "dont_toggle", GINT_TO_POINTER(1));
-
- /* clear items. get item pointers. */
- for (n = 0, cur = label_menu->children; cur != NULL; cur = cur->next) {
- if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
- gtk_check_menu_item_set_state(GTK_CHECK_MENU_ITEM(cur->data), FALSE);
- items[n] = GTK_CHECK_MENU_ITEM(cur->data);
- n++;
- }
- }
-
- if (n == (LABEL_COLORS_ELEMS + 1)) {
- /* iterate all messages and set the state of the appropriate items */
- for (; sel != NULL; sel = sel->next) {
- MsgInfo *msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
- GTK_CTREE_NODE(sel->data));
- gint menu_item;
- if (msginfo) {
- menu_item = MSG_GET_LABEL_VALUE(msginfo->flags);
- if (!items[menu_item]->active)
- gtk_check_menu_item_set_state(items[menu_item], TRUE);
- }
- }
- }
- else
- g_warning("invalid number of color elements (%d)\n", n);
-
- /* reset "dont_toggle" state */
- gtk_object_set_data(GTK_OBJECT(label_menu), "dont_toggle", GINT_TO_POINTER(0));
-}
-
-static void summary_create_label_menu(SummaryView *summaryview)
-{
- const gint LABEL_MENU_POS = 5;
- GtkWidget *label_menu_item;
- GtkWidget *label_menu;
- GtkWidget *item;
- gint i;
-
- label_menu_item = gtk_menu_item_new_with_label(_("Label"));
- gtk_menu_insert(GTK_MENU(summaryview->popupmenu), label_menu_item, LABEL_MENU_POS);
- gtk_signal_connect(GTK_OBJECT(label_menu_item), "activate",
- GTK_SIGNAL_FUNC(label_menu_item_activate_item_cb), summaryview);
-
- gtk_widget_show(label_menu_item);
- summaryview->label_menu_item = label_menu_item;
-
- label_menu = gtk_menu_new();
-
- /* create sub items. for the menu item activation callback we pass the
- * index of label_colors[] as data parameter. for the None color we pass
- * an invalid (high) value. also we attach a data pointer so we can
- * always get back the SummaryView pointer. */
-
- item = gtk_check_menu_item_new_with_label(_("None"));
- gtk_menu_append(GTK_MENU(label_menu), item);
- gtk_signal_connect(GTK_OBJECT(item), "activate",
- GTK_SIGNAL_FUNC(label_menu_item_activate_cb),
- GUINT_TO_POINTER(0));
- gtk_object_set_data(GTK_OBJECT(item), "view", summaryview);
- gtk_widget_show(item);
-
- item = gtk_menu_item_new();
- gtk_menu_append(GTK_MENU(label_menu), item);
- gtk_widget_show(item);
-
- /* create pixmap/label menu items */
- for (i = 0; i < LABEL_COLORS_ELEMS; i++) {
- item = labelcolors_create_check_color_menu_item(i);
- gtk_menu_append(GTK_MENU(label_menu), item);
- gtk_signal_connect(GTK_OBJECT(item), "activate",
- GTK_SIGNAL_FUNC(label_menu_item_activate_cb),
- GUINT_TO_POINTER(i + 1));
- gtk_object_set_data(GTK_OBJECT(item), "view", summaryview);
- gtk_widget_show(item);
- }
-
- gtk_widget_show(label_menu);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menu_item), label_menu);
- summaryview->label_menu = label_menu;
-}
-
SummaryView *summary_create(void)
{
SummaryView *summaryview;
gtk_widget_show(pixmap);
summary_clear_list(summaryview);
+ summary_colorlabel_menu_create(summaryview);
summary_set_menu_sensitive(summaryview);
- summary_create_label_menu(summaryview);
}
menu_set_sensitive(ifactory, "/Copy...", TRUE);
}
- gtk_widget_set_sensitive(summaryview->label_menu_item, TRUE);
+ gtk_widget_set_sensitive(summaryview->colorlabel_menu_item, TRUE);
menu_set_sensitive(ifactory, "/Execute", TRUE);
sens = (selection == SUMMARY_SELECTED_MULTIPLE) ? FALSE : TRUE;
GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
summary_set_marks_func(ctree, node, summaryview);
- if (MSG_GET_LABEL(msginfo->flags))
- summary_set_label_color(ctree, node, MSG_GET_LABEL_VALUE(msginfo->flags));
+ if (MSG_GET_COLORLABEL(msginfo->flags))
+ summary_set_colorlabel_color(ctree, node, MSG_GET_COLORLABEL_VALUE(msginfo->flags));
/* preserve previous node if the message is
duplicated */
GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
summary_set_marks_func(ctree, node, summaryview);
- if ( MSG_GET_LABEL(msginfo->flags) )
- summary_set_label_color(ctree, node, MSG_GET_LABEL_VALUE(msginfo->flags));
+ if ( MSG_GET_COLORLABEL(msginfo->flags) )
+ summary_set_colorlabel_color(ctree, node, MSG_GET_COLORLABEL_VALUE(msginfo->flags));
if (msginfo->msgid && *msginfo->msgid &&
g_hash_table_lookup(msgid_table, msginfo->msgid)
style = small_style;
gtk_ctree_node_set_row_style(ctree, row, style);
+
+ if (MSG_GET_COLORLABEL(flags))
+ summary_set_colorlabel_color(ctree, row,
+ MSG_GET_COLORLABEL_VALUE(flags));
}
void summary_set_marks_selected(SummaryView *summaryview)
summaryview->folder_table);
}
+/* color label */
+
+#define LABEL_COLORS_ELEMS colorlabel_get_color_count()
+
+static void summary_colorlabel_menu_item_activate_cb(GtkWidget *widget,
+ gpointer data)
+{
+ guint color = GPOINTER_TO_UINT(data);
+ SummaryView *summaryview;
+
+ summaryview = gtk_object_get_data(GTK_OBJECT(widget), "summaryview");
+ g_return_if_fail(summaryview != NULL);
+
+ /* "dont_toggle" state set? */
+ if (gtk_object_get_data(GTK_OBJECT(summaryview->colorlabel_menu),
+ "dont_toggle"))
+ return;
+
+ summary_set_colorlabel(summaryview, color, NULL);
+}
+
+/* summary_set_colorlabel_color() - labelcolor parameter is the color *flag*
+ * for the messsage; not the color index */
+void summary_set_colorlabel_color(GtkCTree *ctree, GtkCTreeNode *node,
+ guint labelcolor)
+{
+ GdkColor color;
+ GtkStyle *style, *prev_style, *ctree_style;
+ MsgInfo *msginfo;
+ gint color_index;
+
+ color_index = labelcolor == 0 ? -1 : (gint)labelcolor - 1;
+ ctree_style = gtk_widget_get_style(GTK_WIDGET(ctree));
+ prev_style = gtk_ctree_node_get_row_style(ctree, node);
+ if (!prev_style)
+ prev_style = ctree_style;
+ style = gtk_style_copy(prev_style);
+
+ if (color_index < 0 || color_index >= LABEL_COLORS_ELEMS) {
+ color_index = 0;
+ color.red = ctree_style->fg[GTK_STATE_NORMAL].red;
+ color.green = ctree_style->fg[GTK_STATE_NORMAL].green;
+ color.blue = ctree_style->fg[GTK_STATE_NORMAL].blue;
+ style->fg[GTK_STATE_NORMAL] = color;
+
+ color.red = ctree_style->fg[GTK_STATE_SELECTED].red;
+ color.green = ctree_style->fg[GTK_STATE_SELECTED].green;
+ color.blue = ctree_style->fg[GTK_STATE_SELECTED].blue;
+ style->fg[GTK_STATE_SELECTED] = color;
+ gtk_ctree_node_set_row_style(ctree, node, style);
+ } else
+ color = colorlabel_get_color(color_index);
+
+ msginfo = gtk_ctree_node_get_row_data(ctree, node);
+
+ MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_CLABEL_FLAG_MASK);
+ MSG_SET_COLORLABEL_VALUE(msginfo->flags, labelcolor);
+
+ if (style) {
+ style->fg[GTK_STATE_NORMAL] = color;
+ style->fg[GTK_STATE_SELECTED] = color;
+ gtk_ctree_node_set_row_style(ctree, node, style);
+ }
+}
+
+void summary_set_colorlabel(SummaryView *summaryview, guint labelcolor,
+ GtkWidget *widget)
+{
+ GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+ GtkCList *clist = GTK_CLIST(summaryview->ctree);
+ GList *cur;
+
+ for (cur = clist->selection; cur != NULL; cur = cur->next)
+ summary_set_colorlabel_color(ctree, GTK_CTREE_NODE(cur->data),
+ labelcolor);
+}
+
+static void summary_colorlabel_menu_item_activate_item_cb(GtkMenuItem *label_menu_item,
+ gpointer data)
+{
+ SummaryView *summaryview;
+ GtkMenuShell *label_menu;
+ GtkCheckMenuItem **items;
+ gint n;
+ GList *cur, *sel;
+
+ summaryview = (SummaryView *)data;
+ g_return_if_fail(summaryview != NULL);
+
+ sel = GTK_CLIST(summaryview->ctree)->selection;
+ if (!sel) return;
+
+ label_menu = GTK_MENU_SHELL(summaryview->colorlabel_menu);
+ g_return_if_fail(label_menu != NULL);
+
+ Xalloca(items, (LABEL_COLORS_ELEMS + 1) * sizeof(GtkWidget *), return);
+
+ /* NOTE: don't return prematurely because we set the "dont_toggle"
+ * state for check menu items */
+ gtk_object_set_data(GTK_OBJECT(label_menu), "dont_toggle",
+ GINT_TO_POINTER(1));
+
+ /* clear items. get item pointers. */
+ for (n = 0, cur = label_menu->children; cur != NULL; cur = cur->next) {
+ if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
+ gtk_check_menu_item_set_state
+ (GTK_CHECK_MENU_ITEM(cur->data), FALSE);
+ items[n] = GTK_CHECK_MENU_ITEM(cur->data);
+ n++;
+ }
+ }
+
+ if (n == (LABEL_COLORS_ELEMS + 1)) {
+ /* iterate all messages and set the state of the appropriate
+ * items */
+ for (; sel != NULL; sel = sel->next) {
+ MsgInfo *msginfo;
+ gint menu_item;
+
+ msginfo = gtk_ctree_node_get_row_data
+ (GTK_CTREE(summaryview->ctree),
+ GTK_CTREE_NODE(sel->data));
+ if (msginfo) {
+ menu_item = MSG_GET_COLORLABEL_VALUE(msginfo->flags);
+ if (!items[menu_item]->active)
+ gtk_check_menu_item_set_state
+ (items[menu_item], TRUE);
+ }
+ }
+ } else
+ g_warning("invalid number of color elements (%d)\n", n);
+
+ /* reset "dont_toggle" state */
+ gtk_object_set_data(GTK_OBJECT(label_menu), "dont_toggle",
+ GINT_TO_POINTER(0));
+}
+
+static void summary_colorlabel_menu_create(SummaryView *summaryview)
+{
+ const gint LABEL_MENU_POS = 5;
+ GtkWidget *label_menu_item;
+ GtkWidget *label_menu;
+ GtkWidget *item;
+ gint i;
+
+ label_menu_item = gtk_menu_item_new_with_label(_("Color label"));
+ gtk_menu_insert(GTK_MENU(summaryview->popupmenu), label_menu_item,
+ LABEL_MENU_POS);
+ gtk_signal_connect(GTK_OBJECT(label_menu_item), "activate",
+ GTK_SIGNAL_FUNC(summary_colorlabel_menu_item_activate_item_cb),
+ summaryview);
+
+ gtk_widget_show(label_menu_item);
+ summaryview->colorlabel_menu_item = label_menu_item;
+
+ label_menu = gtk_menu_new();
+
+ /* create sub items. for the menu item activation callback we pass the
+ * index of label_colors[] as data parameter. for the None color we
+ * pass an invalid (high) value. also we attach a data pointer so we
+ * can always get back the SummaryView pointer. */
+
+ item = gtk_check_menu_item_new_with_label(_("None"));
+ gtk_menu_append(GTK_MENU(label_menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate",
+ GTK_SIGNAL_FUNC(summary_colorlabel_menu_item_activate_cb),
+ GUINT_TO_POINTER(0));
+ gtk_object_set_data(GTK_OBJECT(item), "summaryview", summaryview);
+ gtk_widget_show(item);
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(label_menu), item);
+ gtk_widget_show(item);
+
+ /* create pixmap/label menu items */
+ for (i = 0; i < LABEL_COLORS_ELEMS; i++) {
+ item = colorlabel_create_check_color_menu_item(i);
+ gtk_menu_append(GTK_MENU(label_menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate",
+ GTK_SIGNAL_FUNC(summary_colorlabel_menu_item_activate_cb),
+ GUINT_TO_POINTER(i + 1));
+ gtk_object_set_data(GTK_OBJECT(item), "summaryview",
+ summaryview);
+ gtk_widget_show(item);
+ }
+
+ gtk_widget_show(label_menu);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menu_item), label_menu);
+ summaryview->colorlabel_menu = label_menu;
+}
+
/* callback functions */
static void summary_toggle_pressed(GtkWidget *eventbox, GdkEventButton *event,
MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
- return MSG_GET_LABEL(msginfo1->flags) - MSG_GET_LABEL(msginfo2->flags);
+ return MSG_GET_COLORLABEL(msginfo1->flags) - MSG_GET_COLORLABEL(msginfo2->flags);
}
static gint summary_cmp_by_score(GtkCList *clist,
GtkWidget *toggle_eventbox;
GtkWidget *toggle_arrow;
GtkWidget *popupmenu;
- GtkWidget *label_menu_item; /* label menu item */
- GtkWidget *label_menu; /* label menu itself */
+ GtkWidget *colorlabel_menu;
+ GtkWidget *colorlabel_menu_item;
GtkItemFactory *popupfactory;
void summary_mark_as_read (SummaryView *summaryview);
void summary_select_all (SummaryView *summaryview);
void summary_unselect_all (SummaryView *summaryview);
-void summary_set_label (SummaryView *summaryview, guint labelcolor, GtkWidget *widget);
-void summary_set_label_color (GtkCTree *ctree, GtkCTreeNode *node, guint labelcolor);
+
+void summary_set_colorlabel (SummaryView *summaryview,
+ guint labelcolor,
+ GtkWidget *widget);
+void summary_set_colorlabel_color (GtkCTree *ctree,
+ GtkCTreeNode *node,
+ guint labelcolor);
#endif /* __SUMMARY_H__ */