Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Could not append message to Sent if the sending folder is not named Sent #172

Closed
TornaxO7 opened this issue Jun 23, 2021 · 15 comments · Fixed by #246
Closed

Could not append message to Sent if the sending folder is not named Sent #172

TornaxO7 opened this issue Jun 23, 2021 · 15 comments · Fixed by #246
Labels
bug Something isn't working

Comments

@TornaxO7
Copy link
Contributor

So I'm testing some stuff currently and when I tried himalaya write, this happened:

Could not append message to `Sent`
 ↳ No Response: Folder doesn't exist. (Failure)

But: If I look into my gmail account, I cann see my mail under the Send mailbox. So doesn't that mean that this error message is wrong?

This is my ~/.config/himalaya/config.toml:

name = "Sambalakuja"
downloads-dir = "~/"
default-page-size = 50
signature = "I use Arch btw"
watch-cmds = ["mbsync -a"]

[gmail]
default = true
email = "Sambalakuja@gmail.com"

imap-host = "imap.gmail.com"
imap-port = 993
imap-login = "sambalakuja@gmail.com"
imap-passwd-cmd = "pass show sambalakuja@gmail.com"

smtp-host = "smtp.gmail.com"
smtp-port = 465
smtp-login = "sambalakuja@gmail.com"
smtp-passwd-cmd = "pass show sambalakuja@gmail.com"
@soywod
Copy link
Member

soywod commented Jun 24, 2021

It may be because of the ~ in the downloads-dir. As described in the wiki, you need to put the full abs path. See also #102.

@TornaxO7
Copy link
Contributor Author

I changed it to this:

name = "Sambalakuja"
downloads-dir = "/home/tornax/Downloads"
default-page-size = 50
signature = "I use Arch btw"
watch-cmds = ["mbsync -a"]

[gmail]
default = true
email = "Sambalakuja@gmail.com"

imap-host = "imap.gmail.com"
imap-port = 993
imap-login = "sambalakuja@gmail.com"
imap-passwd-cmd = "pass show sambalakuja@gmail.com"

smtp-host = "smtp.gmail.com"
smtp-port = 465
smtp-login = "sambalakuja@gmail.com"
smtp-passwd-cmd = "pass show sambalakuja@gmail.com"

But the error still exists.

@soywod
Copy link
Member

soywod commented Jun 24, 2021

So I guess it comes from the Sent folder from the IMAP server. When you run the command himalaya mbox, do you see the Sent mailbox?

@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Jun 24, 2021

That's what I get if I run himalaya mailboxes:

[1m�[4m�[37mDELIM �[0m�[38;5;8m│�[0m�[1m�[4m�[37mNAME              �[0m�[38;5;8m│�[0m�[1m�[4m�[37mATTRIBUTES                 �[0m
�[37m/     �[0m�[38;5;8m│�[0m�[32mINBOX             �[0m�[38;5;8m│�[0m�[34m\HasNoChildren             �[0m
�[37m/     �[0m�[38;5;8m│�[0m�[32m[Gmail][0m�[38;5;8m│�[0m�[34m\HasChildren, \NoSelect[0m
�[37m/     �[0m�[38;5;8m│�[0m�[32m[Gmail]/All Mail[0m�[38;5;8m│�[0m�[34m\All, \HasNoChildren[0m
�[37m/     �[0m�[38;5;8m│�[0m�[32m[Gmail]/Drafts[0m�[38;5;8m│�[0m�[34m\Drafts, \HasNoChildren[0m
�[37m/     �[0m�[38;5;8m│�[0m�[32m[Gmail]/Important[0m�[38;5;8m│�[0m�[34m\HasNoChildren, \Important[0m
�[37m/     �[0m�[38;5;8m│�[0m�[32m[Gmail]/Sent Mail[0m�[38;5;8m│�[0m�[34m\HasNoChildren, \Sent[0m
�[37m/     �[0m�[38;5;8m│�[0m�[32m[Gmail]/Spam[0m�[38;5;8m│�[0m�[34m\HasNoChildren, \Junk[0m
�[37m/     �[0m�[38;5;8m│�[0m�[32m[Gmail]/Starred[0m�[38;5;8m│�[0m�[34m\Flagged, \HasNoChildren[0m
�[37m/     �[0m�[38;5;8m│�[0m�[32m[Gmail]/Trash[0m�[38;5;8m│�[0m�[34m\HasNoChildren, \Trash[0m

Here's as an image:
image

Interestingly I get this, if I do himalaya mbox:

error: The subcommand 'mbox' wasn't recognized
	Did you mean 'mbox'?

If you believe you received this message in error, try re-running with 'himalaya -- mbox'

USAGE:
    himalaya [OPTIONS] [SUBCOMMAND]

For more information try --help

I guess that it's due to the [Gmail]/ part that it can't recognize the Sent directory.

@soywod
Copy link
Member

soywod commented Jun 24, 2021

In fact I should take the folder that has the attribute \Sent instead of taking the one named Sent. I will see how to do this when I have some free time. Thank you!

@soywod soywod changed the title Could not append message to Sent Could not append message to Sent if the sending folder is not named Sent Jun 24, 2021
@soywod soywod changed the title Could not append message to Sent if the sending folder is not named Sent Could not append message to Sent if the sending folder is not named Sent Jun 24, 2021
@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Jun 24, 2021

Ok, so it looks like that there's a general problem to with gmail accounts:

A draft was found:
(e)dit, (d)iscard or (q)uit? e
(s)end, (e)dit, (l)ocal/(r)emote draft or (d)iscard? r
Could not append message to `Drafts`
 ↳ No Response: Folder doesn't exist. (Failure)

This time, the mail couldn't have been sent (at least I can't find it anywhere in my gmail account).

@soywod
Copy link
Member

soywod commented Jun 24, 2021

Yes, I guess there is a general problem about names. I think I should take mailboxes depending on the attributes rather than just names. It's really strange that nobody open an issue yet about this problem, it is quite important !

@hao-lee
Copy link

hao-lee commented Jul 2, 2021

Does this problem have a workaround now?

@hao-lee
Copy link

hao-lee commented Jul 2, 2021

The workaround is change all imap_conn.append_msg("Sent",...... to imap_conn.append_msg("[Gmail]/Sent Mail",...... in file src/msg/cli.rs.

@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Jul 2, 2021

The workaround is change all imap_conn.append_msg("Sent",...... to imap_conn.append_msg("[Gmail]/Sent Mail",...... in file src/msg/cli.rs.

Well you're actually right with that, but this would only work for Gmail-accounts. I'm currently writing on a little refactor and can take this problem afterwards. But I have to wait for @soywod first.

@soywod soywod added the help wanted Extra attention is needed label Jul 8, 2021
@soywod soywod added this to the v1.0.0 milestone Aug 5, 2021
@TornaxO7
Copy link
Contributor Author

Hm... I'm a little bit unsure, how we should solve this, because: How do we know that a mailbox is the mailbox which should store all mails which are sent? Someone could name it as MyMailsWhichIJustSentYeet or someone else as MySendingsLOL.

Should the user apply a "mapping" in the config file to decide which mailboxes should be treated as what?

@soywod
Copy link
Member

soywod commented Oct 11, 2021

The role of a mailbox can be known thanks to its attributes:

DELIM │NAME                  │ATTRIBUTES              
.     │Sent                  │\HasNoChildren, \Sent   
.     │Notes                 │\HasNoChildren          
.     │Archives              │\HasChildren                    
.     │Archives.Work         │\HasNoChildren          
.     │Archives.Shopping     │\HasNoChildren          
.     │Archives.Admin        │\HasNoChildren          
.     │Archives.Health       │\HasNoChildren          
.     │Trash                 │\HasNoChildren, \Trash  
.     │Junk                  │\HasNoChildren, \Junk   
.     │Drafts                │\Drafts, \HasNoChildren 
.     │INBOX                 │\HasNoChildren

It could be nice to check the specs, but it seems that there is universal attributes at least for Drafts, Trash, Junk and Sent. INBOX seems to be the exception.

@sbromberger
Copy link

sbromberger commented Oct 25, 2021

Should the user apply a "mapping" in the config file to decide which mailboxes should be treated as what?

Is this something that might be able to be done as a stopgap solution? Right now I can't use himalaya to send emails via gmail. (It's working really well for reading them though.)

Just FYI, the same issue exists for the drafts folder, I think.

@soywod
Copy link
Member

soywod commented Oct 27, 2021

As discussed here #226 (comment), the manual mapping remains the most viable solution. I will try implement the solution ASAP and let you know!

@soywod soywod removed the help wanted Extra attention is needed label Oct 27, 2021
@soywod
Copy link
Member

soywod commented Oct 28, 2021

The folders INBOX, Sent and Drafts are now customizable (which should fix this issue). The feature will be added to the next release!

@soywod soywod mentioned this issue Feb 2, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
4 participants