fix: add sender_email to UserSmtpConfig to fix SMTP From header (501 bad sender address)
Agent-Logs-Url: https://github.com/christianlouis/InboxConverge/sessions/dc853384-976a-46e5-945b-60c9a9cce638 Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
edb4e8b0cc
commit
a21e2f7df6
@@ -148,6 +148,7 @@ function SettingsContent() {
|
||||
host: 'smtp.gmail.com',
|
||||
port: 587,
|
||||
username: '',
|
||||
sender_email: '',
|
||||
password: '',
|
||||
use_tls: true,
|
||||
});
|
||||
@@ -187,6 +188,7 @@ function SettingsContent() {
|
||||
host: smtpConfig.host,
|
||||
port: smtpConfig.port,
|
||||
username: smtpConfig.username,
|
||||
sender_email: smtpConfig.sender_email,
|
||||
use_tls: smtpConfig.use_tls,
|
||||
password: '', // never pre-fill password
|
||||
}));
|
||||
@@ -246,7 +248,7 @@ function SettingsContent() {
|
||||
mutationFn: smtpApi.remove,
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['smtp-config'] });
|
||||
setSmtpForm({ host: 'smtp.gmail.com', port: 587, username: '', password: '', use_tls: true });
|
||||
setSmtpForm({ host: 'smtp.gmail.com', port: 587, username: '', sender_email: '', password: '', use_tls: true });
|
||||
},
|
||||
});
|
||||
|
||||
@@ -302,6 +304,7 @@ function SettingsContent() {
|
||||
host: smtpForm.host,
|
||||
port: smtpForm.port,
|
||||
username: smtpForm.username,
|
||||
sender_email: smtpForm.sender_email,
|
||||
password: smtpForm.password || undefined,
|
||||
use_tls: smtpForm.use_tls,
|
||||
});
|
||||
@@ -601,6 +604,21 @@ function SettingsContent() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">Sender Email</label>
|
||||
<input
|
||||
type="email"
|
||||
name="sender_email"
|
||||
value={smtpForm.sender_email}
|
||||
onChange={handleSmtpChange}
|
||||
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
placeholder="sender@example.com"
|
||||
/>
|
||||
<p className="mt-1 text-xs text-gray-500">
|
||||
The From: address used when forwarding mail. Required when your SMTP username is an API token rather than an email address (e.g. Postmark, SendGrid).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">Password</label>
|
||||
<input
|
||||
|
||||
@@ -224,6 +224,7 @@ export interface UserSmtpConfig {
|
||||
host: string;
|
||||
port: number;
|
||||
username: string;
|
||||
sender_email: string;
|
||||
use_tls: boolean;
|
||||
has_password: boolean;
|
||||
created_at: string;
|
||||
@@ -485,6 +486,7 @@ export const smtpApi = {
|
||||
host: string;
|
||||
port: number;
|
||||
username: string;
|
||||
sender_email: string;
|
||||
password?: string;
|
||||
use_tls: boolean;
|
||||
}): Promise<UserSmtpConfig> {
|
||||
|
||||
Reference in New Issue
Block a user