mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
configure: do not try the same username twice
If username does not contain "@", don't try again after removing domain part.
This commit is contained in:
committed by
link2xt
parent
00c1383419
commit
920753ad50
@@ -495,14 +495,14 @@ async fn try_imap_usernames(
|
|||||||
) -> Result<LoginParam> {
|
) -> Result<LoginParam> {
|
||||||
if param.mail_user.is_empty() {
|
if param.mail_user.is_empty() {
|
||||||
param.mail_user = param.addr.clone();
|
param.mail_user = param.addr.clone();
|
||||||
if let Ok(()) = try_imap_one_param(context, ¶m, imap).await {
|
if let Err(e) = try_imap_one_param(context, ¶m, imap).await {
|
||||||
return Ok(param);
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(at) = param.mail_user.find('@') {
|
if let Some(at) = param.mail_user.find('@') {
|
||||||
param.mail_user = param.mail_user.split_at(at).0.to_string();
|
param.mail_user = param.mail_user.split_at(at).0.to_string();
|
||||||
}
|
|
||||||
try_imap_one_param(context, ¶m, imap).await?;
|
try_imap_one_param(context, ¶m, imap).await?;
|
||||||
|
} else {
|
||||||
|
return Err(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
Ok(param)
|
Ok(param)
|
||||||
} else {
|
} else {
|
||||||
try_imap_one_param(context, ¶m, imap).await?;
|
try_imap_one_param(context, ¶m, imap).await?;
|
||||||
@@ -619,14 +619,14 @@ async fn try_smtp_usernames(
|
|||||||
) -> Result<LoginParam> {
|
) -> Result<LoginParam> {
|
||||||
if param.send_user.is_empty() {
|
if param.send_user.is_empty() {
|
||||||
param.send_user = param.addr.clone();
|
param.send_user = param.addr.clone();
|
||||||
if let Ok(()) = try_smtp_one_param(context, ¶m, smtp).await {
|
if let Err(e) = try_smtp_one_param(context, ¶m, smtp).await {
|
||||||
return Ok(param);
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(at) = param.send_user.find('@') {
|
if let Some(at) = param.send_user.find('@') {
|
||||||
param.send_user = param.send_user.split_at(at).0.to_string();
|
param.send_user = param.send_user.split_at(at).0.to_string();
|
||||||
}
|
|
||||||
try_smtp_one_param(context, ¶m, smtp).await?;
|
try_smtp_one_param(context, ¶m, smtp).await?;
|
||||||
|
} else {
|
||||||
|
return Err(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
Ok(param)
|
Ok(param)
|
||||||
} else {
|
} else {
|
||||||
try_smtp_one_param(context, ¶m, smtp).await?;
|
try_smtp_one_param(context, ¶m, smtp).await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user