mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-01-23 02:14:26 +00:00
fix: enhance SMTP API password handling with app password support
This commit is contained in:
parent
cb0056acc5
commit
299a81502a
2 changed files with 12 additions and 2 deletions
|
|
@ -6183,8 +6183,18 @@ paths:
|
|||
description: SMTP username (mailbox login; required)
|
||||
type: string
|
||||
password:
|
||||
description: SMTP password (mailbox login; required)
|
||||
description: >
|
||||
SMTP password (mailbox password or mailbox app password; required).
|
||||
App passwords are recommended for API usage.
|
||||
type: string
|
||||
example: "app-password-or-mailbox-password"
|
||||
app_password:
|
||||
description: >
|
||||
Alias for `password`.
|
||||
SMTP password (mailbox password or mailbox app password; required).
|
||||
App passwords are recommended for API usage.
|
||||
type: string
|
||||
example: "app-password-or-mailbox-password"
|
||||
required:
|
||||
- from
|
||||
- to
|
||||
|
|
|
|||
|
|
@ -3413,7 +3413,7 @@ function smtp_api($action, $data) {
|
|||
// SMTP settings - mailbox-level auth; default to 587 (STARTTLS)
|
||||
$smtp_host = isset($data['smtp_host']) ? $data['smtp_host'] : 'postfix-mailcow';
|
||||
$smtp_user = isset($data['smtp_user']) ? $data['smtp_user'] : '';
|
||||
$smtp_pass = isset($data['password']) ? $data['password'] : '';
|
||||
$smtp_pass = $data['app_password'] ?? $data['password'] ?? '';
|
||||
$smtp_port = isset($data['smtp_port']) ? intval($data['smtp_port']) : 587;
|
||||
|
||||
// Validate from address
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue