BoostryJP / ibet-Wallet-API

A powerful API suite for seamlessly building ibet blockchain wallet systems 🛠
https://ibet.jp/ibet-for-fin
Apache License 2.0
9 stars 0 forks source link

[FEATURE] Add SMTP policy option for mail text to ensure compliance with SMTP standards #1559

Closed kyken closed 4 weeks ago

kyken commented 1 month ago

Is your feature request related to a problem? Please describe.

When creating email messages, especially for SMTP transmission, there's no straightforward way to ensure that the mail text adheres to SMTP standards, particularly regarding line endings (CRLF) and line length limitations. This can lead to compatibility issues with certain email servers and clients.

Describe the solution you'd like

I propose adding an option to specify SMTP policy for mail text content. This feature would allow users to easily set the policy to SMTP when creating mail text, ensuring that:

  1. All line endings are automatically converted to CRLF (\r\n).
  2. Lines exceeding 78 characters are properly wrapped.
  3. Content-Transfer-Encoding is appropriately set (7bit or base64 when necessary).

Ideally, this could be implemented as a simple parameter when creating mail text, such as:

mail_text = create_mail_text("Hello World", policy="SMTP")

Describe alternatives you've considered

Currently, workarounds include manually replacing line endings and implementing custom line wrapping logic. However, these solutions are error-prone and don't fully address all SMTP requirements.

Additional context

This feature would be particularly beneficial for developers working on email automation systems or integrating email functionality into applications where SMTP compliance is crucial for reliable message delivery.

kyken commented 1 month ago

[memo] For v24.12 updates, set SMTP as the default