oficina / fichas Public

Clone
git clone https://amadan.net/oficina/fichas

Plain git — no account needed to clone.

Download

Download this file

1package fichas
2
3import (
4 "log/slog"
5
6 "amadan.net/rastrillo/rastrillo/mail"
7)
8
9// Mailer builds the sign-in sender. Call it only where fichas serves:
10// a CARLOS seed or one-shot runs with no control socket, and the agent
11// strips CARLOS_MAIL from it, so mail.FromCarlos there would refuse once
12// the app is switched to submission.
13//
14// mail.FromCarlos picks submission when CARLOS_MAIL=submit, else SMTP,
15// and refuses with neither, or with submission half set up. Logged mail
16// is only what LoadConfig admitted: FICHAS_ALLOW_LOGGED_MAIL on loopback
17// with no channel at all.
18func Mailer(cfg Config, logger *slog.Logger) (mail.Sender, error) {
19 if !cfg.MailConfigured {
20 return mail.FromEnv("CARLOS", logger), nil
21 }
22 return mail.FromCarlos("CARLOS", logger)
23}
24