Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Maildir storage backend #6

Open
emersion opened this issue Mar 5, 2018 · 14 comments
Open

Maildir storage backend #6

emersion opened this issue Mar 5, 2018 · 14 comments
Labels
new feature New feature. storage Related to storage backends.

Comments

@emersion
Copy link
Collaborator

emersion commented Mar 5, 2018

Probably maildir

@emersion emersion added the new feature New feature. label Mar 5, 2018
@emersion emersion changed the title Storage backend Disk storage backend Jan 10, 2019
@xeoncross
Copy link

https://github.com/flashmob/go-guerrilla/tree/master/backends implemented multiple backends using a Backend interface just as you did with your https://github.com/emersion/go-smtp#server

@foxcpp
Copy link
Owner

foxcpp commented Mar 23, 2019

What's up with https://github.com/emersion/go-imap-disk? Can we use it? (of course, we need to finish it first)

@emersion
Copy link
Collaborator Author

We can use it, but it doesn't use maildir, it uses a bolt database. This is fine too, but a maildir backend would probably be higher priority for compatibility (makes migrating easier).

@foxcpp
Copy link
Owner

foxcpp commented Mar 25, 2019

https://github.com/luksen/maildir
Except that we also need some way to store UIDs and some other meta-data (custom flags, internal date).

@lupine
Copy link
Contributor

lupine commented May 11, 2019

Dovecot stores UIDs in a uidlist file. I've been working on a project similar to maddy, on and off (maddy is better!), and implemented a parser for it here: https://gitlab.com/lupine/crockery/tree/master/internal/imap/uidlist

@foxcpp
Copy link
Owner

foxcpp commented May 11, 2019

We currently want to implement support for Maildir storage by extending https://github.com/emersion/go-imap-disk which uses BoltDB for all meta-data. Personally, I don't like the idea of supporting other servers internal formats in maddy. Also we can't use your code anyway due to incompatible licenses (crockery's AGPL and maddy's MIT).

@emersion
Copy link
Collaborator Author

Are the UIDs the only metadata we need to save?

@foxcpp
Copy link
Owner

foxcpp commented May 12, 2019

Mailbox-related: UIDVALIDITY, UIDNEXT
Message-related: flags, RFC822 size [1], internal date [2], UID

[1] - Probably we would have to store message using native line separators to reduce possible interoperability problems [research needed], but we should still report RFC822 size with CRLF (Is that right?).
[2] - Probably FS "modification time"?

@emersion
Copy link
Collaborator Author

emersion commented May 12, 2019

Probably we would have to store message using native line separators to reduce possible interoperability problems

No, MIME says you MUST use CRLF. Using non-CRLF line endings with MIME messages leads to various issues including DKIM signature breakage.

@foxcpp
Copy link
Owner

foxcpp commented May 13, 2019

Related discussion: https://dovecot.org/list/dovecot/2013-May/090499.html

The original (djb) definition of Maildir assumed that messages would be written to the maildir with LF line endings, and both MTA and POP server would translate back to CRLF as needed. Dovecot (as a POP server) can deal with messages in either format, and should always return them to clients with CRLF.

It mentions POP, but I think it applies to IMAP too.

@emersion
Copy link
Collaborator Author

Gah that is annoying.

Also note that:

mail_save_crlf setting controls if mails are saved as CRLF or LF to storage.

@foxcpp foxcpp added the storage Related to storage backends. label May 25, 2019
@foxcpp foxcpp self-assigned this Feb 27, 2020
@foxcpp
Copy link
Owner

foxcpp commented Feb 27, 2020

Started some work here.
https://github.com/foxcpp/go-imap-maildir

Not high priority though, go-imap-sql is working reasonably well.

@foxcpp foxcpp modified the milestones: 0.3 - "Third-party integrations", X.Y - "Eventually" May 11, 2020
@foxcpp foxcpp removed this from the X.Y - "Eventually" milestone Jul 16, 2020
@foxcpp foxcpp changed the title Disk storage backend Maildir storage backend Aug 3, 2020
@foxcpp
Copy link
Owner

foxcpp commented Aug 3, 2020

go-imap-maildy is ready for use. Integration is blocked by #259 since it was written for v2.

@foxcpp foxcpp added this to the 0.5 milestone Aug 3, 2020
@foxcpp foxcpp removed their assignment Jul 12, 2021
@foxcpp foxcpp modified the milestones: 0.5, 0.6 Aug 9, 2021
@foxcpp
Copy link
Owner

foxcpp commented Jan 6, 2022

Blocked by foxcpp/go-imap-maildir#1 since we need to use go-imap-mess "external update" adapter for maddyctl synchronization.

@foxcpp foxcpp removed this from the 0.6 milestone Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature. storage Related to storage backends.
Projects
None yet
Development

No branches or pull requests

4 participants