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

WIP: POP3 support #769

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

WIP: POP3 support #769

wants to merge 2 commits into from

Conversation

kiwiz
Copy link

@kiwiz kiwiz commented Mar 2, 2025

Adds support for the POP3 protocol. A lot of work is still needed, but I wanted to get some early feedback on the direction I'm taking. The code was based off imap, so there may be some dead code remaining.

Implements #650

@kiwiz
Copy link
Author

kiwiz commented Mar 2, 2025

The server currently compiles and runs, but I haven't tested it with a non-empty mailbox. Is there an easy way to generate/import test data for that purpose?


// Undelete all messages marked as deleted in single connection
func (endp *Endpoint) Rset(user pop3backend.User) error {
return fmt.Errorf("pop3: unimplemented")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this can be implemented. Perhaps keep track of all messages that were Deleted and revert if this is called?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to be most reliable solution, considering current IMAP-based interface.

// client is greater than than the number of lines in the
// body, then the POP3 server sends the entire message.
func (endp *Endpoint) Top(user pop3backend.User, msgId int, n int) (lines []string, err error) {
return nil, fmt.Errorf("pop3: unimplemented")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there code I can reference for formatting the message headers?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that one is tricky. I guess, you would need to consume Literals returned by ListMessages and format them yourself. It is okay to partially consume returned value.

return "", fmt.Errorf("internal server error")
}

return strconv.FormatUint(uint64(msg.Uid), 10), nil
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return value is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants