Skip to content

Commit 4b7c49f

Browse files
committed
Fix mail send coding.
1 parent 07ef885 commit 4b7c49f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Changelog
55
1.0.6 (unreleased)
66
------------------
77

8-
- Nothing changed yet.
8+
- Fix mail send coding.
9+
[cekk]
910

1011

1112
1.0.5 (2026-01-07)

src/redturtle/rsync/adapters/adapter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,13 @@ def send_log(self):
206206
mfrom = formataddr((email_from_name, email_from_address))
207207

208208
msg = EmailMessage()
209-
msg.set_content(body)
209+
msg.set_content(body, charset="utf-8")
210+
msg.add_alternative(body, subtype="html", charset="utf-8")
211+
210212
msg["Subject"] = self.log_item_title(start=self.start)
211213
msg["From"] = mfrom
212214
msg["Reply-To"] = mfrom
213215
msg["To"] = send_to_email
214-
msg.replace_header("Content-Type", 'text/html; charset="utf-8"')
215216

216217
mailhost.send(msg, charset=encoding)
217218

src/redturtle/rsync/scripts/rsync.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ def rsync(self):
8484
self.adapter.setup_environment()
8585
data = self.adapter.get_data()
8686

87-
intermediate_commit = int(getattr(self.options, "intermediate_commit", 0))
87+
intermediate_commit = getattr(self.options, "intermediate_commit", 0) or 0
88+
89+
intermediate_commit = int(intermediate_commit)
8890

8991
if data:
9092
n_items = len(data)

0 commit comments

Comments
 (0)