You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(61) |
Feb
(111) |
Mar
(98) |
Apr
(33) |
May
(31) |
Jun
(64) |
Jul
(35) |
Aug
(50) |
Sep
(170) |
Oct
(89) |
Nov
(72) |
Dec
(214) |
2002 |
Jan
(74) |
Feb
(21) |
Mar
(5) |
Apr
(4) |
May
(61) |
Jun
(13) |
Jul
(3) |
Aug
(39) |
Sep
(14) |
Oct
(80) |
Nov
(22) |
Dec
(76) |
2003 |
Jan
(14) |
Feb
(59) |
Mar
(7) |
Apr
(5) |
May
|
Jun
(4) |
Jul
(6) |
Aug
(78) |
Sep
(68) |
Oct
(23) |
Nov
(25) |
Dec
(107) |
2004 |
Jan
(82) |
Feb
(75) |
Mar
(13) |
Apr
(9) |
May
(21) |
Jun
(2) |
Jul
(1) |
Aug
(52) |
Sep
(23) |
Oct
(15) |
Nov
(6) |
Dec
(60) |
2005 |
Jan
(125) |
Feb
(94) |
Mar
(32) |
Apr
(68) |
May
|
Jun
|
Jul
(11) |
Aug
(3) |
Sep
(15) |
Oct
(3) |
Nov
|
Dec
(58) |
2006 |
Jan
(46) |
Feb
(29) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(9) |
2007 |
Jan
(62) |
Feb
(60) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(2) |
Nov
(4) |
Dec
(46) |
2008 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(10) |
Dec
(49) |
2009 |
Jan
(14) |
Feb
(12) |
Mar
(37) |
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(25) |
Oct
(48) |
Nov
(7) |
Dec
(45) |
2010 |
Jan
(15) |
Feb
(14) |
Mar
(7) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(28) |
Nov
|
Dec
(44) |
2011 |
Jan
(22) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(70) |
2012 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(128) |
2013 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(2) |
Dec
(150) |
2014 |
Jan
(70) |
Feb
(44) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sebastian B. <sb...@us...> - 2013-12-12 21:44:32
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25806/tests Modified Files: .cvsignore makefile Added Files: imap2_unittest.c Log Message: Added skeleton of another imap test. Index: .cvsignore =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/.cvsignore,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- .cvsignore 7 Dec 2013 20:19:38 -0000 1.8 +++ .cvsignore 12 Dec 2013 21:44:29 -0000 1.9 @@ -11,3 +11,4 @@ written2.eml memleaks-*.xml test-profile +imap-profile Index: makefile =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/makefile,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- makefile 12 Dec 2013 18:12:47 -0000 1.22 +++ makefile 12 Dec 2013 21:44:29 -0000 1.23 @@ -26,6 +26,7 @@ filter_unittest \ folder_unittest \ index_unittest \ + imap2_unittest \ mail_unittest \ support_indep_unittest \ text2html_unittest --- NEW FILE: imap2_unittest.c --- /*************************************************************************** SimpleMail - Copyright (C) 2000 Hynek Schlawack and Sebastian Bauer 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/time.h> #include <CUnit/Basic.h> #include "account.h" #include "configuration.h" #include "folder.h" #include "support_indep.h" /*************************************************************/ /* @Test */ void test_imap(void) { struct account *ac; config_set_user_profile_directory("imap-profile"); CU_ASSERT(load_config() != 0); CU_ASSERT(init_folders() != 0); ac = account_malloc(); CU_ASSERT(ac != NULL); CU_ASSERT(ac->imap != NULL); ac->recv_type = 1; if (ac->imap->name) free(ac->imap->name); ac->imap->name = mystrdup("localhost"); CU_ASSERT(ac->imap->name != NULL); if (ac->imap->login) free(ac->imap->login); ac->imap->login = mystrdup("test"); CU_ASSERT(ac->imap->login != NULL); if (ac->imap->passwd) free(ac->imap->passwd); ac->imap->passwd = mystrdup("zzz"); CU_ASSERT(ac->imap->passwd != NULL); ac->imap->ssl = 1; ac->imap->port = 993; insert_config_account(ac); account_free(ac); folder_create_imap(); del_folders(); free_config(); } /*************************************************************/ |
From: Sebastian B. <sb...@us...> - 2013-12-12 18:12:50
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10810 Modified Files: makefile Log Message: Added separate run targets. Index: makefile =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/makefile,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- makefile 8 Dec 2013 20:26:14 -0000 1.21 +++ makefile 12 Dec 2013 18:12:47 -0000 1.22 @@ -60,6 +60,17 @@ # Define memleak targets MEMLEAKS_TARGETS = $(foreach testexe,$(TESTEXES),memleaks-$(testexe)) +# run template +define run.tmpl +run-$(1): $(1) + ./$$< +endef + +# "instanciate" run targets +$(foreach testexe,$(TESTEXES), \ + $(eval $(call run.tmpl,$(testexe))) \ +) + # memleaks template define memleak.tmpl memleaks-$(1): $(1) |
From: Sebastian B. <sb...@us...> - 2013-12-11 18:50:31
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22409 Modified Files: folder.c Log Message: Just some documentation updates. Index: folder.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/folder.c,v retrieving revision 1.188 retrieving revision 1.189 diff -u -d -r1.188 -r1.189 --- folder.c 10 Dec 2013 20:33:30 -0000 1.188 +++ folder.c 11 Dec 2013 18:50:29 -0000 1.189 @@ -1408,11 +1408,16 @@ return 1; } -/****************************************************************** - Adds a mail to the incoming folder (the mail not actually not - copied). The mail will get a New Flag. The mail is correctly - sorted in and the position is returned (-1 for an error) -*******************************************************************/ +/** + * Adds a reference to a given mail to the global incoming folder. + * That is, the mail is actually not copies. The mail will get the + * "new" flag and it is placed at the correct rank depending on + * the sort mode. + * + * @param mail + * @return -1 for an error, otherwise the rank/position of the mail + * in which it was sorted. + */ int folder_add_mail_incoming(struct mail_info *mail) { struct folder *folder = folder_incoming(); /* currently this is the incoming folder */ @@ -1481,9 +1486,14 @@ return NULL; } -/****************************************************************** - Adds a folder to the internal folder list with a given name -*******************************************************************/ +/** + * Adds a new folder that stores messages in the given path + * and has the given name. + * + * @param path + * @param name + * @return + */ struct folder *folder_add_with_name(char *path, char *name) { struct folder *f = folder_add(path); @@ -1497,9 +1507,13 @@ return f; } -/****************************************************************** - Creates a new group but does not add it -*******************************************************************/ +/** + * Creates a new folder group but does not add it to the internal + * list. + * + * @param name the name of the group. + * @return + */ static struct folder_node *folder_create_group(char *name) { struct folder_node *node; @@ -1522,9 +1536,12 @@ return NULL; } -/****************************************************************** - Adds a folder to the internal folder list with a given name -*******************************************************************/ +/** + * Adds a folder group to the internal folder list with a given name. + * + * @param name + * @return + */ struct folder *folder_add_group(char *name) { struct folder_node *node = folder_create_group(name); @@ -1536,9 +1553,13 @@ return NULL; } -/****************************************************************** - -*******************************************************************/ +/** + * Adds an folder specified by the given path to an imap folder. + * + * @param parent specifies the parent imap folder. + * @param imap_path the imap path of the new folder. + * @return + */ struct folder *folder_add_imap(struct folder *parent, char *imap_path) { struct folder_node *node; |
From: Sebastian B. <sb...@us...> - 2013-12-10 20:33:33
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7091 Modified Files: folder.c Log Message: Imap folders could appear twice. When imap folders were created from the imap account configuration, the presence of imap folders on the 2nd level or beyond could lead to double folders totally disturbing the folder tree if an order file existed (from which the folders are created in the first step, i.e., before the imap config is checked). SimpleMail currently supports only one level of imap folders and maps the subfolders to the 1st level. The workaround that is implemented attempts to load the true imap path from the .config file before the folder is added for an existing directory, in which case the folder normally is not added again. Index: folder.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/folder.c,v retrieving revision 1.187 retrieving revision 1.188 diff -u -d -r1.187 -r1.188 --- folder.c 10 Dec 2013 19:37:21 -0000 1.187 +++ folder.c 10 Dec 2013 20:33:30 -0000 1.188 @@ -1819,6 +1819,40 @@ int read_line(FILE *fh, char *buf); + +/** + * Return the imap path of the folder specified by the path + * by opening the config. + * + * @param folder_path + * @return the imap path or NULL. + */ +static char *folder_config_get_imap_path(char *folder_path) +{ + char buf[256]; + int rc = 0; + FILE *fh; + + sm_snprintf(buf, sizeof(buf), "%s.config", folder_path); + + if ((fh = fopen(buf,"r"))) + { + read_line(fh,buf); + + if (!mystrnicmp("FICO",buf,4)) + { + rc = 1; + while (read_line(fh,buf)) + { + if (!mystrnicmp("IMapPath=",buf,9)) + { + return mystrdup(&buf[9]); + } + } + } + } +} + /****************************************************************** Load the configuration for the folder *******************************************************************/ @@ -4008,7 +4042,17 @@ { if (st->st_mode & S_IFDIR) { - folder_add_imap(f,sm_file_part(buf)); + char *imap_path; + + /* If possible determine the true imap path that is stored in the config */ + if ((imap_path = folder_config_get_imap_path(buf))) + { + folder_add_imap(f, imap_path); + free(imap_path); + } else + { + folder_add_imap(f, sm_file_part(buf)); + } } } } |
From: Sebastian B. <sb...@us...> - 2013-12-10 20:22:53
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6277/tests Modified Files: test-profile.tar.bz2 Log Message: Updated again. Index: test-profile.tar.bz2 =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/test-profile.tar.bz2,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsI4ZtHP and /tmp/cvs9Bzr0d differ |
From: Sebastian B. <sb...@us...> - 2013-12-10 19:37:23
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv2124 Modified Files: folder.c Log Message: Removed unused variable. Index: folder.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/folder.c,v retrieving revision 1.186 retrieving revision 1.187 diff -u -d -r1.186 -r1.187 --- folder.c 14 Dec 2011 20:11:34 -0000 1.186 +++ folder.c 10 Dec 2013 19:37:21 -0000 1.187 @@ -1452,13 +1452,9 @@ { if ((node->folder.path = mystrdup(path))) { - char buf[256]; - node->folder.primary_sort = FOLDER_SORT_DATE; node->folder.secondary_sort = FOLDER_SORT_FROMTO; - sprintf(buf,"%s.config",path); - if (!folder_config_load(&node->folder)) { char *folder_name = sm_file_part(path); |
From: Sebastian B. <sb...@us...> - 2013-12-08 20:31:05
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26214/tests Modified Files: test-profile.tar.bz2 Log Message: Minor update. Index: test-profile.tar.bz2 =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/test-profile.tar.bz2,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsj74ENC and /tmp/cvseDOVHX differ |
From: Sebastian B. <sb...@us...> - 2013-12-08 20:26:16
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25907/tests Modified Files: makefile Added Files: test-profile.tar.bz2 Log Message: Added a test profile. Index: makefile =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/makefile,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- makefile 7 Dec 2013 20:19:38 -0000 1.20 +++ makefile 8 Dec 2013 20:26:14 -0000 1.21 @@ -44,12 +44,16 @@ $(CC) $@stubs.c unittest_tmpl.c -DUNITTEST_TABLE=\"$@_table.c\" -DUNITTEST_FILE=\"$<\" $(CFLAGS) -lcunit -L. -l$(SIMPLEMAIL_LIB) $(GLIB_LDFLAGS) $(GTK_LDFLAGS) -o $@ .PHONY: all -all: dirs $(TESTEXES) memleaks +all: dirs files $(TESTEXES) memleaks .PHONY: dirs dirs: mkdir -p test-objs/gtk +.PHONY: files +files: test-profile.tar.bz2 + tar xjf test-profile.tar.bz2 + lib$(SIMPLEMAIL_LIB).a: $(OBJS) ar rcs $@ $(OBJS) --- NEW FILE: test-profile.tar.bz2 --- (This appears to be a binary file; contents omitted.) |
From: Sebastian B. <sb...@us...> - 2013-12-07 20:19:40
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24793/tests Modified Files: .cvsignore makefile Added Files: folder_unittest.c Log Message: Started to implement a folder unittest. Index: .cvsignore =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/.cvsignore,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- .cvsignore 13 Dec 2012 19:41:32 -0000 1.7 +++ .cvsignore 7 Dec 2013 20:19:38 -0000 1.8 @@ -10,3 +10,4 @@ libsimplemail.a written2.eml memleaks-*.xml +test-profile --- NEW FILE: folder_unittest.c --- /*************************************************************************** SimpleMail - Copyright (C) 2000 Hynek Schlawack and Sebastian Bauer 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/time.h> #include <CUnit/Basic.h> #include "configuration.h" #include "folder.h" /*************************************************************/ /* @Test */ void test_folder(void) { config_set_user_profile_directory("test-profile"); CU_ASSERT(load_config() != 0); CU_ASSERT(init_folders() != 0); del_folders(); free_config(); } /*************************************************************/ Index: makefile =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/makefile,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- makefile 18 Dec 2012 09:57:46 -0000 1.19 +++ makefile 7 Dec 2013 20:19:38 -0000 1.20 @@ -4,14 +4,16 @@ include ../common-sources.mk -SRCS = $(addprefix ../,$(NONARCHSRCS)) ../gtk/support.c +SRCS = $(addprefix ../,$(NONARCHSRCS)) ../gtk/support.c ../gtk/subthreads.c OBJS = $(SRCS:../%.c=test-objs/%.o) GLIB_CFLAGS := $(shell pkg-config glib-2.0 --cflags) GLIB_LDFLAGS := $(shell pkg-config glib-2.0 --libs) +GTK_CFLAGS := $(shell pkg-config gtk+-x11-2.0 --cflags) + CC = gcc -CFLAGS=-g -I .. -I ../indep-include/ -I ../gtk $(GLIB_CFLAGS) \ +CFLAGS=-g -I .. -I ../indep-include/ -I ../gtk $(GLIB_CFLAGS) $(GTK_CFLAGS) \ -DNODEBUG -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -Werror VALGRIND_OPTS = --leak-check=full --track-origins=yes @@ -22,6 +24,7 @@ codesets_unittest \ configuration_unittest \ filter_unittest \ + folder_unittest \ index_unittest \ mail_unittest \ support_indep_unittest \ |
From: Sebastian B. <sb...@us...> - 2013-12-07 20:19:09
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24752/gtk Modified Files: subthreads.c Log Message: API sync. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- subthreads.c 22 Jan 2004 21:59:25 -0000 1.9 +++ subthreads.c 7 Dec 2013 20:19:07 -0000 1.10 @@ -129,7 +129,7 @@ input_added = 1; } - if ((g_thread_create(entry,udata,TRUE,NULL))) + if ((g_thread_create((GThreadFunc)entry,udata,TRUE,NULL))) { g_mutex_lock(thread_mutex); g_cond_wait(thread_cond,thread_mutex); @@ -183,8 +183,9 @@ Waits until aborted and calls timer_callback periodically. It's possible to execute functions on the threads context while in this function. **************************************************************************/ -void thread_wait(void (*timer_callback(void*)), void *timer_data, int millis) +int thread_wait(void (*timer_callback(void*)), void *timer_data, int millis) { + return 0; } /************************************************************************** @@ -198,7 +199,7 @@ } -int thread_call_parent_function_sync(void *function, int argcount, ...) +int thread_call_parent_function_sync(int *success, void *function, int argcount, ...) { struct ipc_message msg; va_list argptr; @@ -276,7 +277,10 @@ if (sem) { if (!(sem->mutex = g_mutex_new())) + { + free(sem); return NULL; + } } return sem; } |
From: Sebastian B. <sb...@us...> - 2013-12-07 19:39:27
|
Update of /cvsroot/simplemail/simplemail/indep-include In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22109/indep-include Modified Files: subthreads.h Log Message: Moved the documentation for the thread functions into the header file. Index: subthreads.h =================================================================== RCS file: /cvsroot/simplemail/simplemail/indep-include/subthreads.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- subthreads.h 18 Dec 2011 11:13:03 -0000 1.19 +++ subthreads.h 7 Dec 2013 19:39:25 -0000 1.20 @@ -25,31 +25,195 @@ #define THREAD_FUNCTION(x) ((int (*)(void*))x) +/** + * Initialize the thread system + * + * @return 0 on failure, 1 on success. + */ int init_threads(void); + +/** + * Cleanup the thread system. Will abort every thread. + */ void cleanup_threads(void); /* thread handling */ struct thread_s; typedef struct thread_s * thread_t; /* opaque type */ +/** + * Informs the parent task that it can continue, i.e., that thread_add() or thread_start() + * can return. + * + * @return 0 on failure, 1 on success. + */ int thread_parent_task_can_contiue(void); + + +/** + * Start the default thread with the given entry point. This function will be removed in the future + * as it is too inflexible. + * + * @param entry the entry point + * @param udata the user data passed to the entry point + * @return 0 on failure (e.g., default thread already exists) or 1 on success. + */ int thread_start(int (*entry)(void*), void *udata); + + +/** + * Runs a given function in a newly created thread under the given name which + * is linked into a internal list. + * + * @param thread_name + * @param entry + * @param eudata + * @return + */ thread_t thread_add(char *thread_name, int (*entry)(void *), void *eudata); + + +/** + * @brief Waits until a signal has been sent and calls timer_callback + * periodically. + * + * It's possible to execute functions on the threads context while this + * function is executed via thread_call_function_xxx() + * + * @param timer_callback function that is called periodically + * @param timer_data some data that is passed as the first argument + * to the callback + * @param millis the periodic time span + * @return 0 if the function finished due to an abort request (or failure), + * 1 if due to a call to thread_signal(). + */ int thread_wait(void (*timer_callback(void*)), void *timer_data, int millis); -void thread_abort(thread_t thread); /* NULL means default thread */ +/** + * @brief Aborts the given thread. + * + * @param thread_to_abort the thread to be aborted. Specify NULL for the default + * subthread. + * + * @note This functions doesn't wait until the given thread has been finished. + * It just requests the abortion. + */ +void thread_abort(thread_t thread); + +/** + * @brief Signals the given thread. + * + * @param thread_to_signal the thread to be signaled. Specify NULL for the default + * subthread. + */ void thread_signal(thread_t thread_to_signal); + +/** + * @brief Check if somebody sent an abort signal. + * + * @return 1 if an abort signal was sent. + */ int thread_aborted(void); + +/** + * Call a function in the context of the given thread in a synchronous manner, + * i.e., this call will return if the called function will return or if an + * error occurred. + * + * @param thread + * @param function + * @param argcount + * @return + */ int thread_call_function_sync(thread_t thread, void *function, int argcount, ...); + +/** + * @brief Call a function in the context of the given thread in an asynchronous manner. + * + * @param thread the thread in which context the function is executed. + * @param function the function to be executed. + * @param argcount number of function parameters + * @return whether the call was successfully forwarded. + */ int thread_call_function_async(thread_t thread, void *function, int argcount, ...); + +/** + * Call a function in context of the parent task in a sychron manner. The contents of + * success is set to 1, if the call was successful otherwise to 0. + * success may be NULL. If success would be 0, the call returns 0 as well. + * + * @param success + * @param function + * @param argcount + * @return + */ int thread_call_parent_function_sync(int *success, void *function, int argcount, ...); + +/** + * Call the function in the context of the parent task in an asynchronous manner. + * + * @param function + * @param argcount + * @return + */ int thread_call_parent_function_async(void *function, int argcount, ...); + +/** + * Call the given function asynchronous in the context of the parent thread + * and duplicate the first argument which is threaded at a string. + * + * @param function + * @param argcount + * @return + */ int thread_call_parent_function_async_string(void *function, int argcount, ...); + +/** + * @brief Call the function synchronous in the context of the parent task. + * + * Also calls the timer_callback on the calling process context periodically. + * + * @param timer_callback + * @param timer_data + * @param millis + * @param function + * @param argcount + * @return + */ int thread_call_parent_function_sync_timer_callback(void (*timer_callback)(void*), void *timer_data, int millis, void *function, int argcount, ...); + +/** + * Pushes a function call in the function queue of the callers task context. + * + * @param function + * @param argcount + * @return 1 for success else 0. + */ int thread_push_function(void *function, int argcount, ...); + +/** + * Pushes a function call in the function queue of the callers task context + * but only after a given amount of time. + * + * @param millis + * @param function + * @param argcount + * @return return 1 for success else 0. + */ int thread_push_function_delayed(int millis, void *function, int argcount, ...); +/** + * Return the main (UI) thread. + * + * @return + */ thread_t thread_get_main(void); + +/** + * Return the current thread. + * + * @return + */ thread_t thread_get(void); /* semaphore handling */ |
From: Sebastian B. <sb...@us...> - 2013-12-06 21:14:51
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29043 Modified Files: imap.c Log Message: Create a progress monitor for connecting to the IMAP server. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- imap.c 15 Dec 2012 06:08:17 -0000 1.78 +++ imap.c 6 Dec 2013 21:14:48 -0000 1.79 @@ -1921,6 +1921,20 @@ if (imap_server) { + struct progmon *pm; + + pm = progmon_create(); + if (pm) + { + utf8 msg[80]; + + utf8fromstr(_("Connect with IMAP server"),NULL,msg,sizeof(msg)); + pm->begin(pm,2,msg); + + utf8fromstr("Logging in",NULL,msg,sizeof(msg)); + pm->working_on(pm,msg); + } + if (imap_thread_really_connect_and_login_to_server()) { char status_buf[160]; @@ -1950,6 +1964,12 @@ imap_thread_really_download_mails(); } } + + if (pm) + { + pm->done(pm); + progmon_delete(pm); + } } SM_LEAVE; } |
From: Sebastian B. <sb...@us...> - 2013-12-06 21:12:39
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28911 Modified Files: codesets.c Log Message: Function utf8fromstr() did not work at all. Fixed. Index: codesets.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/codesets.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- codesets.c 15 Dec 2012 06:10:47 -0000 1.59 +++ codesets.c 6 Dec 2013 21:12:37 -0000 1.60 @@ -1374,6 +1374,9 @@ unsigned char c; int conv = 0; + if (dest_size < 1) + return 0; + if (!codeset) codeset = (struct codeset*)list_first(&codesets_list); @@ -1392,7 +1395,7 @@ utf8_seq++; for(;(c = *utf8_seq);utf8_seq++) - *dest = c; + *dest++ = c; dest_size -= l; conv++; |
From: Sebastian B. <sb...@us...> - 2013-12-04 21:34:20
|
Update of /cvsroot/simplemail/simplemail/amiga-mui In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17829/amiga-mui Modified Files: foldertreelistclass.c Log Message: Avoid possible buffer overflow. Index: foldertreelistclass.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/amiga-mui/foldertreelistclass.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- foldertreelistclass.c 20 Feb 2010 15:21:16 -0000 1.48 +++ foldertreelistclass.c 4 Dec 2013 21:34:18 -0000 1.49 @@ -46,6 +46,7 @@ #include "gui_main_arch.h" #include "muistuff.h" #include "picturebuttonclass.h" +#include "support.h" struct MUI_NListtree_TreeNode *FindListtreeUserData(Object *tree, APTR udata); @@ -149,11 +150,17 @@ sprintf(data->name_buf,"\33O[%08lx]%s",(ULONG)image,newm?"\33b":""); if (folder->name) { + int cur_len = strlen(data->name_buf); + char *cur_name_buf = data->name_buf + cur_len; + /* IMAP folders are UTF8 */ if (folder->is_imap) { - utf8tostr(folder->name, data->name_buf + strlen(data->name_buf), sizeof(data->name_buf) - strlen(data->name_buf), user.config.default_codeset); - } else strcat(data->name_buf,folder->name); + utf8tostr(folder->name, cur_name_buf, sizeof(data->name_buf) - cur_len, user.config.default_codeset); + } else + { + sm_snprintf(cur_name_buf, sizeof(data->name_buf) - cur_len, "%s", folder->name); + } } *msg->Array++ = data->name_buf; |
From: Sebastian B. <sb...@us...> - 2013-11-24 20:47:09
|
Update of /cvsroot/simplemail/simplemail/homepage In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9588 Modified Files: index.php Log Message: Disabled gallery links. Index: index.php =================================================================== RCS file: /cvsroot/simplemail/simplemail/homepage/index.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- index.php 24 Dec 2010 17:59:40 -0000 1.11 +++ index.php 24 Nov 2013 20:47:06 -0000 1.12 @@ -31,6 +31,7 @@ $LinkMenu["contact"]["title"]=get_string($ContactText); $LinkMenu["contact"]["datename"]="contact.php"; +/* $LinkMenu["gallery"]["filename"]="gallery.php"; $LinkMenu["gallery"]["title"]=get_string($GalleryText); $LinkMenu["gallery"]["datename"]="gallery.php"; @@ -38,7 +39,7 @@ $LinkMenu["gallery_add_user"]["filename"]="gallery_add_user.php"; $LinkMenu["gallery_add_user"]["title"]=get_string($GalleryText); $LinkMenu["gallery_add_user"]["datename"]="gallery.php"; - +*/ $body = $_REQUEST["body"]; if (!isset($body)) $body="default"; ?> |
From: Sebastian B. <sb...@us...> - 2013-11-24 20:27:51
|
Update of /cvsroot/simplemail/simplemail/homepage In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8372 Modified Files: contact.php Log Message: Updated Hynek's contact information. Index: contact.php =================================================================== RCS file: /cvsroot/simplemail/simplemail/homepage/contact.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- contact.php 24 Dec 2004 11:27:32 -0000 1.10 +++ contact.php 24 Nov 2013 20:27:49 -0000 1.11 @@ -9,8 +9,8 @@ </TR> <TR> <TD>Hynek Schlawack</TD> - <TD><A href="mailto:hy...@hy...">hy...@hy...</A></TD> - <TD><A href="http://hynek.in-berlin.de/">http://hynek.in-berlin.de/</A></TD> + <TD><A href="mailto:hs...@ox...">hs...@ox...</A></TD> + <TD><A href="https://hynek.me/">https://hynek.me/</A></TD> </TR> </TABLE> <br> |
From: Sebastian B. <sb...@us...> - 2013-10-11 19:02:06
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23449/tests Modified Files: filter_unittest.c Log Message: Include support_indep.h Index: filter_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/filter_unittest.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- filter_unittest.c 22 Dec 2012 19:40:11 -0000 1.10 +++ filter_unittest.c 11 Oct 2013 19:02:01 -0000 1.11 @@ -25,6 +25,7 @@ #include "mail.h" #include "filter.h" +#include "support_indep.h" /*******************************************************/ |
From: Sebastian B. <sb...@us...> - 2013-10-11 19:00:24
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23251 Modified Files: mail.c Log Message: Use rand() instead of a pointer when creating a unique boundary string. Index: mail.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/mail.c,v retrieving revision 1.245 retrieving revision 1.246 diff -u -d -r1.245 -r1.246 --- mail.c 2 Jan 2013 19:05:09 -0000 1.245 +++ mail.c 11 Oct 2013 19:00:20 -0000 1.246 @@ -3008,7 +3008,7 @@ static char *get_boundary_id(FILE *fp) { char boundary[64]; - sm_snprintf(boundary, sizeof(boundary), "--==bound%x%lx----",(int)boundary,ftell(fp)); + sm_snprintf(boundary, sizeof(boundary), "--==bound%x%lx----", rand(), ftell(fp)); return mystrdup(boundary); } |
From: Sebastian B. <sb...@us...> - 2013-01-04 20:24:42
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26033 Modified Files: .cvsignore build-dependencies.mk Log Message: Modularized build dependency installations. Index: .cvsignore =================================================================== RCS file: /cvsroot/simplemail/simplemail/.cvsignore,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- .cvsignore 7 Dec 2012 05:29:57 -0000 1.23 +++ .cvsignore 4 Jan 2013 20:24:38 -0000 1.24 @@ -47,3 +47,7 @@ doxygen build-dependencies .build-dependencies-done +.expat-done +.mui-done +.amissl-done +.openurl-done Index: build-dependencies.mk =================================================================== RCS file: /cvsroot/simplemail/simplemail/build-dependencies.mk,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- build-dependencies.mk 7 Dec 2012 05:29:57 -0000 1.1 +++ build-dependencies.mk 4 Jan 2013 20:24:38 -0000 1.2 @@ -3,18 +3,35 @@ # using a cross compiler on an Unix system # -.build-dependencies-done: - mkdir -p build-dependencies +.build-dependencies-done: .amissl-done .expat-done .mui-done .openurl-done + touch $@ + +# +# Download and extract AmiSSL includes +# +.amissl-done: ifndef AMISSL_INCLUDE mkdir -p build-dependencies/amissl cd build-dependencies/amissl && wget -N http://www.heightanxiety.com/AmiSSL/AmiSSL-3.5-SDK.lha cd build-dependencies/amissl && lha xf AmiSSL-3.5-SDK.lha endif + touch $@ + +# +# Download and extract expat includes +# +.expat-done: ifndef EXPAT_INCLUDE mkdir -p build-dependencies/expat cd build-dependencies/expat && wget -N http://www.os4depot.net/share/development/library/misc/expat.lha cd build-dependencies/expat && lha xf expat.lha && ln -sf libraries/expat.h expat/SDK/Include/include_h/expat.h endif + touch $@ + +# +# Download and extract MUI includes +# +.mui-done: ifndef MUI_INCLUDE # MUI mkdir -p build-dependencies/SDK @@ -43,6 +60,12 @@ cd build-dependencies/SDK && lha xf MCC_Popph.lha cp -R build-dependencies/SDK/MCC_Popph/Developer/C/include/mui build-dependencies/SDK/MUI/C/Include endif + touch $@ + +# +# Download and extract OpenURL includes +# +.openurl-done: # OpenURL ifndef OPENURL_INCLUDE cd build-dependencies && wget -c http://os4depot.net/share/network/misc/openurl.lha |
From: Sebastian B. <sb...@us...> - 2013-01-02 19:05:48
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24898/tests Modified Files: mail_unittest.c Log Message: Added simple test for mail_create_for(). Index: mail_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/mail_unittest.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- mail_unittest.c 16 Dec 2012 10:09:04 -0000 1.7 +++ mail_unittest.c 2 Jan 2013 19:05:46 -0000 1.8 @@ -100,3 +100,21 @@ array_free(recipients); mail_info_free(mi); } + + +/*************************************************************/ + +/* @Test */ +void test_mail_create_for(void) +{ + struct mail_complete *m; + + m = mail_create_for("abcd@zzzzuuuu.qq.qq","te...@ab...f",NULL,NULL,NULL); + CU_ASSERT(m != NULL); + CU_ASSERT(m->info != NULL); + + CU_ASSERT(strcmp(m->info->from_addr,"abcd@zzzzuuuu.qq.qq") == 0); + CU_ASSERT(strcmp(m->info->to_addr,"te...@ab...f") == 0); + + mail_complete_free(m); +} |
From: Sebastian B. <sb...@us...> - 2013-01-02 19:05:12
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24762 Modified Files: mail.c Log Message: Fixed leak in mail_create_for(). Index: mail.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/mail.c,v retrieving revision 1.244 retrieving revision 1.245 diff -u -d -r1.244 -r1.245 --- mail.c 2 Jan 2013 17:45:31 -0000 1.244 +++ mail.c 2 Jan 2013 19:05:09 -0000 1.245 @@ -1119,6 +1119,8 @@ mail_process_headers(mail); } free(to_str); + free(mb.addr_spec); + free(mb.phrase); return mail; } |
From: Sebastian B. <sb...@us...> - 2013-01-02 18:54:22
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23841/tests Modified Files: support_indep_unittest.c Log Message: Added test for mystrreplace(). Index: support_indep_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/support_indep_unittest.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- support_indep_unittest.c 16 Dec 2012 10:09:04 -0000 1.7 +++ support_indep_unittest.c 2 Jan 2013 18:54:20 -0000 1.8 @@ -124,3 +124,22 @@ array_free(a); } + + +/********************************************************/ + +/* @Test */ +void testmystrreplace(void) +{ + char *r; + + r = mystrreplace("abcdefgabcdefg","hij", "klm"); + CU_ASSERT(r != NULL); + CU_ASSERT(!strcmp("abcdefgabcdefg",r)); + free(r); + + r = mystrreplace("abcdefgabcdefg","bcd", "q"); + CU_ASSERT(r != NULL); + CU_ASSERT(!strcmp("aqefgaqefg",r)); + free(r); +} |
From: Sebastian B. <sb...@us...> - 2013-01-02 18:07:42
|
Update of /cvsroot/simplemail/simplemail/amiga-mui In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21699/amiga-mui Modified Files: gui_main.c Log Message: Added support for BODY/K also from shell command line. Index: gui_main.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/amiga-mui/gui_main.c,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- gui_main.c 23 Dec 2012 20:19:14 -0000 1.123 +++ gui_main.c 2 Jan 2013 18:07:39 -0000 1.124 @@ -504,6 +504,7 @@ static char *initial_mailto; static char *initial_subject; +static char *initial_body; static char *initial_message; static char **initial_attachments; @@ -605,11 +606,11 @@ if (open_config_window) open_config(); /* if we should open the compose window soon after start */ - if (initial_mailto || initial_subject || initial_attachments) + if (initial_mailto || initial_subject || initial_attachments || initial_body) { int win_num; - win_num = callback_write_mail_to_str(initial_mailto, initial_subject); + win_num = callback_write_mail_to_str_with_body(initial_mailto, initial_subject,initial_body); if (initial_attachments) compose_window_attach(win_num,initial_attachments); } @@ -617,12 +618,14 @@ callback_open_message(initial_message,-1); free(initial_message); + free(initial_body); free(initial_mailto); free(initial_subject); array_free(initial_attachments); + initial_message = NULL; + initial_body = NULL; initial_mailto = NULL; initial_subject = NULL; - initial_message = NULL; initial_attachments = NULL; /* register appicon refresh function which is called every 2 seconds */ @@ -670,6 +673,7 @@ char *message; char *mailto; char *subject; + char *body; char **attachments; char *profile_directory; char *image_directory; @@ -682,11 +686,12 @@ memset(&shell_args,0,sizeof(shell_args)); - if ((rdargs = ReadArgs("MESSAGE,MAILTO/K,SUBJECT/K,ATTACHMENT/K/M,PROFILEDIR/K,IMAGEDIR/K,DEBUG=DEBUGLEVEL/N/K,DEBUGOUT/K,DEBUGMODULES/K",(LONG*)&shell_args, NULL))) + if ((rdargs = ReadArgs("MESSAGE,MAILTO/K,SUBJECT/K,BODY/K,ATTACHMENT/K/M,PROFILEDIR/K,IMAGEDIR/K,DEBUG=DEBUGLEVEL/N/K,DEBUGOUT/K,DEBUGMODULES/K",(LONG*)&shell_args, NULL))) { initial_message = mystrdup(shell_args.message); initial_mailto = mystrdup(shell_args.mailto); initial_subject = mystrdup(shell_args.subject); + initial_body = mystrdup(shell_args.body); initial_attachments = array_duplicate(shell_args.attachments); config_set_user_profile_directory(shell_args.profile_directory); if ((gui_images_directory = mystrdup(shell_args.image_directory))) @@ -701,11 +706,11 @@ { char result[40]; /* SimpleMail is already running */ - if (initial_mailto || initial_subject || initial_attachments) + if (initial_mailto || initial_subject || initial_body || initial_attachments) { char *buf; - int buflen = mystrlen(initial_mailto)+mystrlen(initial_subject)+100; + int buflen = mystrlen(initial_mailto)+mystrlen(initial_subject)+mystrlen(initial_body) + 120; if (initial_attachments) { @@ -718,7 +723,7 @@ { int i; - sprintf(buf,"MAILWRITE MAILTO=\"%s\" SUBJECT=\"%s\"",initial_mailto?initial_mailto:"",initial_subject?initial_subject:""); + sprintf(buf,"MAILWRITE MAILTO=\"%s\" SUBJECT=\"%s\" BODY=\"%s\"",initial_mailto?initial_mailto:"",initial_subject?initial_subject:"",initial_body?initial_body:""); for (i=0;initial_attachments[i];i++) sprintf(buf+strlen(buf)," ATTACHMENT=\"%s\"",initial_attachments[i]); |
From: Sebastian B. <sb...@us...> - 2013-01-02 17:56:05
|
Update of /cvsroot/simplemail/simplemail/doc/amiga In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20912/doc/amiga Modified Files: SimpleMail.guide Log Message: Added description of BODY/K. Index: SimpleMail.guide =================================================================== RCS file: /cvsroot/simplemail/simplemail/doc/amiga/SimpleMail.guide,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- SimpleMail.guide 23 Dec 2012 20:19:14 -0000 1.69 +++ SimpleMail.guide 2 Jan 2013 17:56:03 -0000 1.70 @@ -3307,7 +3307,7 @@ MailWrite -- Open a new Compose Message window. @{b}TEMPLATE@{ub} - MAILTO/K,SUBJECT/K,ATTACHMENT/K/M + MAILTO/K,SUBJECT/K,BODY/K,ATTACHMENT/K/M @{b}FUNCTION@{ub} Opens a new Compose Message window using the recipient and @@ -3317,6 +3317,8 @@ MAILTO - either an email address or an alias (or even group name) that may be found in the addressbook SUBJECT - the subject title for the new mail + BODY - the body of the new mail. Use *n for newline and ** + for asterisks ATTACHMENT - a file that should be added as an attachment @{b}RETURNS@{ub} |
From: Sebastian B. <sb...@us...> - 2013-01-02 17:45:34
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20042 Modified Files: mail.h simplemail.h simplemail.c mail.c Log Message: Added possibility to compose a new mail using a defined body. Added BODY/K in MAILWRITE. Index: simplemail.h =================================================================== RCS file: /cvsroot/simplemail/simplemail/simplemail.h,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- simplemail.h 23 Dec 2012 09:29:24 -0000 1.93 +++ simplemail.h 2 Jan 2013 17:45:31 -0000 1.94 @@ -80,6 +80,7 @@ void callback_write_mail_to(struct addressbook_entry_new *address); int callback_write_mail_to_str(char *str, char *subject); +int callback_write_mail_to_str_with_body(char *str, char *subject, char *body); void callback_imap_submit_folders(struct folder *f, struct list *list); void callback_imap_get_folders(struct folder *f); Index: simplemail.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/simplemail.c,v retrieving revision 1.231 retrieving revision 1.232 diff -u -d -r1.231 -r1.232 --- simplemail.c 23 Dec 2012 09:29:24 -0000 1.231 +++ simplemail.c 2 Jan 2013 17:45:31 -0000 1.232 @@ -383,16 +383,17 @@ * @param to * @param replyto * @param subject + * @param body * @return the newly openend compose window number. */ -int callback_write_mail(char *from, char *to, char *replyto, char *subject) +static int callback_write_mail(char *from, char *to, char *replyto, char *subject, char *body) { struct compose_args ca; int win_num; memset(&ca,0,sizeof(ca)); ca.action = COMPOSE_ACTION_NEW; - ca.to_change = mail_create_for(from,to,replyto,subject); + ca.to_change = mail_create_for(from,to,replyto,subject,body); win_num = compose_window_open(&ca); @@ -410,7 +411,13 @@ /* a new mail should be written to a given address string */ int callback_write_mail_to_str(char *str, char *subject) { - return callback_write_mail(NULL,str,NULL,subject); + return callback_write_mail(NULL,str,NULL,subject,NULL); +} + +/* a new mail should be written to a given address string */ +int callback_write_mail_to_str_with_body(char *str, char *subject, char *body) +{ + return callback_write_mail(NULL,str,NULL,subject,body); } /** @@ -479,7 +486,7 @@ { struct folder *f = main_get_folder(); if (!f) return; - callback_write_mail(f->def_from,f->def_to,f->def_replyto,NULL); + callback_write_mail(f->def_from,f->def_to,f->def_replyto,NULL,NULL); } /* reply this mail */ Index: mail.h =================================================================== RCS file: /cvsroot/simplemail/simplemail/mail.h,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- mail.h 11 Dec 2012 18:45:23 -0000 1.82 +++ mail.h 2 Jan 2013 17:45:31 -0000 1.83 @@ -189,7 +189,7 @@ void mail_identify_status(struct mail_info *m); struct mail_complete *mail_complete_create(void); -struct mail_complete *mail_create_for(char *from, char *to_str_unexpanded, char *replyto, char *subject); +struct mail_complete *mail_create_for(char *from, char *to_str_unexpanded, char *replyto, char *subject, char *body); struct mail *mail_create_from_file(char *filename); struct mail_complete *mail_complete_create_from_file(char *filename); struct mail_complete *mail_create_reply(int num, struct mail_complete **mail_array); Index: mail.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/mail.c,v retrieving revision 1.243 retrieving revision 1.244 diff -u -d -r1.243 -r1.244 --- mail.c 23 Dec 2012 20:19:14 -0000 1.243 +++ mail.c 2 Jan 2013 17:45:31 -0000 1.244 @@ -990,11 +990,18 @@ return NULL; } -/************************************************************************** - Creates a mail to be send to a given address (fills out the to field - and the contents) -**************************************************************************/ -struct mail_complete *mail_create_for(char *from, char *to_str_unexpanded, char *replyto, char *subject) +/** + * Creates a mail to be send to a given address (fills out the to field + * and the body). + * + * @param from + * @param to_str_unexpanded + * @param replyto + * @param subject + * @param body maybe NULL in which case the best phrase is used + * @return + */ +struct mail_complete *mail_create_for(char *from, char *to_str_unexpanded, char *replyto, char *subject, char *body) { struct mail_complete *mail; char *to_str; @@ -1008,7 +1015,6 @@ if ((mail = mail_complete_create())) { string contents_str; - struct phrase *phrase; if (!(string_initialize(&contents_str,100))) { @@ -1017,8 +1023,6 @@ return NULL; } - phrase = phrase_find_best(to_str); - if (from) { mail_complete_add_header(mail,"From",4,from,strlen(from),0); @@ -1066,42 +1070,50 @@ } } - if (mb.phrase) + if (body) { - if (phrase && phrase->write_welcome_repicient) + string_append(&contents_str,body); + } else + { + struct phrase *phrase; + phrase = phrase_find_best(to_str); + if (mb.phrase) { - char *str = mail_create_string(phrase->write_welcome_repicient, NULL, mb.phrase, mb.addr_spec); - if (str) + if (phrase && phrase->write_welcome_repicient) { - string_append(&contents_str,str); - string_append(&contents_str,"\n"); - free(str); + char *str = mail_create_string(phrase->write_welcome_repicient, NULL, mb.phrase, mb.addr_spec); + if (str) + { + string_append(&contents_str,str); + string_append(&contents_str,"\n"); + free(str); + } + } + } else + { + if (phrase && phrase->write_welcome) + { + char *str = mail_create_string(phrase->write_welcome, NULL, NULL, NULL); + if (str) + { + string_append(&contents_str,str); + string_append(&contents_str,"\n"); + free(str); + } } } - } else - { - if (phrase && phrase->write_welcome) + + if (phrase && phrase->write_closing) { - char *str = mail_create_string(phrase->write_welcome, NULL, NULL, NULL); + char *str = mail_create_string(phrase->write_closing, NULL, NULL, NULL); if (str) { string_append(&contents_str,str); - string_append(&contents_str,"\n"); free(str); } } } - if (phrase && phrase->write_closing) - { - char *str = mail_create_string(phrase->write_closing, NULL, NULL, NULL); - if (str) - { - string_append(&contents_str,str); - free(str); - } - } - mail->decoded_data = contents_str.str; mail->decoded_len = contents_str.len; mail_process_headers(mail); |