Skip to content

bsmtp: add fixes to be more rfc compliant#1795

Merged
BareosBot merged 5 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/bsmtp-fix-partially-rfc2045
May 17, 2024
Merged

bsmtp: add fixes to be more rfc compliant#1795
BareosBot merged 5 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/bsmtp-fix-partially-rfc2045

Conversation

@bruno-at-bareos
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos commented Apr 29, 2024

  • add mime version
  • add content type and charset
  • add content transport encoding
  • right trim subject

those fixes should help bsmtp to lower spam score
avoid using utf-8 subject, it's rfc2047 encoding not being implemented.

  • add a new HOWTO in the documentation, to explain how to use mailx command instead bsmtp.

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

@bruno-at-bareos bruno-at-bareos added this to the 24.0.0 milestone Apr 29, 2024
@bruno-at-bareos bruno-at-bareos marked this pull request as draft April 30, 2024 09:55
@bruno-at-bareos bruno-at-bareos self-assigned this Apr 30, 2024
@bruno-at-bareos
Copy link
Contributor Author

bruno-at-bareos commented Apr 30, 2024

Still to be done:

  • add mailx usage documentation in howto
  • test bareos daemon is using /var/lib//.mailrc: yes as it is directly doing the smtp part (no need to setup a local MTA)
  • Ensure the use of utf-8 and 8bit encoding when needed
  • we can't set LC and LANG in message command.
       Message delivery ERROR: Mail program terminated in error.
       CMD=LC_CTYPE=en_US.UTF-8;LANG=en_US.UTF-8;//usr/bin/mailx -s "Bareos: catalog Backup OK of bareos-fd Full" bareos@locahost.localdomain
       ERR=No such file or directory
    
    So only setting Environment in bareos-dir.service may help.
  • In case of delivery error mails are kept into working dir in var/lib/bareos/dead.letter file, so easy to check and monitor
  • mailx used for WriteBootstrap does not return error even if mail are not delivered. (can be either in pipe mode) or in runscript after action). Compared to bstmp usage in pipe mode with WriteBootStrap, the job will not failed!
    You may be warned in joblog when you use RunScript, But WriteBootStrap will silently failed.
    2024-04-30 16:29:23 bareos-dir JobId 16113: shell command: run AfterJob "/usr/bin/mailx -s "Bareos: bootstrap for Job catalog.2024-04-30_16.28.40_24" -a /var/lib/bareos/storage/bsr/bareos-fd.catalog.bsr bareos@localhost.localdomain"
    2024-04-30 16:29:30 bareos-dir JobId 16113: AfterJob: smtp-server: 535 5.7.8 Error: authentication failed: (reason unavailable)
    2024-04-30 16:29:30 bareos-dir JobId 16113: AfterJob: . . . message not sent.
    

@bruno-at-bareos bruno-at-bareos marked this pull request as ready for review May 2, 2024 13:30
@bruno-at-bareos bruno-at-bareos requested a review from sduehr May 7, 2024 09:38
@bruno-at-bareos
Copy link
Contributor Author

Recommendation tested by customer and mailx replacement got good result in terms of scoring. bstmp changes are also welcomed.

Copy link
Member

@sduehr sduehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good so far, some typos to be fixed.

@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/bsmtp-fix-partially-rfc2045 branch from cb567a3 to 1a75d8f Compare May 14, 2024 07:19
@bruno-at-bareos
Copy link
Contributor Author

Thanks a lot for the review, and nice rewording.

@bruno-at-bareos bruno-at-bareos requested a review from sduehr May 14, 2024 07:20
Copy link
Member

@sduehr sduehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good now.

bruno-at-bareos and others added 5 commits May 17, 2024 07:29
- add mime version
- add content type and charset
- add content transport encoding
- right trim subject

those fixes should help bsmtp to lower spam score
avoid using utf-8 subject, it's rfc2047 encoding not being
implemented.

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
add new how-to use heimdal mailx command instead bsmtp with
configuration examples.

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
Co-authored-by: sduehr <stephan.duehr@bareos.com>
Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
@BareosBot BareosBot force-pushed the dev/bruno/master/bsmtp-fix-partially-rfc2045 branch from 00d8b2d to fc7ad73 Compare May 17, 2024 07:29
@BareosBot BareosBot merged commit 966375e into bareos:master May 17, 2024
@bruno-at-bareos bruno-at-bareos deleted the dev/bruno/master/bsmtp-fix-partially-rfc2045 branch November 25, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants