pimalaya / himalaya

CLI to manage emails
https://pimalaya.org
MIT License
3.17k stars 95 forks source link

Error Parsing Config File When Configuring a Particular Server #333

Closed Balrrach closed 2 years ago

Balrrach commented 2 years ago

Hello.

When configuring my working mail server himalaya prompts the following error:

Error: cannot parse config file

Caused by:
    data did not match any variant of untagged enum DeserializedAccountConfig at line 24 column 1

Line 24 is the line where my working server configuration starts. If I write the configuration of only my secondary mail which is gmail it all goes well but if I try to include my working server config it fails.

Also, when copying example config from the wiki I get the exact same error but this time on line 56 which corresponds to [posteo-local.mailboxes].

soywod commented 2 years ago

Can you share your full config? It looks like you miss some piece of config.

Balrrach commented 2 years ago

Sure, my config is:

name = "Name"
downloads-dir = "~/Downloads"
signature = "Sincerely, Name"
default-page-size = 50
watch-cmds = ["mbsync -a"]

[gmail]
email = "name@gmail.com"

smtp-host = "smtp.gmail.com"
smtp-port = 465
smtp-login = "name@gmail.com"
smtp-passwd-cmd = "echo name.passwd"

imap-host = "imap.gmail.com"
imap-port = 993
imap-login = "name@gmail.com"
imap-passwd-cmd = "echo name.passwd"

[gmail.mailboxes]
sent = "[Gmail]/Sent Mail"
draft = "[Gmail]/Drafts"

[ugr]
default = true
email = "name@correo.ugr.es"

smtp-host = "smtp.ugr.es"
smtp-port = 587
smtp-starttls = true
smtp-login = "name@correo.ugr.es"
smtp-passwd-cmd = "echo name.passwd"

imap-host = "imap.ugr.es"
imap-port = 993
smtp-starttls = false
imap-login = "name@correo.ugr.es"
imap-passwd-cmd = "echo name.passwd"
soywod commented 2 years ago

The problem comes from the ugr account:

imap-host = "imap.ugr.es"
imap-port = 993
smtp-starttls = false # <<<<<<<<<<<<<<<<<<<<<<<<<< here, you left smtp-startls instead of imap-starttls
imap-login = "name@correo.ugr.es"
imap-passwd-cmd = "echo name.passwd"

I agree that the error message is not so friendly, it is because of the way the deserializer has been used inside Himalaya. To make it more clear, I will have to introduce a breaking change (which I would like to avoid for now). I keep it in mind for the v1 migration guide!

Balrrach commented 2 years ago

All fixed, thanks a lot!

soywod commented 2 years ago

Breaking changes will occur with this issue #344 and this discussion #345.

mizzunet commented 2 years ago

I have the same issue

Error: cannot parse config file

Caused by:
    data did not match any variant of untagged enum DeserializedAccountConfig at line 8 column 1

config,

name = "Missu"
downloads-dir = "~/mail"
signature = """
Cordialement,
Regards,
"""

[protonmail]
default = true
email = "user@protonmail.com"
imap-host = "localhost"
imap-port = 993
imap-login = "user"
imap-passwd = "pass"

smtp-host = "localhost"
smtp-port = 1143
smtp-login = "user"
smtp-passwd ="pass"
soywod commented 2 years ago

It is imap-passwd-cmd and smtp-passwd-cmd, please read the config section of the wiki 1. You cannot put directly your passwords in the configuration, you need to put a command that will retrieve them.

On 29 Mar 2022, at 16:11 (+0200), soywod/himalaya wrote:

I have same issue config,

name = "Your full name"
downloads-dir = "~/mail"
signature = """
Cordialement,
Regards,
"""

[protonmail]
default = true
email = ***@***.***"
imap-host = "localhost"
imap-port = 993
imap-login = "user"
imap-passwd = "pass"

smtp-host = "localhost"
smtp-port = 1143
smtp-login = "user"
smtp-passwd ="pass"

-- Reply to this email directly or view it on GitHub: https://github.com/soywod/himalaya/issues/333#issuecomment-1081922315 You are receiving this because you modified the open/close state.

Message ID: @.***>

-- Cordialement Clément DOUIN Développeur Web Full-Stack https://soywod.me

mizzunet commented 2 years ago

Thanks :)

nwithan8 commented 2 years ago

Mind taking a look at mine as well? Getting the same error, but I can't find anything that stands out as wrong:

name = "Nate Harris"
downloads-dir = "/Users/nharris/mail/himalaya/downloads"
signature = "- Nate Harris"

[gmail]
default = true
signature = """
Nate Harris
A Guy
"""
format = { type = "auto" }
email = "email@domain.com"

smtp-host = "smtp.gmail.com"
smtp-post = 587
smtp-starttls = true
smtp-login = "email@domain.com"
smtp-passwd-cmd = "echo supersecretpassword"

imap-host = "imap.gmail.com"
imap-port = 993
imap-login = "email@domain.com"
imap-passwd-cmd = "echo supersecretpassword"

mailboxes = { sent = "[Himalaya]/Sent Mail", draft = "[Himalaya]/Drafts" }
soywod commented 2 years ago

Mind taking a look at mine as well?

Looks like you have a typo at smtp-post instead of smtp-host :smile: