Emails stuck in outbox

I am afraid that I am having (yet another) problem with k9. To wit: when I send an email, within my ‘mailfence’ account, the email goes into the ‘outbox’ and stays there. Can anyone help? Thanks. K9 5.807, Android 12.

First, go into the “sending mail”/outgoing server" settings and select “next” and see what happens. If you get an error - certificate, authentication, etc., you should be able to deal with that. If it returns you to the mail “sending mail” page without error then please provide all the configuration details that you are using for the “outgoing server” settings.

Thanks. I appreciate the timely help.

As I should have said: ‘next’ reveals no problems.

I should say also that Gmail sends OK.

Also: I presume that I set the settings for Mailfence either automatically or as Mailfence advises. Further, and importantly: if there is a problem, should not k9 give an error message?

Outgoing server settings

SMTP server: smtp.mailfence.com

Security: SSL/TLS

Port: 465

Require sign-in: yes

Username: <my full email address> [It seems the forum dislikes chevrons. Can you read this, now? Presuming yes: here I put my full email address.]

Authentication: normal password

Their documentation says to use “your Mailfence username” for the “username”. Depending on their setup, this might not be your “full email address”.

If gmail works, then this would seem to be a mailfence-specific issue, so you may need to contact their customer support.

K9 (mostly) passes an error from their server back to you. If their server doesn’t give an error K9 won’t have much to pass back.

You may need to enable logging to see if more detail is provided.

njeyaakili: thank you. Removing the ‘@’ suffix to my username, in the field for username for sending mail, did not help. I have enabled logging, but I cannot see how I can read the logs. I have written to Mailfence.

Github has excellent instructions on how to provide a log :slightly_smiling_face:

1 Like

Thanks. Log here on paste bin. The lines that stand out are as follows.

03-26 16:24:31.501 32004 32004 D ProcessState: Binder ioctl to enable oneway spam detection failed: Invalid argument

03-26 16:24:31.604 32004 32058 W TracingPowerManager$TracingWakeLock: TracingWakeLock for tag ImapFolderPusher-Mailfence-Archives / id 2: acquired with no timeout.  K-9 Mail should not do this

03-26 16:24:56.631 32004 32029 E MessagingController: Failed to send message
03-26 16:24:56.631 32004 32029 E MessagingController: com.fsck.k9.mail.transport.smtp.NegativeSmtpReplyException: Could not find a valid MX or A record for domain gmail.com

I can open an issue if that is desired.

While cketti will need to look at the bit that results in the “K-9 Mail should not do this” bit, the last “Could not find a valid MX or A record for domain gmail.com” line implies either an issue with how you have your gmail account set up or an issue with the dns lookup (perhaps related to connectivity) at that point in time.

Thanks. I await cketti’s input - except that I got Mailfence to investigate too; if and when I hear back from Mailfence, I will report what Mailfence says here.

I add that if I do not manage to get these problems solved soon then I will have to jump ship to another email program. (I will be be asking for a refund too! :grinning:)

The message stating that “K-9 Mail should not do this” can be ignored.

The message “Could not find a valid MX or A record for domain gmail.com” is text that the outgoing mail server returned in its error response. It sounds like your email provider was having network issues. If this error persists, you should contact your email provider about it.

To get K-9 Mail to send the message again you have to move it to the Drafts folder, then open it and send it again.

1 Like

cketti: thanks.

I have discovered what the problem is, but I am somewhat unclear about how to correct it and, unless I miss something, there is a problem with k9 here. Let me explain.

My email provider tells me the following.

The issue is persisting because the MAIL FROM address TLD used by the SMTP client program is incorrect:

‘[my user name]@mailfence.con

In such cases, the Mailfence server replies with 450 response code, and the SMTP client should react accordingly (instead of showing email being stuck in the outbox).

The main point arising from this, or at least a point, is this: I cannot find where the ‘.con’ (sic) is stored and so I cannot change it. The settings pages, within K9, for the relevant email account do show, at the top of each page, ‘[my user name]@mailfence.con’; but, in every editable field - indeed, in every field uberhaupt - in which I see my address, the address has the correct ‘.com’ suffix. So it seems I must delete the whole account and recreate it. This is not ideal. Please advise. Thank you.

You can change the sender address under Settings → [Account] → Sending mail → Composition defaults → Your email address.

1 Like

Ah: that was a setting that I had not found. Thank you. I can now send emails with the account in question! That’s good!

However, (1) I find that the sidebar continues to register the outbox as containing a message even when it does not; it one clicks on ‘outbox (1)’ then the outbox is empty. It seems that the sidebar does catch up, so to speak, but it took some thirty seconds to do so.

(2) The ‘.con’ suffix passed the validation that K9 does for account settings. Seemingly that suffix should not pass the validation.

(3) There is the problem spelt out by my mail provider. To wit: ‘the Mailfence server replies with 450 response code, and the SMTP client should react accordingly (instead of showing email being stuck in the outbox)’.

  1. That’s a bug. It’s already fixed in recent beta versions.
  2. con is a valid domain name. We don’t check against currently registered top-level domain names because we’d have to update this list all the time.
  3. K-9 Mail should have displayed the error message from the server in an error notification. To me the error message from the server seems to be entirely unrelated to the actual error. So maybe this is something your provider can work on.
    Anyway, what do you expect K-9 Mail to do? An error occurred when sending the message. We don’t have a dedicated “these messages couldn’t be sent” folder. So messages with errors stay in the Outbox. We should probably show an error icon and add a way to view the error message from the server (again). What exactly do you propose we should do to “react accordingly”?
1 Like

1: great!
2: OK.
3: Perhaps K-9 did display the error; I have notifications from K-9 disabled, because I want to hear of new emails only when I have the K-9 app open. ‘[T]he error message from the server seems to be entirely unrelated to the actual error. So maybe this is something your provider can work on.’ I will write to the provider about that. That said: what is wrong with the ‘450’ error code? That it denotes (at least normally) a temporary failure to send an email? ‘We should probably show an error icon and add a way to view the error message from the server (again)’: that sounds good.

K-9 Mail treats a reply code of 450 as a temporary error. But the maximum number of send attempts is currently 5. Afterwards a temporary error is treated like a permanent one (no more send attempts).

This wasn’t an error that could have been resolved by simply retrying often enough. So for the user it doesn’t really matter if the returned error was a permanent one or a (forever ongoing) “temporary” one.

Thanks, and sorry to bang on, but I do not know what to tell my provider. So, to repeat: what is wrong with the 450 code being issued in the current situation?

Oh, I see. I wasn’t complaining about the error code. K-9 Mail doesn’t care about the exact value.

However, the error message should help the user to track down the cause of the error. In this case the server returned the error message “Could not find a valid MX or A record for domain gmail.com”.
Personally, I don’t know how this error message is related to what appears to have been the actual problem – you using an unsupported sender address.

An error of 550 Unknown sender address would have probably been a better response.

1 Like

sorry to enter the discussion in this thread, but i have the same issues, but not witrh gmail. I have the option to manually send the mail again, but it does nothing. Why do i have to move it in drafts first?

Is this also fixed in current beta versions?

1 Like

Assuming the issue was resolved already but for anyone new, setting an App password in your Google account for K-9 fixes this. Then use that password for K-9 login. K-9 Mail – add Gmail account when using 2 step verification - YouTube