Skip to content

Separate credentials for IMAP and SMTP #23

Description

@asltpo

TLDR: It would be useful if a single account could be configured with separate login credentials for IMAP and SMTP, like this:

[[accounts]]
imap = "imap_provider.com:993"
imap_user = "me@imap_provider.com"
imap_password = "my_imap_password"
imap_starttls = false
smtp = "smtp_provider.com:587"
smtp_user = "me@smtp_provider.com"
smtp_password = "my_smtp_password"
smtp_starttls = false
from = "Me <me@imap_provider.com>"

Background: I really like the neomd concept, but I have a gmail account which I can't really change. Heeding all the warnings in the docs about performance, I went ahead and configured neomd to interact directly with the gmail IMAP and SMTP servers:

[[accounts]]
imap = "imap.gmail.com:993"
smtp = "smtp.gmail.com:587"
user = "[email protected]"
password = "my_16_character_gmail_password"
from = "Me [email protected]"
starttls = false
tls_cert_file = ""

As expected, the retrieval of IMAP data from the gmail server was quite slow which made the UI laggy. To address this I set up a local IMAP syncer and server:

[ Gmail Server ]

│ (Slow, asynchronous background sync every 5 minutes)

[ mbsync / OfflineIMAP ] ──(Saves to)──► [ Local Maildir ]

│ (Fast local read/write)

[ Local IMAP Server (Dovecot) ]

│ (Standard IMAP @ localhost)

[ neomd ]

With this setup my neomd config became:

[[accounts]]
imap = "localhost:993"
smtp = "smtp.gmail.com:587"
user = "my_dovecot_username"
password = "my_dovecot_password"
from = "Me [email protected]"
starttls = false
tls_cert_file = ""

This dramatically reduced the UI lag but with a catch: I could no longer send emails because neomd now used my local IMAP credentials ("my_dovecot_username" and "my_dovecot_password") for SMTP, and they are not recognised by the gmail SMTP server.

Currently (I believe) neomd does not allow a single account to be configured with separate credentials for IMAP and SMTP. It does allow you to create an SMTP-only account, so I tried a workaround using one account for IMAP and another for SMTP. This works but requires me to switch accounts to send emails, which is a pain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions