# Email Notifications LeweAuto sends transactional email for account and vehicle changes. The messages are queued in the database and delivered after the request through the configured SMTP server. This page describes what is sent and what to check when mail does not arrive. ## What is sent | Message | Trigger | Recipient | | -------------------------------- | -------------------------------------------------------------- | ------------------- | | **Password reset** | A reset is requested for a local account | The account email | | **Account created** | An administrator or the self-registration creates an account | The new account | | **Password changed** | The user or an administrator changes a local password | The account email | | **Two-factor authentication changed** | 2FA is enabled or disabled | The account email | | **Vehicle assigned** | A user is directly assigned to a vehicle | The assigned user | :::info Group assignments do not send a separate mail. Only the users that are added directly to the vehicle assignment list receive the **Vehicle assigned** message. ::: The message body contains the action, a link to the application and a security hint where useful. The links use the **Application URL** from [Settings](https://book.lewe.com/leweauto/administration/system/settings/); an incorrect URL produces broken links. :::info LeweAuto does **not** send marketing mail, event reminders or a daily digest. The bell icon in the header is not a message feed; account notices are delivered by email. ::: ## Configuration Mail is configured in `.env.`: ```dotenv MAIL_HOST=smtp.example.com MAIL_PORT=587 MAIL_USER=notifications@example.com MAIL_PASS=your-smtp-password MAIL_FROM=notifications@example.com MAIL_ENCRYPTION=tls ``` * Without `MAIL_HOST` and `MAIL_FROM`, no mail is sent. The application still works. * `MAIL_ENCRYPTION` is optional. Without it, port 465 uses implicit SSL and other ports use STARTTLS when the server offers it. Use `none` only for a trusted local relay. * Messages from `example.com` and `.invalid` addresses are ignored on purpose. They belong to sample data and must not receive real mail. * The sender should match the SMTP account, otherwise the server may reject the message. ## Delivery and retention The outbox is processed in small batches after a request. A temporary SMTP failure leaves the row for the next attempt. **Mail retention** in [Settings → Security](https://book.lewe.com/leweauto/administration/system/settings/) removes old queued messages. Failed deliveries are recorded in the [Audit Log](https://book.lewe.com/leweauto/administration/system/audit-log/) under **Email**. ## Troubleshooting | Problem | Check | | ------------------------------ | --------------------------------------------------------------------- | | No mail at all | `MAIL_HOST`, `MAIL_FROM`, credentials and the firewall | | Mail in spam | SPF, DKIM and DMARC of the sending domain | | Link points to the wrong host | **Application URL** in the settings | | No mail for a user | The address; LDAP/OIDC accounts still receive notification email | | Password reset for an external account | Reset happens at the provider; no LeweAuto reset mail is sent | | Mail queue grows | SMTP errors in the audit log; retention cleans old rows | :::warning Email is not encrypted end to end. Do not put passwords, license keys or two-factor secrets in a notification or in a support mail. :::