Templated SMTP Output: Enforce SMTPUTF8 policy by Psych0meter · Pull Request #2546 · certtools/intelmq

I now tested sending an e-mail with a recipient-address containing a non-ASCII character (user+à@example.com) to a server not supporting SMTPUTF8 (postfix-2.11.3) and I got:

Traceback (most recent call last):
  File "/usr/lib64/python3.11/smtplib.py", line 969, in send_message
    ''.join([from_addr, *to_addrs]).encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character '\xe0' in position 46: ordinal not in range(128)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/intelmqctl", line 33, in <module>
    sys.exit(load_entry_point('intelmq', 'console_scripts', 'intelmqctl')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastianw/dev/intelmq/intelmq/bin/intelmqctl.py", line 1302, in main
    return x.run()
           ^^^^^^^
  File "/home/sebastianw/dev/intelmq/intelmq/bin/intelmqctl.py", line 430, in run
    retval, results = args.func(**args_dict)
                      ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastianw/dev/intelmq/intelmq/bin/intelmqctl.py", line 441, in bot_run
    retval, results = self._processmanager.bot_run(**kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastianw/dev/intelmq/intelmq/lib/processmanager.py", line 132, in bot_run
    output = bd.run()
             ^^^^^^^^
  File "/home/sebastianw/dev/intelmq/intelmq/lib/bot_debugger.py", line 82, in run
    self._process(self.dryrun, self.msg, self.show)
  File "/home/sebastianw/dev/intelmq/intelmq/lib/bot_debugger.py", line 166, in _process
    self.instance.process()
  File "/home/sebastianw/dev/intelmq/intelmq/bots/outputs/templated_smtp/output.py", line 212, in process
    smtp.send_message(msg, from_addr=msg['From'],
  File "/usr/lib64/python3.11/smtplib.py", line 972, in send_message
    raise SMTPNotSupportedError(
smtplib.SMTPNotSupportedError: One or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capability

But the result is the same, independent of using policy.SMTPUTF8 or not.

So the issue is not the subject but the sender/recipient address and that your server doesn't support SMTPUTF8 and therefore requires a conversion for compatibility.