MVP Requirement: E-mail Functionality
This is item 1, in the Hackers Guide to Aardwolf
Ideally, Aardwolf will be able to send SMTP messages without having to resort to an external mailer daemon (Postfix, Sendmail, Etc). There are several libraries on Crates.io, such as Mailstrom, and Lettre, that should be able to provide this functionality. E-mails received should include the full URL in both clickable, and plain text (copy/paste) format. Using a basic template for formatting would be ideal, but is not required for the minimum viable alpha release.
Current State Currently when a user creates an account, the auth_token is generated, and sent to STDOUT. This means that someone has to log into the server occasionally, and manually copy/paste the auth_token URL's in order to authorize new accounts.
-- Do we want SMTP functionality to be "outbound only".
-- Is there a reason why we might need to receive e-mails?
So, none of the crates I've looked at so far fit the bill. Lettre uses either sendmail, or connects to an SMTP relay server, in the same way that your email client does to send mail. By extension, Mailstrom is out too, as it uses Lettre.
What we need is a crate that will act as the relay server for itself, like sendmail does. I haven't had any luck in finding such a crate, especially any that are reliably maintained. We're going to have to roll our own.
I'll get started on this and update with a link to my repository once it's created.
Balls.... My experience with trying to get a mail server (Sendmail, Exim4, or ANYTHING) to function to send mail for the forum was a tremendous pain in the butt. I will start looking for a rust-based mail-server, but yeah... rolling one seems like the premium solution.
Nah, we don't need a server. We just need write a crate that when we call it, does the DNS lookup, connects to the receiving SMTP server, and hands it the message, rather than relying on Sendmail or a Relay server to do that.
So... a light-weight MTA?
Yeah. That's what sendmail is. But like you said, we don't want to depend on an external program that only exists on one platform family.
I would argue that Sendmail is NOT a "lightweight" MTA considering how difficult it can be to configure, but I get your point that it functions as an MTA ;)
@KD0BPV Mailstrom can do the DNS resolution for servers on it's own. I'm pretty sure it doesn't need to connect to an SMTP server to function.
Some pure Rust options are emerging: tokio_smtp and samotop crates both seem worth a look. Both use tokio under the hood for asynchronous handling, which makes sense since the email sending should be done in a non-blocking way.
As to the receiving emails/outbound only question, outbound only is the way to go for transactional emails such as these – emails generated via the system automatically when triggered by user actions such as signup. They are outgoing by definition.
@rayrrr -- Cool! Thanks for the input :)
@BanjoFox you're welcome! I'd be happy to give this a try. Still learning though. samotop would be my first choice.
Nothing wrong with learning :) Feel free to experiment, and ask questions at your leisure. I feel like @asonix has brought up tokio more than a few times on the Matrix chat. On Sat, Jul 27, 2019, 20:17 Ray [email protected] wrote:
@BanjoFox https://github.com/BanjoFox you're welcome! I'd be happy to give this a try. Still learning though. samotop would be my first choice.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Aardwolf-Social/aardwolf/issues/87?email_source=notifications&email_token=ABCA2JGEAABDZ42NIESQNB3QBTQSNA5CNFSM4EPBL4U2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26U26I#issuecomment-515722617, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCA2JDCGQ7C44Z2FAWANGTQBTQSNANCNFSM4EPBL4UQ .