Commit graph

127 commits

Author SHA1 Message Date
theexiile1305
f6bda99464
feat: transfer configuration of intermediate certificate to caller of the library 2024-10-11 18:43:04 +02:00
Michael Fuchs
7f7bf80e39
Merge branch 'main' into main 2024-10-09 16:29:21 +02:00
theexiile1305
5913fc1540
feat: improved tests 2024-10-09 15:40:05 +02:00
theexiile1305
4700691380
fix: detached signature is now used 2024-10-09 13:53:15 +02:00
5874911c91
Simplify Message-ID generation
Updated the SetMessageID method to generate a "Message-ID" using a
single randomly generated string combined with the hostname, replacing
the prior complex format that included process ID and multiple random
numbers. This change simplifies the code of the generated IDs.
2024-10-07 15:04:04 +02:00
b4197a136e
Enhance documentation for message methods
Expanded docstrings for methods in msg.go to provide detailed explanations, parameters, and return values. This improves clarity and helps developers understand usage and behavior more effectively.
2024-10-06 12:04:27 +02:00
01278ccb30
Document message methods
Added detailed comments to various methods in `msg.go` for clarity. Each method now includes a declaration, a detailed description, returned values, parameters, and relevant RFC references. This enhances code readability and maintainability.
2024-10-06 00:49:09 +02:00
eafb9cb17e
Add detailed parameter and return descriptions to msg.go
Enhanced function documentation by adding detailed descriptions of parameters and return values for various methods. This clarifies expected inputs and outputs, improving code readability and maintainability.
2024-10-06 00:25:15 +02:00
864c593208
Add parameters and references to method comments in msg.go
Enhanced method documentation by adding parameter descriptions and reference links. This improves the clarity and usability of the code, ensuring that users understand the purpose and usage of each method.
2024-10-05 20:29:33 +02:00
4890d9130b
Expand docstrings for MsgOption functions and methods.
This commit enhances the docstrings for the MsgOption functions and related methods in msg.go, providing extensive explanations, parameters, and references. It helps users understand the functionality, usage, and context of each function, improving code readability and usability.
2024-10-05 20:06:51 +02:00
b37f8995da
Update Msg documentation for clarity and RFC compliance
Enhanced the documentation for several Msg methods to provide clearer explanations and include relevant RFC references. This includes improved descriptions of functionality, parameter details, return values, and links to pertinent RFC sections.
2024-10-05 19:34:37 +02:00
c520925457
Enhance documentation for email address methods
Detailed doc comments have been added to various methods handling "From", "To", "CC", "BCC", and "Reply-To" email addresses within the Msg class. The new comments follow RFC 5322 standards and provide explicit descriptions of the functionality and validation rules for each method. This improves code readability and maintainability. Additionally, moved the `addAddr` function to a more appropriate position within the file.
2024-10-05 19:11:16 +02:00
3d5435c138
Update EnvelopeFromFormat documentation in msg.go
Expanded the documentation for the EnvelopeFromFormat method to clarify its purpose, usage, and compliance with RFC 5322. Added details on how the envelope from address is used in SMTP communication and validation requirements.
2024-10-05 13:59:24 +02:00
1dcdad9da1
Enhance address header methods with detailed documentation
Updated comments in `header.go` and `msg.go` to provide more detailed explanations and references to RFC 5322. This improves clarity on how headers are set and utilized, and the conditions under which they operate.
2024-10-05 13:56:47 +02:00
78e2857782
Update method comments to include additional context and RFC references
Enhanced the comments for various methods in `msg.go`, `client.go`, `auth.go`, and `encoding.go` to provide more detailed explanations, context, and relevant RFC references. This improves the clarity and maintainability of the code by providing developers with a deeper understanding of each method's purpose and usage.
2024-10-05 13:39:21 +02:00
c186cba2c2
Refactor MsgOption comments for clarity
Revised the comments for MsgOption functions to provide clearer explanations of their purpose and usage. Added detailed descriptions for options such as WithMIMEVersion and WithBoundary to clarify their contexts and constraints.
2024-10-05 12:48:09 +02:00
682f7a6ca5
Clarify Msg struct field comments
Updated comments for all fields in the Msg struct to provide clearer and more detailed explanations. This includes specifying the data type for each field and the role they play within the Msg struct, making the code easier to understand and maintain.
2024-10-05 12:35:15 +02:00
cd4c0194dc
Refactor comments for clarity and detail
Enhanced the descriptive comments for error variables, constants, and types to provide clearer and more detailed explanations. This improves code readability and ensures that the purpose and usage of different elements are better understood by developers.
2024-10-05 12:15:01 +02:00
theexiile1305
12edb2724b
feat: implementation of S/MIME signing without tests 2024-09-26 16:34:55 +02:00
77920be1a1
Remove unnecessary error handling
Eliminated redundant error handling for random number generation as errors from these functions do not require special attention. This reduces code complexity and improves readability.
2024-09-20 20:39:50 +02:00
69e211682c
Add GetMessageID method to Msg
Introduced GetMessageID to retrieve the Message ID from the Msg
2024-09-19 11:46:53 +02:00
theexiile1305
94942ed383
implementation of S/MIME singing without tests of type smime 2024-09-18 14:23:26 +02:00
theexiile1305
158c1b0458
moved S/MIME initialization into msg and the pointer to the data structure, also adjusted tests 2024-09-18 14:13:24 +02:00
theexiile1305
07d9654ce7
Attribute sMimeSinging was added in msg that indicates whether the message should be singed with S/MIME when it's sent. Also, sMimeAuthConfig was introduced in client so that required privateKey and certificate can be used for S/MIME signing. 2024-09-15 19:56:15 +02:00
590dfe97e7
Refactor error handling for nil template pointers
Replace fmt.Errorf with errors.New for consistency in error handling. This change ensures a more streamlined and uniform error reporting approach across the codebase. Also updated a test case from t.Errorf to t.Error for better readability.
2024-08-16 10:16:53 +02:00
Alexander Setzer
7caf0b8e19 Fix typo / inconsistency for (*Msg).SetAttachments 2024-08-14 14:55:08 +02:00
b88b67e2c7
Add GetBoundary method and corresponding test
The GetBoundary method has been added to the Msg struct in msg.go. Alongside this, a corresponding test method, TestMsg_GetBoundary, was introduced in msg_test.go to ensure the proper working of GetBoundary. This new method returns the boundary string of the Msg, which was previously inaccessible.
2024-07-02 10:58:13 +02:00
2e548512c6
Merge branch 'refs/heads/main' into feature/145_add-eml-parser-to-generate-msg-from-eml-files 2024-05-16 15:17:47 +02:00
19a3cf61ed
Refactor variable names for code readability
Updated variable names in multiple files to enhance code readability and maintainability by replacing abbreviations with full descriptive names. This ensures adherence to the best practices of naming conventions in Go.
2024-02-27 11:21:28 +01:00
c0cf31b6c4
Merge branch 'main' into feature/179_refactor-variable-names-for-readability 2024-02-26 20:57:37 +01:00
b2f735854d
Refactor variable names for readability in reader.go
Variable names in reader.go have been changed to be more expressive for improved readability. 'buf' and 'off' were renamed to 'buffer' and 'offset' respectively throughout the file. The changes also include corresponding adjustments in code comments and related test cases, contributing to consistent and understandable code.
2024-02-26 00:56:29 +01:00
c455b45a3e
Refactor variable and function names for improved clarity in msg.go
The change updates various variable and function names in msg.go to make the code more intuitive. Updated names better capture what they represent or do, improving code readability and maintainability. This refactor does not impact functionality or logic of the code.
2024-02-24 21:26:55 +01:00
4e880ab31c
Refactor variable and function names for improved clarity in msg.go
The change updates various variable and function names in msg.go to make the code more intuitive. Updated names better capture what they represent or do, improving code readability and maintainability. This refactor does not impact functionality or logic of the code.
2024-02-24 18:26:30 +01:00
263f6bb3de
Refactor SMTP client code for better readability
The variable names in the code related to the I/O of the SMTP client have been clarified for improved readability and comprehension. For example, unclear variable names like `d` and `w` have been replaced with more meaningful names like `depth` and `writer`. The same naming improvements have also been applied to function parameters. This update aims to enhance code maintenance and simplify future development processes.
2024-02-24 12:43:01 +01:00
grigorii
a24906d185 Add an option to skip adding a User-Agent 2024-02-23 14:41:58 -08:00
f759b1b5fb
Merge branch 'main' into feature/145_add-eml-parser-to-generate-msg-from-eml-files 2024-02-08 17:04:06 +01:00
a864be059c
Add "X-Auto-Response-Suppress" header and update SetBulk method
A new "X-Auto-Response-Suppress" header has been added. The SetBulk method has been updated to include this new header, as it is recommended for automated emails. This functionality is tested in the msg_test.go file.
2024-02-08 16:45:06 +01:00
bda6b8c899
Merge branch 'main' into feature/145_add-eml-parser-to-generate-msg-from-eml-files 2024-02-05 13:00:21 +01:00
ef86a1a1fb
Add Charset support for message parts
Charset support has been added in the 'Part' struct. A 'SetCharset' method and a 'WithPartCharset' option have been added to override the default Part charset. The 'writePart' function in msgWriter now accommodates the charset defined at the Part level, defaulting to the previous functionality if not set.
2024-01-31 16:28:41 +01:00
f7ba3a1d02
Merge branch 'main' into feature/145_add-eml-parser-to-generate-msg-from-eml-files 2024-01-25 11:21:38 +01:00
0b622368ba
#166: Add delivery status indication for messages
This update introduces a new property, `isDelivered`, in the message struct to track if a message has been successfully sent or not. Additionally, this also includes a new helper function `IsDelivered` to easily retrieve the status. This feature enhances the tracking capabilities of outgoing messages across different client files.
2024-01-23 11:01:08 +01:00
8b19e497a0
Merge branch 'main' into feature/145_add-eml-parser-to-generate-msg-from-eml-files 2024-01-10 11:07:54 +01:00
rami
bd6250a8c2 Added return error to fileFromReader 2023-12-24 17:04:55 +01:00
a12d9c327f
Merge branch 'main' into feature/145_add-eml-parser-to-generate-msg-from-eml-files 2023-12-07 13:21:30 +01:00
da21550dc9
Fix potential null pointer exceptions in msg.go
This commit adds conditions in msg.go file to check if the header 'HeaderDispositionNotificationTo' key exists in the map 'm.genHeader' before trying to associate it with a value. This prevents potential null pointer exceptions.
2023-11-29 17:26:58 +01:00
ca896bd641
Refactor error checking in msg.SendErrorIsTemp()
Added an additional condition in the SendErrorIsTemp function within msg.go to ensure that the error e is not nil before referencing it. This guards against potential runtime panics from dereferencing a nil pointer, enhancing robustness of error handling.
2023-11-29 16:45:25 +01:00
a50a3ceb18
Add validation for nil STDERR or STDIN pipe
Introduced a new condition that checks and returns an error if either STDERR or STDIN pipe is nil in the msg function of msg.go. This improves error handling by preventing potential panic due to referencing a nil pipe.
2023-11-29 16:43:50 +01:00
1a166770b7
Update range loop to improve msg function readability
Converted the range loop in the GetAddrHeaderString function in msg.go to use value semantics rather than index notation. This improves code clarity by not unnecessarily referring to m.addrHeader[h] in the loop and instead referencing the value directly (using variable mh), making it easier to understand and maintain.
2023-11-29 16:42:07 +01:00
468e1e2b2c
Protect against empty address list, refactor error handling
Added a condition to prevent assignment of an empty address list to the 'HeaderFrom' scenario. This eliminates potential runtime errors when trying to access an nonexistent element of a slice.
Adjusted error handling in the sendmail execution part by reusing the 'err' variable, promoting cleaner, more readable code.
2023-11-20 18:36:19 +01:00
1e447b5f2c
Merge branch 'main' into feature/145_add-eml-parser-to-generate-msg-from-eml-files 2023-11-10 18:23:52 +01:00