~witcher/rss-email#29: 
Connection error: Connection error: received corrupt message

My config is basically this:

[mail]
from = "Hugo Osvaldo Barrera <hugo@whynothugo.nl>"
# None of these worked either:
# to = "~whynothugo/journal@lists.sr.ht"
# to = "List <~whynothugo/journal@lists.sr.ht>"
# to = "u.whynothugo.journal@lists.sr.ht"
to = "List <u.whynothugo.journal@lists.sr.ht>"

[smtp]
user = "hi@fastmail.com"
password = "lol"
server = "mail.messagingengine.com."
port = 587

And I'm getting this as output:

2023-03-05T21:52:55.621Z ERROR [rss_email] An error occured while sending an email: Connection error: Connection error: received corrupt message
2023-03-05T21:52:55.626Z ERROR [rss_email] An error occured while sending an email: Connection error: Connection error: received corrupt message
2023-03-05T21:52:55.786Z ERROR [rss_email] An error occured while sending an email: Connection error: Connection error: received corrupt message
2023-03-05T21:52:55.789Z ERROR [rss_email] An error occured while sending an email: Connection error: Connection error: received corrupt message
2023-03-05T21:52:55.790Z ERROR [rss_email] An error occured while sending an email: Connection error: Connection error: received corrupt message
2023-03-05T21:52:55.798Z ERROR [rss_email] An error occured while sending an email: Connection error: Connection error: received corrupt message

Any ideas what might be up?

Status
RESOLVED CLOSED
Submitter
~whynothugo
Assigned to
No-one
Submitted
1 year, 1 month ago
Updated
a month ago
Labels
No labels applied.

~witcher 1 year, 1 month ago

No idea from just looking at the output. Are you on the latest commit on main? If not, error messages should be better there so hopefully you can tell what went wrong.

In hindsight I'm not very happy with the fact that rss-email is actually sending email by itself at all. I probably should have delegated this to something like sendmail through stdout instead to avoid errors like that... Maybe I'll do that in the future

~whynothugo 1 year, 1 month ago

Both latest stable and main yield the same error (I think the formatting is different, but same underlying issue).

I probably should have delegated this to something like sendmail through stdout instead to avoid errors like that

My gripe with sendmail is that it doesn't really work on modern systems (e.g.: my desktop computer). I can't run an SMTP that relays emails directly, because most ISPs block port 25. So I could configure an SMTP that relays via my mail provider's SMTP and send the email using my credentials -- but because the SMTP is system-wide, this enables any process from any user on my system to send emails from my personal account.

I wish there were a modern sendmail replacement which relayed via my personal email account but ran as a user-service rather than a system-service.

~whynothugo 1 year, 1 month ago

I added a dbg!(&email) in send_email and the message seems to be sane:

[src/mail.rs:47] &email = Message {
    headers: Headers {
        headers: [
            HeaderValue {
                name: HeaderName(
                    "From",
                ),
                raw_value: "Hugo Osvaldo Barrera <hugo@whynothugo.nl>",
                encoded_value: "\"Hugo Osvaldo Barrera\" <hugo@whynothugo.nl>",
            },
            HeaderValue {
                name: HeaderName(
                    "To",
                ),
                raw_value: "List <u.whynothugo.journal@lists.sr.ht>",
                encoded_value: "List <u.whynothugo.journal@lists.sr.ht>",
            },
            HeaderValue {
                name: HeaderName(
                    "Subject",
                ),
                raw_value: "In praise of Alpine and apk",
                encoded_value: "In praise of Alpine and apk",
            },
            HeaderValue {
                name: HeaderName(
                    "Content-Transfer-Encoding",
                ),
                raw_value: "quoted-printable",
                encoded_value: "quoted-printable",
            },
            HeaderValue {
                name: HeaderName(
                    "Date",
                ),
                raw_value: "Mon, 06 Mar 2023 09:28:44 +0000",
                encoded_value: "Mon, 06 Mar 2023 09:28:44 +0000",
            },
        ],
    },
    body: Raw(
        [
            104,
            116,
            116,
            112,
            115,
            58,
            47,
            47,
            119,
            104,
            121,
            110,
            111,
            116,
            104,
            117,
            103,
            111,
            46,
            110,
            108,
            47,
            106,
            111,
            117,
            114,
            110,
            97,
            108,
            47,
            50,
            48,
            50,
            51,
            47,
            48,
            50,
            47,
            49,
            56,
            47,
            105,
            110,
            45,
            112,
            114,
            97,
            105,
            115,
            101,
            45,
            111,
            102,
            45,
            97,
            108,
            112,
            105,
            110,
            101,
            45,
            97,
            110,
            100,
            45,
            97,
            112,
            107,
            47,
            13,
            10,
            13,
            10,
            83,
            105,
            110,
            99,
            101,
            32,
            116,
            104,
            101,
            32,
            99,
            104,
            97,
            110,
            103,
            101,
            32,
            111,
            102,
            32,
            121,
            101,
            97,
            114,
            44,
            32,
            73,
            38,
            114,
            115,
            113,
            117,
            111,
            59,
            118,
            101,
            32,
            98,
            101,
            101,
            110,
            32,
            117,
            115,
            105,
            110,
            103,
            32,
            65,
            108,
            112,
            105,
            110,
            101,
            32,
            76,
            105,
            110,
            117,
            120,
            32,
            111,
            110,
            32,
            109,
            121,
            32,
            109,
            97,
            105,
            110,
            32,
            99,
            111,
            109,
            61,
            13,
            10,
            112,
            117,
            116,
            105,
            110,
            103,
            32,
            100,
            101,
            118,
            105,
            99,
            101,
            32,
            40,
            97,
            32,
            110,
            101,
            119,
            32,
            100,
            101,
            115,
            107,
            116,
            111,
            112,
            32,
            80,
            67,
            32,
            116,
            104,
            97,
            116,
            32,
            73,
            32,
            97,
            115,
            115,
            101,
            109,
            98,
            108,
            101,
            100,
            32,
            105,
            110,
            32,
            68,
            101,
            99,
            101,
            109,
            98,
            101,
            114,
            41,
            46,
            32,
            84,
            104,
            101,
            115,
            101,
            32,
            97,
            114,
            101,
            32,
            115,
            111,
            61,
            13,
            10,
            109,
            101,
            32,
            110,
            111,
            116,
            101,
            115,
            32,
            111,
            110,
            32,
            105,
            110,
            44,
            32,
            115,
            111,
            109,
            101,
            32,
            110,
            105,
            99,
            101,
            116,
            105,
            101,
            115,
            32,
            97,
            110,
            100,
            32,
            99,
            97,
            118,
            101,
            97,
            116,
            115,
            46,
            13,
            10,
            73,
            32,
            117,
            115,
            101,
            100,
            32,
            65,
            114,
            99,
            104,
            76,
            105,
            110,
            117,
            120,
            32,
            102,
            111,
            114,
            32,
            111,
            118,
            101,
            114,
            32,
            97,
            32,
            100,
            101,
            99,
            97,
            100,
            101,
            32,
            98,
            101,
            102,
            111,
            114,
            101,
            44,
            32,
            115,
            111,
            32,
            107,
            101,
            101,
            112,
            32,
            105,
            110,
            32,
            109,
            105,
            110,
            100,
            32,
            116,
            104,
            97,
            116,
            32,
            109,
            121,
            32,
            109,
            97,
            105,
            110,
            32,
            112,
            111,
            105,
            61,
            13,
            10,
            110,
            116,
            32,
            111,
            102,
            32,
            114,
            101,
            102,
            101,
            114,
            101,
            110,
            99,
            101,
            47,
            98,
            97,
            99,
            107,
            103,
            114,
            111,
            117,
            110,
            100,
            32,
            105,
            115,
            32,
            117,
            115,
            105,
            110,
            103,
            32,
            65,
            114,
            99,
            104,
            43,
            112,
            97,
            99,
            109,
            97,
            110,
            46,
            32,
            72,
            111,
            119,
            101,
            118,
            101,
            114,
            44,
            32,
            116,
            104,
            105,
            115,
            32,
            105,
            115,
            32,
            110,
            111,
            116,
            32,
            97,
            110,
            32,
            38,
            108,
            61,
            13,
            10,
            100,
            113,
            117,
            111,
            59,
            65,
            114,
            99,
            104,
            32,
            118,
            115,
            32,
            65,
            108,
            112,
            105,
            110,
            101,
            38,
            114,
            100,
            113,
            117,
            111,
            59,
            32,
            97,
            114,
            116,
            105,
            99,
            108,
            101,
            46,
            13,
            10,
            77,
            121,
            32,
            119,
            111,
            101,
            115,
            32,
            119,
            105,
            116,
            104,
            32,
            112,
            97,
            99,
            107,
            97,
            103,
            101,
            32,
            109,
            97,
            110,
            97,
            103,
            101,
            109,
            101,
            110,
            116,
            32,
            79,
            118,
            101,
            114,
            32,
            116,
            104,
            101,
            32,
            121,
            101,
            97,
            114,
            115,
            44,
            32,
            73,
            38,
            114,
            115,
            113,
            117,
            111,
            59,
            118,
            101,
            32,
            101,
            120,
            112,
            101,
            114,
            105,
            109,
            101,
            110,
            116,
            101,
            100,
            32,
            119,
            105,
            116,
            61,
            13,
            10,
            104,
            32,
            109,
            97,
            110,
            121,
            32,
            119,
            97,
            121,
            115,
            32,
            111,
            102,
            32,
            38,
            108,
            100,
            113,
            117,
            111,
            59,
            107,
            101,
            101,
            112,
            105,
            110,
            103,
            32,
            97,
            32,
            108,
            105,
            115,
            116,
            32,
            111,
            102,
            32,
            116,
            104,
            101,
            32,
            108,
            105,
            115,
            116,
            32,
            111,
            102,
            32,
            112,
            97,
            99,
            107,
            97,
            103,
            101,
            115,
            32,
            105,
            110,
            115,
            116,
            97,
            108,
            108,
            101,
            100,
            38,
            114,
            100,
            113,
            117,
            61,
            13,
            10,
            111,
            59,
            46,
        ],
    ),
    envelope: Envelope {
        forward_path: [
            Address {
                serialized: "u.whynothugo.journal@lists.sr.ht",
                at_start: 20,
            },
        ],
        reverse_path: Some(
            Address {
                serialized: "hugo@whynothugo.nl",
                at_start: 4,
            },
        ),
    },
}

Do you think this is worth reporting upstream? The feed in question is:

https://whynothugo.nl/posts.xml

Does it work for you?

~witcher 1 year, 1 month ago*

I wish there were a modern sendmail replacement which relayed via my personal email account but ran as a user-service rather than a system-service. What about msmtp? It has a sendmail mode, that might work for you.

That is indeed odd, I also don't see anything wrong with the email. I tried sending the same exact post about Alpine fetched from the same feed to me and that worked fine, I never had issues with your blog and rss-email.

I'm guessing opening a ticket upstream might yield more information. Sorry I can't help more! Feel free to link to the upstream ticket here, and good luck.

~witcher a month ago

After now stumlbing upon this exact same issue myself using STARTTLS on port 587 I think I know what the problem is: STARTTLS was never enabled and was never an option in rss-email! I had this planned as a feature in the future because I never needed it but never got around to it until now.

I'll push a commit soon, but I fixed this on my end by introducing a configuration setting and command line flag for using STARTTLS.

This also merits a new release along with the other changes since the last one, so I'll release a new version of this after adjusting some things in the code.

~whynothugo a month ago

The issue is not reproduced when using SMTPs, so that makes sense. It guess the obscure error message is still an upstream bug.

Thanks for figuring this out.

~witcher REPORTED CLOSED a month ago

Thomas Böhler referenced this ticket in commit 517f0f6.

Register here or Log in to comment, or comment via email.