Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
vidyli
@vidyli
in the bove picture
but lettre give the error above.
paolobarbolini
@paolobarbolini:matrix.org
[m]
I replied on the issue
xiretza
@xiretza:xiretza.xyz
[m]
Alexis Mousset: hey, https://crates.io/crates/smtp is currently the top crates.io search result for smtp (duh), but it actually just seems to be a very old version of lettre. Could you maybe add a note to the crates.io page pointing potential users to lettre?
paolobarbolini
@paolobarbolini:matrix.org
[m]

🤔 my Matrix client didn't get the notification, fortunately Gitter notifies you by email every once in a while.

I think this is a good idea xiretza , I just searched "SMTP" on crates.io and lettre is on the second page Alexis Mousset. We should probably do a new release of the SMTP crate with both the description and readme telling to use lettre instead

Alexis Mousset
@amousset:matrix.org
[m]
Makes sense, I'll do this 👍️
amousset
@amousset:matrix.org
[m]
black man
@kofidoe__twitter
hey guys i'm new to lettre and i don't know which version to use. Can someone please help me out.
1 reply
kevincox
@kevincox:matrix.org
[m]
Heads up, it looks like the domain for the website is down:
% dig lettre.rs

; <<>> DiG 9.16.16 <<>> lettre.rs
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 28190
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;lettre.rs.            IN    A

;; Query time: 185 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Sep 30 07:14:19 EDT 2021
;; MSG SIZE  rcvd: 38
4 replies
kevincox
@kevincox:matrix.org
[m]
While I am here does anyone have code or guidance for DKIM signing with lettre? Or am I the first person to want to do this?
kevincox
@kevincox:matrix.org
[m]
I was pointed at lettre/lettre#670 🎉
1 reply
kevincox
@kevincox:matrix.org
[m]
I'm interested in the feature so I'll help where I can but I am only somewhat familiar with SMTP and lettre and not at all familiar with lettre internals so I'm sure I will miss somethings.
Mathijs van Veluw
@BlackDex
In theory that is actually something which needs to be done by the server sending out the messages to the final endpoint.
There is an open issue (lettre/lettre#674) which requests direct sending via MX lookups. In that case adding DKIM could be something useful. But other than that, it should be something done by the sending-server
kevincox
@kevincox:matrix.org
[m]

In that case adding DKIM could be something useful. But other than that, it should be something done by the sending-server

I disagree that DKIM should always be done by the sending-server. Right now getting a "clean" IP is very hard and it is very useful to pay someone for a trusted IP (and maybe some other sending features). However I would rather not trust them to be able to sign messages on be behalf.

For my currently use case I plan on migrating to signing in my app then sending to a relay mostly for their trusted IP.

Eventually I do plan on migrating to direct-sending but I don't have enough domain reputation or a trusted enough IP yet.

Mathijs van Veluw
@BlackDex
it kinda depends on if the sending IP is an IP used by domestic/home connections, because most of those are getting a high score anyway.
also, having dkim,spf and dmarc configured will not help if the IP is blacklisted
and, you must hope that the server which you use to send-out the mail isn't going to change the headers which you used to sign your mail. Because if it does, then your signing will fail
kevincox
@kevincox:matrix.org
[m]

That is true. It also depends on the receiving mailserver and what they do. Rumour has it that Google and other big inbox providers value domain reputation more however for smaller providers they likely have never seen your domain so basically have no choice but IP rep.

But this is mostly beside the point. The point is that I would rather not give a relay the ability to sign mail on my behalf. So signing is helpful even if you are using a relay.

Mathijs van Veluw
@BlackDex
that is true, but you still own the public key on the DNS, which you can change when it needs to of course.
I use postfix my self for sending out, so i have configured that for my applications
1 reply
kevincox
@kevincox:matrix.org
[m]
That is a mitigation at best. If I notice that they are sending email using my key then I can revoke the key, but that is not nearly as good as making sure they never have the ability in the first place.
Mathijs van Veluw
@BlackDex
i totally agree :)
kevincox
@kevincox:matrix.org
[m]
TL;DR I think both use cases are valid, but there is at least one use case for using a relay and still using DKIM signing.
Ludea
@ludea12:matrix.org
[m]
Hi, lettre is not not a smtp server ? I have to use a smtp relay ?
1 reply
Ludea
@ludea12:matrix.org
[m]
And there is no plan to create or add this feature ?
paolobarbolini
@paolobarbolini:matrix.org
[m]
It would most likely be implemented outside of lettre. See lettre/lettre#674 for more information
Ludea
@ludea12:matrix.org
[m]
Thanks for the link
Ludea
@ludea12:matrix.org
[m]
kevincox
@kevincox:matrix.org
[m]

FWIW I did manage to get letter to send by manually looking up MX records and generating a transport. It was fairly awkward because a lot of the building blocks require lots of allocation and try to have individual connection pools but it did work. I should try to summarize what I did on the bug.

One day I hope to implement this "properly" and see if I can implement the transport interface.

Arif Driessen
@arifd
Hi guys, I'm having trouble using async lettre. I want to write a function that returns a Future, that can be awaited inside of actix-web. I choose the example tokio1_smtp_tls.rs because it has tokio in it (which is what actix-web uses) and looks the simpler of the two. I make sure i have the same features enabled (["smtp-transport", "tokio1", "tokio1-native-tls", "builder"]) and the code looks happy on my end, but a cargo check reveals a ton of errors, the first one being:
error[E0412]: cannot find type `JoinHandle` in module `tokio1_crate::task`
   --> /home/arif/.cargo/registry/src/github.com-1ecc6299db9ec823/lettre-0.10.0-rc.4/src/executor.rs:108:39
    |
108 |     type Handle = tokio1_crate::task::JoinHandle<()>;
    |                                       ^^^^^^^^^^ not found in `tokio1_crate::task`
1 reply
many of them are bout the JoinHandle, then a couple of these at the end:
error: future cannot be sent between threads safely
  --> /home/arif/.cargo/registry/src/github.com-1ecc6299db9ec823/lettre-0.10.0-rc.4/src/transport/smtp/async_transport.rs:41:98
   |
41 |       async fn send_raw(&self, envelope: &Envelope, email: &[u8]) -> Result<Self::Ok, Self::Error> {
   |  __________________________________________________________________________________________________^
42 | |         let mut conn = self.inner.connection().await?;
43 | |
44 | |         let result = conn.send(envelope, email).await?;
...  |
49 | |         Ok(result)
50 | |     }
   | |_____^ future created by async block is not `Send`
7 replies
Any idea how to solve this? Thanks in advance!
kevincox
@kevincox:matrix.org
[m]

:point_up: Edit: FWIW I did manage to get lettre to send by manually looking up MX records and generating a transport. It was fairly awkward because a lot of the building blocks require lots of allocation and try to have individual connection pools but it did work. I should try to summarize what I did on the bug.

One day I hope to implement this "properly" and see if I can implement the transport interface.

Arif Driessen
@arifd
Hi guys, looking at how you do your integration tests... Looks like you just use builder_dangerous("127.0.0.1").port(2525). Does that imply that before you run your tests you start an email server on your local machine? Would be great if there was a rust crate i could use for this, so i could include it as a dev-dependency
1 reply
kevincox
@kevincox:matrix.org
[m]
Hi, I'm hoping to get lettre/lettre#670 landed and wanted to check in on the next steps. The PR definitely needs a bit of polish but before I put time into that I wanted to make sure that it will be accepted. I've been using the implementation for a month or so now to send signed mail so it definitely works at least in some configurations (some known bugs will be addressed, probably in followups) so I was hoping to get it merged in so that I can get back to upstream lettre and continue building on top of it.
paolobarbolini
@paolobarbolini:matrix.org
[m]
Sorry for the delay. We're definitely interested in merging it, although using it before all encoding issues are solved might not be a good idea. I'll try leaving a comment in the following days
kevincox
@kevincox:matrix.org
[m]

Ok. I think all of the encoding issues are resolved now. I am only aware of two outstanding issues.

  1. Simple header signing doesn't work because the DKIM signature header is wrapped differently after the signature value is inserted. This should be easy to fix by inserting a fake signature during formatting then truncating it to get the correct wrapping.
  2. I saw issues with multi-part bodies before. However I haven't tried that again so don't know if this still exists.

For both my preferred option would be to get the current code merged and then I will fix the bugs as follow ups. The PR is fairly large so I think this makes the most sense.

Cleanup I will do once we think the main code is correct:

  1. Add more full-message tests with hardcoded timestamps.
  2. Docstrings.
  3. Add an experimental warning for now.
Actually I think there is also a bug when the list of signed headers nears 78 chars due to bugs in lettre's header wrapping. But this isn't really a bug with the DKIM implementation. This could maybe be worked around by formatting the signed header list as h=To: From: Subject: instead of h=To:From:Subject.
1 reply
Good to see that resolved. Currently I am running on kevincox/lettre@ebc69f0 which solves the issue at least until 995 characters which is good enough for my use case. But good to see the proper solution landing.
paolobarbolini
@paolobarbolini:matrix.org
[m]
Yeah this time we're going to implement it the proper way. lettre 0.9 used the email crate, which is very old an unmaintained at this point, 0.10 initially used hyperx which is really meant for HTTP. In removing it I was hoping we could do away with a generic implementation but the last months of issues have demonstrated that we can't
kevincox
@kevincox:matrix.org
[m]
Yeah. Although there is really no perfect solution. SMTP is not the best protocol. For example if you want to include a List-Unsubscribe header of more than 995 characters you are out of luck, there is no legal way to encode that AFAIK. That being said most headers have enough breaking points that this isn't an issue.
paolobarbolini
@paolobarbolini:matrix.org
[m]
In a world where different providers start getting things together we may be able to get to play with JMAP 😃
kevincox
@kevincox:matrix.org
[m]
Does JAMP have goals of replacing the sending half as well? That would be nice.
1 reply
Darn. Plus replacing the reading half is much easier because you only need to support your users. To replace the MTA half you need to support every other MTA in the world. (...or more likely support SMTP fallback forever)
soulflyman
@soulflyman:matrix.org
[m]

Hi everyone, has someone managed to send a mail with lettre via smtp.office365.com? I can't get it working and get an timeout after 30 seconds.

ERROR: Could not send email: Err(Io(Os { code: 10060, kind: TimedOut, message: "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond." }))

1 reply
kevincox
@kevincox:matrix.org
[m]
What port are you using? If it is port 25 it is commonly blocked.
soulflyman
@soulflyman:matrix.org
[m]
port is 587
where can i find SmtpTransport::starttls_relay? I can't find it in the doc
1 reply