]> git.ipfire.org Git - thirdparty/mlmmj.git/log
thirdparty/mlmmj.git
3 years agoSimplify code now that unsubscribe() support SUB_ALL
Baptiste Daroussin [Thu, 16 Dec 2021 16:35:33 +0000 (17:35 +0100)] 
Simplify code now that unsubscribe() support SUB_ALL

3 years agosubscriber functions: add unit tests
Baptiste Daroussin [Thu, 16 Dec 2021 16:25:06 +0000 (17:25 +0100)] 
subscriber functions: add unit tests

3 years agounsubscribe: remove unused parameter
Baptiste Daroussin [Thu, 16 Dec 2021 15:43:49 +0000 (16:43 +0100)] 
unsubscribe: remove unused parameter

3 years agomemory: use wrappers which abort() in case of failure
Baptiste Daroussin [Thu, 16 Dec 2021 14:21:56 +0000 (15:21 +0100)] 
memory: use wrappers which abort() in case of failure

3 years agocleanup: replace itoa with snprintf(...%d...)
Baptiste Daroussin [Thu, 16 Dec 2021 13:57:47 +0000 (14:57 +0100)] 
cleanup: replace itoa with snprintf(...%d...)

3 years agotest: add unit test for mygetline
Baptiste Daroussin [Thu, 16 Dec 2021 13:07:53 +0000 (14:07 +0100)] 
test: add unit test for mygetline

3 years agomail functions: factorize the code and add unit test
Baptiste Daroussin [Thu, 16 Dec 2021 12:37:40 +0000 (13:37 +0100)] 
mail functions: factorize the code and add unit test

3 years agotests: add testing for strtoim family functions
Baptiste Daroussin [Thu, 16 Dec 2021 11:28:01 +0000 (12:28 +0100)] 
tests: add testing for strtoim family functions

3 years agomybasename: test and optimise
Baptiste Daroussin [Thu, 16 Dec 2021 10:44:14 +0000 (11:44 +0100)] 
mybasename: test and optimise

Eliminate the need for memory alloation for this function

3 years agotests: add missing test for chomp and add test for mydirname
Baptiste Daroussin [Thu, 16 Dec 2021 10:38:21 +0000 (11:38 +0100)] 
tests: add missing test for chomp and add test for mydirname

3 years agorandom: ensure arc4random_uniform is used if possible
Baptiste Daroussin [Thu, 16 Dec 2021 10:29:37 +0000 (11:29 +0100)] 
random: ensure arc4random_uniform is used if possible

3 years agochomp: full test all chomp branches
Baptiste Daroussin [Thu, 16 Dec 2021 10:23:57 +0000 (11:23 +0100)] 
chomp: full test all chomp branches

3 years agotests: err_set_file is not portable
Baptiste Daroussin [Thu, 9 Dec 2021 12:56:53 +0000 (13:56 +0100)] 
tests: err_set_file is not portable

Use atf facilities instead

3 years agolocking: remove lock wrappers, lock is now handled an open() time
Baptiste Daroussin [Thu, 9 Dec 2021 09:18:58 +0000 (10:18 +0100)] 
locking: remove lock wrappers, lock is now handled an open() time

3 years agomlmmj-send: get an exclusive lock at open time
Baptiste Daroussin [Thu, 9 Dec 2021 09:13:33 +0000 (10:13 +0100)] 
mlmmj-send: get an exclusive lock at open time

3 years agomlmmj-process: eliminate 2 direct calls to mlmmj-send
Baptiste Daroussin [Thu, 9 Dec 2021 09:04:10 +0000 (10:04 +0100)] 
mlmmj-process: eliminate 2 direct calls to mlmmj-send

3 years agosend_list: stop executing mlmmj-send
Baptiste Daroussin [Thu, 9 Dec 2021 08:50:57 +0000 (09:50 +0100)] 
send_list: stop executing mlmmj-send

3 years agomlmmj-maintd: mlmmjunsub is not necessary anymore
Baptiste Daroussin [Thu, 9 Dec 2021 08:18:42 +0000 (09:18 +0100)] 
mlmmj-maintd: mlmmjunsub is not necessary anymore

3 years agomlmmj-maintd: do not execute mlmmj-unsub
Baptiste Daroussin [Thu, 9 Dec 2021 08:14:51 +0000 (09:14 +0100)] 
mlmmj-maintd: do not execute mlmmj-unsub

3 years agosend_denymail: do not execute mlmmj-send
Baptiste Daroussin [Thu, 9 Dec 2021 08:07:22 +0000 (09:07 +0100)] 
send_denymail: do not execute mlmmj-send

3 years agosend_help: do not execute mlmmj-send
Baptiste Daroussin [Thu, 9 Dec 2021 07:56:40 +0000 (08:56 +0100)] 
send_help: do not execute mlmmj-send

3 years agomlmmj-unsub: remove now unneeded headers
Baptiste Daroussin [Wed, 8 Dec 2021 17:07:35 +0000 (18:07 +0100)] 
mlmmj-unsub: remove now unneeded headers

3 years agomlmmj-unsub: remove the check for the full path
Baptiste Daroussin [Wed, 8 Dec 2021 17:01:39 +0000 (18:01 +0100)] 
mlmmj-unsub: remove the check for the full path

mlmmj-unsub does not execute anyother program anymore, making this
check now useless

3 years agounsubscribe: fix conversion to *at functions
Baptiste Daroussin [Wed, 8 Dec 2021 16:57:46 +0000 (17:57 +0100)] 
unsubscribe: fix conversion to *at functions

3 years agomlmmj-sub: add a test for auto unsubscription on subscruption
Baptiste Daroussin [Wed, 8 Dec 2021 16:29:38 +0000 (17:29 +0100)] 
mlmmj-sub: add a test for auto unsubscription on subscruption

3 years agomlmmj-sub: stop forking mlmmj-unsub to unsubscribe people
Baptiste Daroussin [Wed, 8 Dec 2021 09:31:59 +0000 (10:31 +0100)] 
mlmmj-sub: stop forking mlmmj-unsub to unsubscribe people

3 years agounsubscribe: move the code for reusability
Baptiste Daroussin [Wed, 8 Dec 2021 09:19:28 +0000 (10:19 +0100)] 
unsubscribe: move the code for reusability

3 years agoFactorize lowercase code
Baptiste Daroussin [Tue, 7 Dec 2021 10:01:47 +0000 (11:01 +0100)] 
Factorize lowercase code

3 years agosend_mail: stop executing mlmmj-send for sending a single email
Baptiste Daroussin [Fri, 3 Dec 2021 17:05:41 +0000 (18:05 +0100)] 
send_mail: stop executing mlmmj-send for sending a single email

instead of executing an external program, directly send the email

3 years agosend_mails: extract code from mlmmj-send
Baptiste Daroussin [Fri, 5 Nov 2021 09:17:45 +0000 (10:17 +0100)] 
send_mails: extract code from mlmmj-send

Prepare the land for a refactoring of the send emails function, to avoid
having to call the mlmmj-send binary.

3 years agocleanup: use open_memstream
Baptiste Daroussin [Fri, 5 Nov 2021 09:40:08 +0000 (10:40 +0100)] 
cleanup: use open_memstream

It simplifies the code handling the preparation of the body and the
headers from a mmap

3 years agoprepstdreply: reduce memory allocation by using file descriptors
Baptiste Daroussin [Thu, 4 Nov 2021 14:07:15 +0000 (15:07 +0100)] 
prepstdreply: reduce memory allocation by using file descriptors

3 years agocleanup: remove dead code
Baptiste Daroussin [Thu, 4 Nov 2021 13:49:54 +0000 (14:49 +0100)] 
cleanup: remove dead code

3 years agomlmmj-sub: fix test when default text are not installed
Baptiste Daroussin [Thu, 4 Nov 2021 13:47:57 +0000 (14:47 +0100)] 
mlmmj-sub: fix test when default text are not installed

3 years agomlmmj-unsub: eliminate useless memory duplication
Baptiste Daroussin [Thu, 4 Nov 2021 13:34:44 +0000 (14:34 +0100)] 
mlmmj-unsub: eliminate useless memory duplication

3 years agogenmsgid: use asprintf instead of snprintf + strdup
Baptiste Daroussin [Thu, 4 Nov 2021 13:12:26 +0000 (14:12 +0100)] 
genmsgid: use asprintf instead of snprintf + strdup

3 years agogendatestr: use strftime directly
Baptiste Daroussin [Thu, 4 Nov 2021 11:09:10 +0000 (12:09 +0100)] 
gendatestr: use strftime directly

3 years agotestsuite: simple test for text formatting
Baptiste Daroussin [Thu, 4 Nov 2021 10:48:58 +0000 (11:48 +0100)] 
testsuite: simple test for text formatting

4 years agotext: point the test to the bundled location of the text files
Baptiste Daroussin [Wed, 3 Nov 2021 13:54:00 +0000 (14:54 +0100)] 
text: point the test to the bundled location of the text files

4 years agotext: use file descriptors when possible to avoid manipulating memory
Baptiste Daroussin [Wed, 3 Nov 2021 13:43:07 +0000 (14:43 +0100)] 
text: use file descriptors when possible to avoid manipulating memory

4 years agotext: add a very simple test to ensure open_text works
Baptiste Daroussin [Wed, 3 Nov 2021 13:42:30 +0000 (14:42 +0100)] 
text: add a very simple test to ensure open_text works

4 years agodelimiter: now parsing delimiter is handled directly withing mlmmj_list
Baptiste Daroussin [Wed, 3 Nov 2021 10:54:27 +0000 (11:54 +0100)] 
delimiter: now parsing delimiter is handled directly withing mlmmj_list

4 years agostatctrl: convert to stdbool
Baptiste Daroussin [Wed, 3 Nov 2021 10:53:27 +0000 (11:53 +0100)] 
statctrl: convert to stdbool

4 years agotestsuite: add tests for statctrl and mlmmj_list*
Baptiste Daroussin [Wed, 3 Nov 2021 10:51:10 +0000 (11:51 +0100)] 
testsuite: add tests for statctrl and mlmmj_list*

4 years agomlmmj_list: cleanup error handling
Baptiste Daroussin [Wed, 3 Nov 2021 10:48:39 +0000 (11:48 +0100)] 
mlmmj_list: cleanup error handling

4 years agosend_digest: directly dprint instead of allocating a temporary string
Baptiste Daroussin [Wed, 3 Nov 2021 08:12:14 +0000 (09:12 +0100)] 
send_digest: directly dprint instead of allocating a temporary string

4 years agosend_digest: prefer openat
Baptiste Daroussin [Wed, 3 Nov 2021 08:11:10 +0000 (09:11 +0100)] 
send_digest: prefer openat

4 years agosend_digest: convert to mlmmj_list
Baptiste Daroussin [Wed, 3 Nov 2021 08:08:30 +0000 (09:08 +0100)] 
send_digest: convert to mlmmj_list

While here use at function to open archives directly

4 years agomore use helpers
Baptiste Daroussin [Wed, 3 Nov 2021 07:58:42 +0000 (08:58 +0100)] 
more use helpers

4 years agocontrols: add a helper for conversion to long
Baptiste Daroussin [Tue, 2 Nov 2021 17:25:01 +0000 (18:25 +0100)] 
controls: add a helper for conversion to long

4 years agoclang: fix errors reported by clang
Baptiste Daroussin [Tue, 2 Nov 2021 17:24:35 +0000 (18:24 +0100)] 
clang: fix errors reported by clang

4 years agocleanup: use the ctrltimet helper
Baptiste Daroussin [Tue, 2 Nov 2021 17:16:28 +0000 (18:16 +0100)] 
cleanup: use the ctrltimet helper

4 years agocontrols: add a helper to convert control to timet safely
Baptiste Daroussin [Tue, 2 Nov 2021 17:13:45 +0000 (18:13 +0100)] 
controls: add a helper to convert control to timet safely

4 years agomlmmj-maintd: convert delolder to file descriptor manipulation
Baptiste Daroussin [Tue, 2 Nov 2021 17:07:38 +0000 (18:07 +0100)] 
mlmmj-maintd: convert delolder to file descriptor manipulation

4 years agoconcatstr -> myasprintf
Baptiste Daroussin [Tue, 2 Nov 2021 16:59:19 +0000 (17:59 +0100)] 
concatstr -> myasprintf

4 years agomlmmj-maintd: simplify the code after the conversion to at functions
Baptiste Daroussin [Tue, 2 Nov 2021 16:50:59 +0000 (17:50 +0100)] 
mlmmj-maintd: simplify the code after the conversion to at functions

4 years agocleanup: eliminate some concatstr for file descriptor manipulation
Baptiste Daroussin [Tue, 2 Nov 2021 16:36:40 +0000 (17:36 +0100)] 
cleanup: eliminate some concatstr for file descriptor manipulation

4 years agocleanup: use dprintf earlier to avoid temporary memory allocation
Baptiste Daroussin [Tue, 2 Nov 2021 14:26:59 +0000 (15:26 +0100)] 
cleanup: use dprintf earlier to avoid temporary memory allocation

4 years agocleanup: replace concatstr with asprintf
Baptiste Daroussin [Tue, 2 Nov 2021 14:26:40 +0000 (15:26 +0100)] 
cleanup: replace concatstr with asprintf

4 years agocleanup: use dprintf earlier to avoid temporary memory allocation
Baptiste Daroussin [Tue, 2 Nov 2021 14:22:14 +0000 (15:22 +0100)] 
cleanup: use dprintf earlier to avoid temporary memory allocation

4 years agocleanup: replace concatstr with asprintf
Baptiste Daroussin [Tue, 2 Nov 2021 14:17:05 +0000 (15:17 +0100)] 
cleanup: replace concatstr with asprintf

4 years agocleanup: eliminate some concatstr for file descriptor manipulation
Baptiste Daroussin [Tue, 2 Nov 2021 14:13:06 +0000 (15:13 +0100)] 
cleanup: eliminate some concatstr for file descriptor manipulation

4 years agoopen_text*: convert to struct mlmmj_list
Baptiste Daroussin [Tue, 2 Nov 2021 13:59:24 +0000 (14:59 +0100)] 
open_text*: convert to struct mlmmj_list

4 years agocleanup: replace some concatstr with standard asprintf
Baptiste Daroussin [Tue, 2 Nov 2021 13:52:16 +0000 (14:52 +0100)] 
cleanup: replace some concatstr with standard asprintf

4 years agocleanup: replace strtol with safe function when possible
Baptiste Daroussin [Tue, 2 Nov 2021 13:42:55 +0000 (14:42 +0100)] 
cleanup: replace strtol with safe function when possible

4 years agotestsuite: add missing components for the suite to be able to run
Baptiste Daroussin [Wed, 3 Nov 2021 09:14:25 +0000 (10:14 +0100)] 
testsuite: add missing components for the suite to be able to run

4 years agocleanup: rewrite index file handling
Baptiste Daroussin [Tue, 2 Nov 2021 13:28:18 +0000 (14:28 +0100)] 
cleanup: rewrite index file handling

Use openat to avoid memory manipulation
Use a safe strtoim function to convert from int

4 years agorandom: use arc4random on systems supporting it
Baptiste Daroussin [Tue, 2 Nov 2021 11:18:21 +0000 (12:18 +0100)] 
random: use arc4random on systems supporting it

4 years agocleanup: promote writen as a static function only for dumpfd2fd
Baptiste Daroussin [Tue, 2 Nov 2021 11:10:42 +0000 (12:10 +0100)] 
cleanup: promote writen as a static function only for dumpfd2fd

4 years agocleanup: replace most writen with dprintf
Baptiste Daroussin [Tue, 2 Nov 2021 10:57:52 +0000 (11:57 +0100)] 
cleanup: replace most writen with dprintf

4 years agomlmmj: get rid of getlistaddr code
Baptiste Daroussin [Thu, 28 Oct 2021 16:21:07 +0000 (18:21 +0200)] 
mlmmj: get rid of getlistaddr code

4 years agocontrol functions: refactor them and group them
Baptiste Daroussin [Thu, 28 Oct 2021 16:08:26 +0000 (18:08 +0200)] 
control functions: refactor them and group them

Refactor the function to limit code duplication, and use modern C
function: getline, getdelim, etc.

4 years agomlmm-unsub: Add basic test suite
Baptiste Daroussin [Thu, 28 Oct 2021 15:10:37 +0000 (17:10 +0200)] 
mlmm-unsub: Add basic test suite

4 years agomlmmj-unsub: fix an issue when the reported subdir of pointer is NULL
Baptiste Daroussin [Thu, 28 Oct 2021 15:10:00 +0000 (17:10 +0200)] 
mlmmj-unsub: fix an issue when the reported subdir of pointer is NULL

4 years agosub/unsub: factorize the change uid code
Baptiste Daroussin [Thu, 28 Oct 2021 13:00:18 +0000 (15:00 +0200)] 
sub/unsub: factorize the change uid code

4 years agosubscription: use filedescriptors to check for subscription membership
Baptiste Daroussin [Thu, 28 Oct 2021 12:46:15 +0000 (14:46 +0200)] 
subscription: use filedescriptors to check for subscription membership

4 years agomlmmj-*sub: eliminate most concatstr in favor of standard C function
Baptiste Daroussin [Thu, 28 Oct 2021 12:25:53 +0000 (14:25 +0200)] 
mlmmj-*sub: eliminate most concatstr in favor of standard C function

4 years agomyasprintf: mark as printf like for compilation checks
Baptiste Daroussin [Thu, 28 Oct 2021 12:00:34 +0000 (14:00 +0200)] 
myasprintf: mark as printf like for compilation checks

4 years agomlmmj-unsub: convert to use filedescriptors
Baptiste Daroussin [Thu, 28 Oct 2021 11:53:27 +0000 (13:53 +0200)] 
mlmmj-unsub: convert to use filedescriptors

While here, use O_EXLOCK to obtain the lock

4 years agomlmmj-sub: share code between sub and unsub
Baptiste Daroussin [Thu, 28 Oct 2021 09:57:19 +0000 (11:57 +0200)] 
mlmmj-sub: share code between sub and unsub

4 years agosubscribers: add a function to factorize code between sub and unsub
Baptiste Daroussin [Thu, 28 Oct 2021 09:56:59 +0000 (11:56 +0200)] 
subscribers: add a function to factorize code between sub and unsub

4 years agomlmmj-sub: use modern C
Baptiste Daroussin [Thu, 28 Oct 2021 09:35:43 +0000 (11:35 +0200)] 
mlmmj-sub: use modern C

Use O_APPEND instead of lseek,
Use dprintf instead of writen

4 years agomlmmj-sub: add testcase about appending a new subscriber
Baptiste Daroussin [Thu, 28 Oct 2021 09:25:46 +0000 (11:25 +0200)] 
mlmmj-sub: add testcase about appending a new subscriber

4 years agomlmmj-sub: convert subscription to file descriptor
Baptiste Daroussin [Thu, 28 Oct 2021 09:16:12 +0000 (11:16 +0200)] 
mlmmj-sub: convert subscription to file descriptor

While use O_EXCL for locking directly at open() time

4 years agostrgen: split a mail address in one single function
Baptiste Daroussin [Thu, 28 Oct 2021 08:44:25 +0000 (10:44 +0200)] 
strgen: split a mail address in one single function

Up to now the split of an email address into the fqdn and the local part
was done in 2 functions both allocatign memory, with this change, now
the memory is allocated only once and the fqdn is just a pointer on the
begining of the allocated memory part corresponding to it

4 years agomemory: add strndup and asprintf wrappers
Baptiste Daroussin [Thu, 28 Oct 2021 08:28:24 +0000 (10:28 +0200)] 
memory: add strndup and asprintf wrappers

4 years agostatctrl: use file descriptors instead of manipulating memory
Baptiste Daroussin [Thu, 28 Oct 2021 08:16:54 +0000 (10:16 +0200)] 
statctrl: use file descriptors instead of manipulating memory

4 years agoprepstdreply: finish conversion to mlmmj_list
Baptiste Daroussin [Thu, 28 Oct 2021 08:12:08 +0000 (10:12 +0200)] 
prepstdreply: finish conversion to mlmmj_list

4 years agomlmmj_list: prepare file descriptors
Baptiste Daroussin [Thu, 28 Oct 2021 07:49:24 +0000 (09:49 +0200)] 
mlmmj_list: prepare file descriptors

When opening the mailing list, open the directory and keep the file
descriptor open up to the closing.

While here add a controlfd member to make keep a file descriptor on the
control directory on demand if needed

4 years agomlmmj_list: shorter the members of the struct to be more meaning full
Baptiste Daroussin [Thu, 28 Oct 2021 07:22:28 +0000 (09:22 +0200)] 
mlmmj_list: shorter the members of the struct to be more meaning full

4 years agocleanup: remove unused headers
Baptiste Daroussin [Wed, 27 Oct 2021 16:18:25 +0000 (18:18 +0200)] 
cleanup: remove unused headers

4 years agoprepstdreply: convert to struct mlmmj_list
Baptiste Daroussin [Wed, 27 Oct 2021 16:02:20 +0000 (18:02 +0200)] 
prepstdreply: convert to struct mlmmj_list

4 years agomlmmj-send: convert to struct mlmmj_list
Baptiste Daroussin [Wed, 27 Oct 2021 15:53:43 +0000 (17:53 +0200)] 
mlmmj-send: convert to struct mlmmj_list

4 years agosend_digests: convert to struct mlmmj_list
Baptiste Daroussin [Wed, 27 Oct 2021 15:30:54 +0000 (17:30 +0200)] 
send_digests: convert to struct mlmmj_list

4 years agosend_help: convert to use struct mlmmj_list
Baptiste Daroussin [Wed, 27 Oct 2021 15:12:14 +0000 (17:12 +0200)] 
send_help: convert to use struct mlmmj_list

4 years agosend_list: convert to use struct mlmmj_list
Baptiste Daroussin [Wed, 27 Oct 2021 15:09:13 +0000 (17:09 +0200)] 
send_list: convert to use struct mlmmj_list

4 years agomlmmj-process: use a bit more the struct mlmmj_list
Baptiste Daroussin [Wed, 27 Oct 2021 15:03:09 +0000 (17:03 +0200)] 
mlmmj-process: use a bit more the struct mlmmj_list

4 years agostatctrl: simplify the code to use access instead of stat
Baptiste Daroussin [Wed, 27 Oct 2021 14:54:19 +0000 (16:54 +0200)] 
statctrl: simplify the code to use access instead of stat

4 years agomlmmj-sub: mark as static functions that needs to be marked as such
Baptiste Daroussin [Wed, 27 Oct 2021 12:37:06 +0000 (14:37 +0200)] 
mlmmj-sub: mark as static functions that needs to be marked as such

4 years agogeneral: add a mlmmj_list structure
Baptiste Daroussin [Wed, 27 Oct 2021 12:32:46 +0000 (14:32 +0200)] 
general: add a mlmmj_list structure

this structure will avoid duplication of code in many places and also
prepare the land to the usage of file descriptors where possible