mail sent over test working fully now
Some checks failed
CI / Check Style (push) Has been cancelled
CI / Run Clippy (push) Has been cancelled
CI / Run Tests (push) Has been cancelled

This commit is contained in:
Priec
2026-06-19 10:50:48 +02:00
parent ebb208baba
commit 11762728c9
3 changed files with 19 additions and 4 deletions

View File

@@ -67,7 +67,9 @@ mailer:
# OAuth2 handshake, they just need the store to construct successfully.
initializers:
oauth2:
secret_key: 0123456789012345678901234567890123456789012345678901234567890123
# Private-cookie key: a ", "-separated list of >=64 byte values (not a
# plain string). This is loco-oauth2's documented sample key; fine for tests.
secret_key: "144, 76, 183, 1, 15, 184, 233, 174, 214, 251, 190, 186, 122, 61, 74, 84, 225, 110, 189, 115, 10, 251, 133, 128, 52, 46, 15, 66, 85, 1, 245, 73, 27, 113, 189, 15, 209, 205, 61, 100, 73, 31, 18, 58, 235, 105, 141, 36, 70, 92, 231, 151, 27, 32, 243, 117, 30, 244, 110, 89, 233, 196, 137, 130"
authorization_code:
- client_identifier: google
client_credentials:

View File

@@ -13,7 +13,17 @@ static set_password: Dir<'_> = include_dir!("src/mailers/auth/set_password");
#[allow(clippy::module_name_repetitions)]
pub struct AuthMailer {}
impl Mailer for AuthMailer {}
impl Mailer for AuthMailer {
/// Override the framework default (`System <system@example.com>`), which any
/// real MX rejects (`example.com` is nullMX). Must be a sender the SMTP
/// account is allowed to send as.
fn opts() -> mailer::MailerOpts {
mailer::MailerOpts {
from: "Kompress <info@kompress.sk>".to_string(),
..Default::default()
}
}
}
impl AuthMailer {
/// Sending welcome email the the given user
///

View File

@@ -28,13 +28,16 @@ use serial_test::serial;
// Non-secret production SMTP settings (mirror `.env`). The password is
// intentionally NOT here: it is supplied at runtime via `SMTP_PASSWORD`
// (direnv -> `pass`), and never committed.
const SMTP_HOST: &str = "smtp.kompress.sk";
// Dial the name the TLS cert is actually valid for. `smtp.kompress.sk` is a
// DNS alias for the same server (213.215.124.101) but the cert only lists
// smtp.euronet.sk, so connecting via the alias fails certificate validation.
const SMTP_HOST: &str = "smtp.euronet.sk";
const SMTP_PORT: &str = "587";
const SMTP_USER: &str = "kompres";
const SMTP_SECURE: &str = "true";
// Where the test email is sent. Override with `MAILER_TEST_TO`.
const DEFAULT_RECIPIENT: &str = "filipriec@gmail.com";
const DEFAULT_RECIPIENT: &str = "filippriec@tutanota.com";
#[tokio::test]
#[serial]