Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Weird trouble with email and accentued subjects  (Read 4404 times)

0 Members and 1 Guest are viewing this topic.

CrazyCat

  • Anope User
  • Offline Offline
  • Posts: 258
    • Réseau IRC francophone
Weird trouble with email and accentued subjects
« on: June 23, 2024, 03:51:29 PM »

Hello,

I've tried to translate in french emails sent by anope and noticed that when the subject contains accentued chars, I got (from dest server) "SMTPUTF8 is required, but was not offered by host" when mail is sent.
But when the subject doesn't contains them and the body yes, it works like a charm.

I did a test, creating a file and using sendmail -t < myfile.txt, it works.

So I think there is a little trouble somewhere between https://github.com/anope/anope/blob/81056072576994e6f4c7ed6133bd42440b10face/src/config.cpp#L188 and https://github.com/anope/anope/blob/81056072576994e6f4c7ed6133bd42440b10face/src/mail.cpp#L16 which transform the subject (my tests were with memo_subject) in an improper utf-8 string

Sadie

  • Team
  • *
  • Offline Offline
  • Posts: 12
Re: Weird trouble with email and accentued subjects
« Reply #1 on: June 23, 2024, 09:10:25 PM »

We're applying a UTF-8 header to the emails so they *should* be sent properly.

Are you sure you're using UTF-8 for your emails not an older encoding like ISO-8859-1?

What email provider are you using? Also, what sendmail client are you using?
Logged

CrazyCat

  • Anope User
  • Offline Offline
  • Posts: 258
    • Réseau IRC francophone
Re: Weird trouble with email and accentued subjects
« Reply #2 on: June 23, 2024, 11:07:56 PM »

My services.conf is utf-8, I use postfix (on localhost) with mailutils to get the sendmail.
Here is my myfile.txt (utf-8 / CRLF)
Quote
From: admin@zeolia.chat
To: crazycat@testing.com
Subject: Nouveau mémo
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bonjour,

Merci de valider la réception de ce message.
Normalement ça le fait
.
Works using /usr/sbin/sendmail -t < myfile.txt

If I use Nouveau mémo in memo_subject (services.conf) I got the error. But If I use Nouveau memo (without accent) I don't have any trouble.
Not that having accentued chars in the body doesn't break the process.

I'll try making more tests (apply iconv to my .conf ?) but the only difference I actually can see is that the mail subjects are treated in another way than the bodies.

CrazyCat

  • Anope User
  • Offline Offline
  • Posts: 258
    • Réseau IRC francophone
Re: Weird trouble with email and accentued subjects
« Reply #3 on: June 24, 2024, 12:25:23 PM »

Small edit:
Code: [Select]
crazycat@server:~/services/conf$ file -bi services.conf
text/x-c; charset=utf-8

PeGaSuS

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 34
  • What goes around, comes around.
    • PTirc
Re: Weird trouble with email and accentued subjects
« Reply #4 on: June 24, 2024, 12:58:22 PM »

Hi!

So far, I had zero issues with msmtp and accented emails.

My resetpass email has as subject the following:
Code: [Select]
reset_subject = "Reposição de palavra-passe | Password reset request"
The command file -bi anope.conf states:
Code: [Select]
text/x-c; charset=utf-8
The only thing I'm doing different (I think) with msmtp is that I'm sending the email through my mail server which is located on another machine (powered by postfix, though), basically acting as a relay but you can also install the msmtp-mta if you want/need.

Here's an example of how my .msmtprc looks like:
Code: [Select]
# Set default values for all following accounts.
defaults
auth           on
tls            on
#tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        ~/.msmtp.log

# EXAMPLE
account        example
host           mail.domain.tld
port           465
tls_starttls   off
from           "Example User <example@domain.tld>"
user           example@domain.tld
password       example_password

account default: example

I've also attached a screenshot that shows that accents are received properly (the code received is already invalidated).

NOTE: All configs are from an Ubuntu powered system.
« Last Edit: June 24, 2024, 01:02:30 PM by PeGaSuS »
Logged
IRC network: PTirc | Help and support: irc.anope.org - #anope

CrazyCat

  • Anope User
  • Offline Offline
  • Posts: 258
    • Réseau IRC francophone
Re: Weird trouble with email and accentued subjects
« Reply #5 on: June 24, 2024, 04:16:20 PM »

Well, my postfix works fine, it's the receiver which seems to dislike my email when subject has accentued chars.
I'll have a deeper look in postfix (sendmail is just the mailutils tool to enable sendmail with postfix)

EDIT
I tried adding smtputf8_enable = yes in postfix (works) but the dest servers hates me:
Quote
2024-06-24T17:36:31.289265+02:00 myserver postfix/smtp[1588328]: C96862AC1C5B: to=<user@domain.com>, relay=mx1.mail.ovh.net[188.165.36.237]:25, delay=6.5, delays=0.46/0.31/5.8/0, dsn=5.6.7, status=bounced (SMTPUTF8 is required, but was not offered by host mx1.mail.ovh.net[188.165.36.237])

Seems like ovh dislikes utf8
« Last Edit: June 24, 2024, 04:42:12 PM by CrazyCat »
Logged

CrazyCat

  • Anope User
  • Offline Offline
  • Posts: 258
    • Réseau IRC francophone
Re: Weird trouble with email and accentued subjects
« Reply #6 on: June 24, 2024, 05:35:00 PM »

Ok, the solution was smtputf8_enable = no in my postfix.

Thanks @PeGaSuS and @Sadie, you gave me new search ideas :)
Pages: [1]   Go Up