Bug 153277 - Mail Merge: UnicodeEncodeError for Domains with Umlaut
Summary: Mail Merge: UnicodeEncodeError for Domains with Umlaut
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2023-01-30 10:27 UTC by Axel Braun
Modified: 2023-02-01 20:40 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Braun 2023-01-30 10:27:02 UTC
Umlauts in Domains (like Düsseldorf instead of Duesseldorf) are permited since a couple of years.
When sending a mail to one of those domains using mailmerge, LO dumps:

<class 'UnicodeEncodeError'>: 'ascii' codec can't encode character '\xfc' in position 20: ordinal not in range(128), traceback follows
  File "/usr/lib64/libreoffice/program/mailmerge.py", line 262, in sendMailMessage
    self.server.sendmail(sendermail, truerecipients, msg.as_string())
  File "/usr/lib64/python3.10/smtplib.py", line 892, in sendmail
    (code, resp) = self.rcpt(each, rcpt_options)
  File "/usr/lib64/python3.10/smtplib.py", line 553, in rcpt
    self.putcmd("rcpt", "TO:%s%s" % (quoteaddr(recip), optionlist))
  File "/usr/lib64/python3.10/smtplib.py", line 378, in putcmd
    self.send(f'{s}{CRLF}')
  File "/usr/lib64/python3.10/smtplib.py", line 357, in send
    s = s.encode(self.command_encoding)
Comment 1 Stéphane Guillou (stragu) 2023-02-01 13:39:00 UTC
Thank you, Axel.

I can reproduce with:

Version: 7.4.5.1 / LibreOffice Community
Build ID: 9c0871452b3918c1019dde9bfac75448afc4b57f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

I also get the "Emails could not be sent" error dialog with:

<class 'UnicodeEncodeError'>: 'ascii' codec can't encode character '\xfc' in position 22: ordinal not in range(128), traceback follows
  File "/opt/libreoffice7.4/program/mailmerge.py", line 262, in sendMailMessage
    self.server.sendmail(sendermail, truerecipients, msg.as_string())
  File "/opt/libreoffice7.4/program/python-core-3.8.16/lib/smtplib.py", line 890, in sendmail
    (code, resp) = self.rcpt(each, rcpt_options)
  File "/opt/libreoffice7.4/program/python-core-3.8.16/lib/smtplib.py", line 551, in rcpt
    self.putcmd("rcpt", "TO:%s%s" % (quoteaddr(recip), optionlist))
  File "/opt/libreoffice7.4/program/python-core-3.8.16/lib/smtplib.py", line 376, in putcmd
    self.send(f'{s}{CRLF}')
  File "/opt/libreoffice7.4/program/python-core-3.8.16/lib/smtplib.py", line 355, in send
    s = s.encode(self.command_encoding)

Example of host allowing umlauts in domain names: https://www.ionos.com/help/domains/glossary-important-terms-and-topics-explained/umlaut-domains/