]> git.ipfire.org Git - thirdparty/mlmmj.git/log
thirdparty/mlmmj.git
3 years agolist_subs: move prototype to make the functions testable
Baptiste Daroussin [Fri, 10 Feb 2023 11:05:00 +0000 (12:05 +0100)] 
list_subs: move prototype to make the functions testable

3 years agosend_list: convert to struct ml
Baptiste Daroussin [Fri, 10 Feb 2023 10:55:13 +0000 (11:55 +0100)] 
send_list: convert to struct ml

3 years agolistcontrol: convert to struct ml
Baptiste Daroussin [Fri, 10 Feb 2023 10:49:19 +0000 (11:49 +0100)] 
listcontrol: convert to struct ml

3 years agoinit_file_lines: rework using getline(3)
Baptiste Daroussin [Fri, 10 Feb 2023 10:23:33 +0000 (11:23 +0100)] 
init_file_lines: rework using getline(3)

3 years agoinit_file_lines: add unit test
Baptiste Daroussin [Fri, 10 Feb 2023 10:14:00 +0000 (11:14 +0100)] 
init_file_lines: add unit test

3 years agoinit_file_lines: remove unused function
Baptiste Daroussin [Fri, 10 Feb 2023 09:06:19 +0000 (10:06 +0100)] 
init_file_lines: remove unused function

Actually merge into init_truncated_file_lines and rename it

3 years agoinit_truncated_file_lines: remove never used case
Baptiste Daroussin [Fri, 10 Feb 2023 09:04:55 +0000 (10:04 +0100)] 
init_truncated_file_lines: remove never used case

init_truncated_file_lines is called only once and never with open_now
set to true

3 years agoprepstdreply: convert formatted to tll
Baptiste Daroussin [Fri, 10 Feb 2023 08:54:27 +0000 (09:54 +0100)] 
prepstdreply: convert formatted to tll

3 years agoRemove useless typedef
Baptiste Daroussin [Fri, 10 Feb 2023 08:44:27 +0000 (09:44 +0100)] 
Remove useless typedef

3 years agotext: use tlllist for substitutions
Baptiste Daroussin [Fri, 10 Feb 2023 08:41:15 +0000 (09:41 +0100)] 
text: use tlllist for substitutions

3 years agoprepstdreply: use normal register_unformatted to register default substitutions
Baptiste Daroussin [Fri, 10 Feb 2023 08:33:02 +0000 (09:33 +0100)] 
prepstdreply: use normal register_unformatted to register default substitutions

3 years agotext: remove usage of concatstr
Baptiste Daroussin [Thu, 9 Feb 2023 15:49:54 +0000 (16:49 +0100)] 
text: remove usage of concatstr

3 years agoopen_text: add simple tests
Baptiste Daroussin [Thu, 9 Feb 2023 15:16:28 +0000 (16:16 +0100)] 
open_text: add simple tests

3 years agoFix prototype
Baptiste Daroussin [Thu, 9 Feb 2023 15:14:57 +0000 (16:14 +0100)] 
Fix prototype

3 years agoprepstdreply: split the function to make it more testable
Baptiste Daroussin [Thu, 9 Feb 2023 14:40:20 +0000 (15:40 +0100)] 
prepstdreply: split the function to make it more testable

3 years agoopen_text: accept fd for list
Baptiste Daroussin [Thu, 9 Feb 2023 14:24:38 +0000 (15:24 +0100)] 
open_text: accept fd for list

while here add a new open_text_fd which will help for testing purpose

3 years agoopen_text: use calloc to initiize most of the variables
Baptiste Daroussin [Thu, 9 Feb 2023 14:13:17 +0000 (15:13 +0100)] 
open_text: use calloc to initiize most of the variables

3 years agomemory_lines: simplify the code and fully test it
Baptiste Daroussin [Thu, 9 Feb 2023 13:31:11 +0000 (14:31 +0100)] 
memory_lines: simplify the code and fully test it

3 years agomlmmj-process: convert to struct ml
Baptiste Daroussin [Thu, 9 Feb 2023 13:03:58 +0000 (14:03 +0100)] 
mlmmj-process: convert to struct ml

3 years agomlmmj-unsub: convert to use struct ml
Baptiste Daroussin [Thu, 9 Feb 2023 11:50:17 +0000 (12:50 +0100)] 
mlmmj-unsub: convert to use struct ml

3 years agogen_addr*: make the macro generic and test them
Baptiste Daroussin [Thu, 9 Feb 2023 11:49:53 +0000 (12:49 +0100)] 
gen_addr*: make the macro generic and test them

3 years agomlmmj-sub: convert to struct ml
Baptiste Daroussin [Thu, 9 Feb 2023 11:30:46 +0000 (12:30 +0100)] 
mlmmj-sub: convert to struct ml

3 years agomlmmj: introduc struct ml storage
Baptiste Daroussin [Thu, 9 Feb 2023 10:59:37 +0000 (11:59 +0100)] 
mlmmj: introduc struct ml storage

3 years agomlmmj-unsub: get rid of concatstr
Baptiste Daroussin [Thu, 9 Feb 2023 10:00:04 +0000 (11:00 +0100)] 
mlmmj-unsub: get rid of concatstr

3 years agolistcontrol: remove last concatstr
Baptiste Daroussin [Thu, 9 Feb 2023 09:54:05 +0000 (10:54 +0100)] 
listcontrol: remove last concatstr

3 years agolistcontrol: prefer access family of function over stat
Baptiste Daroussin [Thu, 9 Feb 2023 09:46:28 +0000 (10:46 +0100)] 
listcontrol: prefer access family of function over stat

3 years agoget_subcookit_content: only chomp once
Baptiste Daroussin [Thu, 9 Feb 2023 09:31:26 +0000 (10:31 +0100)] 
get_subcookit_content: only chomp once

3 years agolistcontrol: deduplicate and test subscription cookit fetching
Baptiste Daroussin [Thu, 9 Feb 2023 09:28:08 +0000 (10:28 +0100)] 
listcontrol: deduplicate and test subscription cookit fetching

3 years agomlmmj-receive: partially revert 00758b2b74f274d3568e03f5a5916d459f049765
Baptiste Daroussin [Thu, 9 Feb 2023 08:58:46 +0000 (09:58 +0100)] 
mlmmj-receive: partially revert 00758b2b74f274d3568e03f5a5916d459f049765

we actually do not need to override mlmmj-process path for testing
purpose

3 years agomlmmj: factorize the code opening the list directory
Baptiste Daroussin [Thu, 9 Feb 2023 08:46:20 +0000 (09:46 +0100)] 
mlmmj: factorize the code opening the list directory

This unifies the errors thrown and deduplicate the code in many places

3 years agomlmmj-receive: remove now unneeded header
Baptiste Daroussin [Thu, 9 Feb 2023 08:21:05 +0000 (09:21 +0100)] 
mlmmj-receive: remove now unneeded header

3 years agomlmmj-receive: limit memory manupulation using file descriptors
Baptiste Daroussin [Thu, 9 Feb 2023 08:19:03 +0000 (09:19 +0100)] 
mlmmj-receive: limit memory manupulation using file descriptors

While here throw an error message in case of inability to open the
"incoming" directory

3 years agomlmmj-receive: remove useless call to fileno(3)
Baptiste Daroussin [Thu, 9 Feb 2023 08:10:15 +0000 (09:10 +0100)] 
mlmmj-receive: remove useless call to fileno(3)

3 years agomlmmj-receive: add basic tests
Baptiste Daroussin [Thu, 9 Feb 2023 08:07:32 +0000 (09:07 +0100)] 
mlmmj-receive: add basic tests

3 years agomlmmj-receive: add the ability change the mlmmj-process path
Baptiste Daroussin [Thu, 9 Feb 2023 08:04:07 +0000 (09:04 +0100)] 
mlmmj-receive: add the ability change the mlmmj-process path

This will allow to simplify the debugging

3 years agomlmmj-process: fix test when mlmmj is not locally installed
Baptiste Daroussin [Thu, 9 Feb 2023 07:44:53 +0000 (08:44 +0100)] 
mlmmj-process: fix test when mlmmj is not locally installed

3 years agomlmmj-process: add a simple test about the "tocc" tunable
Baptiste Daroussin [Wed, 8 Feb 2023 18:00:20 +0000 (19:00 +0100)] 
mlmmj-process: add a simple test about the "tocc" tunable

3 years agofunctional-tests.sh: define the mailing list valid address
Baptiste Daroussin [Wed, 8 Feb 2023 17:50:39 +0000 (18:50 +0100)] 
functional-tests.sh: define the mailing list valid address

Now that mlmmj-process dies on it, it is important to set it up

3 years agomlmmj-process: use boolean where appropriate
Baptiste Daroussin [Wed, 8 Feb 2023 17:44:21 +0000 (18:44 +0100)] 
mlmmj-process: use boolean where appropriate

3 years agomlmmj-process: ensure the listaddress is correctly defined
Baptiste Daroussin [Wed, 8 Feb 2023 17:22:41 +0000 (18:22 +0100)] 
mlmmj-process: ensure the listaddress is correctly defined

3 years agomlmmj-process: reduce memory allocation
Baptiste Daroussin [Wed, 8 Feb 2023 17:04:26 +0000 (18:04 +0100)] 
mlmmj-process: reduce memory allocation

If we already caught the recipient extra informations to not try to
extract it again later.

3 years agomlmmj-process: remove empty lines
Baptiste Daroussin [Wed, 8 Feb 2023 16:00:54 +0000 (17:00 +0100)] 
mlmmj-process: remove empty lines

3 years agomlmmj-process: reduce memory allocation
Baptiste Daroussin [Wed, 8 Feb 2023 15:58:25 +0000 (16:58 +0100)] 
mlmmj-process: reduce memory allocation

When matching the mailing lists, addrmatch extracts the extra part of the
recipient. only allocate memory for it if there is actually something
there.

3 years agomlmmj-process: add tests for the function which matches the ml name
Baptiste Daroussin [Wed, 8 Feb 2023 15:56:26 +0000 (16:56 +0100)] 
mlmmj-process: add tests for the function which matches the ml name

While here use xstrndup where appropriate

3 years agomlmmj-process: rename addrtocc into addr_in_to_or_cc
Baptiste Daroussin [Wed, 8 Feb 2023 14:17:59 +0000 (15:17 +0100)] 
mlmmj-process: rename addrtocc into addr_in_to_or_cc

This ease code readability

3 years agomlmmj-process: add missing header
Baptiste Daroussin [Wed, 8 Feb 2023 13:54:23 +0000 (14:54 +0100)] 
mlmmj-process: add missing header

3 years agomlmmj-process: isolate function to extract recipextra from MTA
Baptiste Daroussin [Wed, 8 Feb 2023 13:32:28 +0000 (14:32 +0100)] 
mlmmj-process: isolate function to extract recipextra from MTA

3 years agoUse openat to reduce memory manipulation
Baptiste Daroussin [Wed, 8 Feb 2023 10:06:05 +0000 (11:06 +0100)] 
Use openat to reduce memory manipulation

3 years agomlmmj-process: add basic tests
Baptiste Daroussin [Wed, 8 Feb 2023 09:41:31 +0000 (10:41 +0100)] 
mlmmj-process: add basic tests

3 years agoAdd missing ')' in error message
Baptiste Daroussin [Wed, 8 Feb 2023 09:23:15 +0000 (10:23 +0100)] 
Add missing ')' in error message

3 years agolistcontrol: factorize the code which checks for the status of the list
Baptiste Daroussin [Tue, 7 Feb 2023 12:47:11 +0000 (13:47 +0100)] 
listcontrol: factorize the code which checks for the status of the list

3 years agolistcontrol: isolate the ctrl_command parser and test it
Baptiste Daroussin [Mon, 6 Feb 2023 14:25:44 +0000 (15:25 +0100)] 
listcontrol: isolate the ctrl_command parser and test it

3 years agoget_prepped_mailbody_from_map: fix null terminations issues
Baptiste Daroussin [Mon, 6 Feb 2023 08:50:05 +0000 (09:50 +0100)] 
get_prepped_mailbody_from_map: fix null terminations issues

Null terminate the returned string
mmap is not null terminated, pass the len to ensure the lookup is done
based on a length determined manner

3 years agoget_preppedhdrs_from_map: fix null terminations issues
Baptiste Daroussin [Mon, 6 Feb 2023 08:37:32 +0000 (09:37 +0100)] 
get_preppedhdrs_from_map: fix null terminations issues

Null terminate the returned string
mmap is not null terminated, pass the len to ensure the lookup is done
based on a length determined manner

3 years agotests: add simple test for get_preppedhdrs_from_map
Baptiste Daroussin [Mon, 6 Feb 2023 08:11:19 +0000 (09:11 +0100)] 
tests: add simple test for get_preppedhdrs_from_map

3 years agoRelease 1.4.0.a2 RELEASE_1_4_0_a2 RELEASE_1_4_0a2
Baptiste Daroussin [Wed, 18 Jan 2023 16:35:20 +0000 (17:35 +0100)] 
Release 1.4.0.a2

3 years agoFix missing argument
Baptiste Daroussin [Wed, 18 Jan 2023 16:08:04 +0000 (17:08 +0100)] 
Fix missing argument

3 years agoComplete the send_mail tests up to RSET to avoid sigpipe
Baptiste Daroussin [Wed, 18 Jan 2023 15:43:41 +0000 (16:43 +0100)] 
Complete the send_mail tests up to RSET to avoid sigpipe

3 years agoReplace all pipes by socketpair in tests
Baptiste Daroussin [Wed, 18 Jan 2023 14:42:54 +0000 (15:42 +0100)] 
Replace all pipes by socketpair in tests

3 years agoportability: replace pipe with socketpair which behaves consistently between linux...
Baptiste Daroussin [Wed, 18 Jan 2023 14:36:27 +0000 (15:36 +0100)] 
portability: replace pipe with socketpair which behaves consistently between linux and freebsd

3 years agoportability: fix a portable difference between linux and freebsd
Baptiste Daroussin [Wed, 18 Jan 2023 10:20:53 +0000 (11:20 +0100)] 
portability: fix a portable difference between linux and freebsd

on linux writing to the first entry of a pipe returns EBADF

3 years agorework dumpfd2fd to make fallback more easily testable
Baptiste Daroussin [Tue, 10 Jan 2023 12:52:19 +0000 (13:52 +0100)] 
rework dumpfd2fd to make fallback more easily testable

shm are not easy to use in a portable manner

3 years agoMake --enable-coverage compatible with gcc
Baptiste Daroussin [Tue, 10 Jan 2023 08:24:58 +0000 (09:24 +0100)] 
Make --enable-coverage compatible with gcc

3 years agoSplit dump2fd unit test to ease debugging
Baptiste Daroussin [Tue, 10 Jan 2023 07:54:01 +0000 (08:54 +0100)] 
Split dump2fd unit test to ease debugging

3 years agogetline: portability issue.
Baptiste Daroussin [Mon, 9 Jan 2023 14:58:59 +0000 (15:58 +0100)] 
getline: portability issue.

If getline() fails always make sure the buffer is freeed and set to NULL

This fixes an issue with getlistdelim().

3 years agomemory: plug more memory leaks
Baptiste Daroussin [Mon, 9 Jan 2023 14:25:09 +0000 (15:25 +0100)] 
memory: plug more memory leaks

3 years agomlmmj-maintd: plug memory leak
Baptiste Daroussin [Mon, 9 Jan 2023 13:51:26 +0000 (14:51 +0100)] 
mlmmj-maintd: plug memory leak

3 years agoexec_and_wait: plug memory leak
Baptiste Daroussin [Mon, 9 Jan 2023 13:48:36 +0000 (14:48 +0100)] 
exec_and_wait: plug memory leak

3 years agomlmmj-bounce: fix using the wrong variable
Baptiste Daroussin [Mon, 9 Jan 2023 13:45:41 +0000 (14:45 +0100)] 
mlmmj-bounce: fix using the wrong variable

3 years agoOnly linux shm requires -lrt
Baptiste Daroussin [Mon, 9 Jan 2023 13:40:42 +0000 (14:40 +0100)] 
Only linux shm requires -lrt

3 years agoFix left shifting issues noticed by sanitizer
Baptiste Daroussin [Mon, 9 Jan 2023 13:40:16 +0000 (14:40 +0100)] 
Fix left shifting issues noticed by sanitizer

3 years agomemory: plug leak
Baptiste Daroussin [Mon, 9 Jan 2023 13:26:48 +0000 (14:26 +0100)] 
memory: plug leak

3 years agomlmmj-bounce: do now lowercase twice the email address
Baptiste Daroussin [Mon, 9 Jan 2023 13:18:12 +0000 (14:18 +0100)] 
mlmmj-bounce: do now lowercase twice the email address

3 years agomemory: fix user after free
Baptiste Daroussin [Mon, 9 Jan 2023 09:02:23 +0000 (10:02 +0100)] 
memory: fix user after free

3 years agoAdd switch to enable building with ASAN and UBSAN
Baptiste Daroussin [Mon, 9 Jan 2023 09:01:53 +0000 (10:01 +0100)] 
Add switch to enable building with ASAN and UBSAN

3 years agoportability: avoid using fdclose() which does not exists on linux
Baptiste Daroussin [Mon, 9 Jan 2023 08:31:38 +0000 (09:31 +0100)] 
portability: avoid using fdclose() which does not exists on linux

3 years agoportability: fix again sys/limits.h -> limits.h
Baptiste Daroussin [Mon, 9 Jan 2023 08:25:20 +0000 (09:25 +0100)] 
portability: fix again sys/limits.h -> limits.h

3 years agoEliminate some use of concatstr
Baptiste Daroussin [Thu, 5 Jan 2023 14:49:16 +0000 (15:49 +0100)] 
Eliminate some use of concatstr

3 years agolog_oper: fix regression and add unit test
Baptiste Daroussin [Thu, 5 Jan 2023 14:09:05 +0000 (15:09 +0100)] 
log_oper: fix regression and add unit test

3 years agolog_oper: rework
Baptiste Daroussin [Thu, 5 Jan 2023 13:35:50 +0000 (14:35 +0100)] 
log_oper: rework

use file descriptor and do not use an intermediary variable before
writting the logs, as a side effect it drop the limitation of 256 chars
per lines

3 years agoRemove dead code
Baptiste Daroussin [Thu, 5 Jan 2023 12:02:55 +0000 (13:02 +0100)] 
Remove dead code

3 years agoinindexfile: small cleanups
Baptiste Daroussin [Thu, 5 Jan 2023 12:02:16 +0000 (13:02 +0100)] 
inindexfile: small cleanups

3 years agoinit_sockfd: remove MLMMJ_TESTING, we now have a testsuite for that
Baptiste Daroussin [Thu, 5 Jan 2023 11:59:19 +0000 (12:59 +0100)] 
init_sockfd: remove MLMMJ_TESTING, we now have a testsuite for that

3 years agoAdd testsuite for controls and incindexfile
Baptiste Daroussin [Thu, 5 Jan 2023 11:57:33 +0000 (12:57 +0100)] 
Add testsuite for controls and incindexfile

3 years agodumpfd2fd: test more edge cases
Baptiste Daroussin [Thu, 5 Jan 2023 10:40:14 +0000 (11:40 +0100)] 
dumpfd2fd: test more edge cases

3 years agowriten: eliminate code which is not used anymore
Baptiste Daroussin [Thu, 5 Jan 2023 09:49:47 +0000 (10:49 +0100)] 
writen: eliminate code which is not used anymore

3 years agodumpfd2fd: use copy_file_range if available (add testsuite for it)
Baptiste Daroussin [Thu, 5 Jan 2023 09:44:34 +0000 (10:44 +0100)] 
dumpfd2fd: use copy_file_range if available (add testsuite for it)

3 years agorandom-int: really use arc4random_uniform
Baptiste Daroussin [Thu, 5 Jan 2023 08:43:44 +0000 (09:43 +0100)] 
random-int: really use arc4random_uniform

3 years agomlmmj-list: simple modernization of the code no change expected
Baptiste Daroussin [Thu, 5 Jan 2023 08:38:52 +0000 (09:38 +0100)] 
mlmmj-list: simple modernization of the code no change expected

3 years agomlmmj-list: simplify code replacing mmap with getline();
Baptiste Daroussin [Thu, 5 Jan 2023 08:30:35 +0000 (09:30 +0100)] 
mlmmj-list: simplify code replacing mmap with getline();

3 years agomlmmj-list: constify variables
Baptiste Daroussin [Thu, 5 Jan 2023 08:25:13 +0000 (09:25 +0100)] 
mlmmj-list: constify variables

3 years agomlmmj-list: use file descriptors where possible
Baptiste Daroussin [Thu, 5 Jan 2023 08:24:09 +0000 (09:24 +0100)] 
mlmmj-list: use file descriptors where possible

3 years agomlmmj-list: add simple testsuite
Baptiste Daroussin [Thu, 5 Jan 2023 08:03:14 +0000 (09:03 +0100)] 
mlmmj-list: add simple testsuite

3 years agoctrlvalues: rework to use fd and getline()
Baptiste Daroussin [Wed, 4 Jan 2023 15:15:01 +0000 (16:15 +0100)] 
ctrlvalues: rework to use fd and getline()

This simplifies the code and reduce the memory allocation

3 years agoFix build with coverage for contrib code
Baptiste Daroussin [Tue, 3 Jan 2023 14:02:54 +0000 (15:02 +0100)] 
Fix build with coverage for contrib code

3 years agoReplace struct strlist with strlist based on on tllist
Baptiste Daroussin [Tue, 3 Jan 2023 13:48:26 +0000 (14:48 +0100)] 
Replace struct strlist with strlist based on on tllist

3 years agoReplace custom struct email_contianer with generic strlist
Baptiste Daroussin [Tue, 3 Jan 2023 11:13:10 +0000 (12:13 +0100)] 
Replace custom struct email_contianer with generic strlist

3 years agoImport tllist, this will be used as a general purpose list mechanism
Baptiste Daroussin [Tue, 3 Jan 2023 09:25:10 +0000 (10:25 +0100)] 
Import tllist, this will be used as a general purpose list mechanism

3 years agoctrlvalue: Cleanup unused headers
Baptiste Daroussin [Wed, 28 Dec 2022 19:09:41 +0000 (20:09 +0100)] 
ctrlvalue: Cleanup unused headers

3 years agoRename getaddrsfromfd into getaddrsfromfile to reflect code change
Baptiste Daroussin [Wed, 28 Dec 2022 16:49:37 +0000 (17:49 +0100)] 
Rename getaddrsfromfd into getaddrsfromfile to reflect code change