Commit Graph

246 Commits

Author SHA1 Message Date
Simon Ser 23d2b7f2d6 Migrate to golang.org/x/crypto/ssh/terminal
github.com/howeyc/gopass is unmaintained.
2021-11-10 13:57:15 +01:00
Simon Ser 4c7fd88d57 protonmail: mark more Message fields as json omitempty
Setting an empty ExternalID results in an e-mail with:

    Message-Id: <>
2021-07-30 15:32:37 +02:00
Simon Ser 5475468321 Upgrade dependencies 2021-07-30 15:27:31 +02:00
Simon Ser b122ca8a1f smtp: set ExternalID when creating draft
Re-use the client's Message-Id header when creating a new draft.
This allows In-Reply-To to work as expected in subsequent messages.

Closes: https://github.com/emersion/hydroxide/issues/186
2021-07-30 15:22:50 +02:00
Harley Lang c6c1d6ca19
Switch ProtonMail API endpoints to legacy
Update protonmail api and app version to fix `[9001] Login temporarily not permitted` errors.

Closes: https://github.com/emersion/hydroxide/issues/181
2021-07-22 08:26:40 +02:00
Simon Ser cfc03baf21 readme: update IRC channel 2021-06-15 08:00:00 +02:00
blank X c5c673afc0 cmd/hydroxide: add -disable-{imap,smtp,carddav} flags 2021-05-17 17:11:16 +02:00
Simon Ser 6243593939 Update dependencies
Closes: https://github.com/emersion/hydroxide/issues/167
2021-04-11 12:05:56 +02:00
proletarius101 0df2e43d8d imports: change the crypto lib to new import path 2021-04-08 11:13:32 +02:00
Simon Ser 5e211c61ac Fix cleartext listeners
We need a nil *tls.Config to setup cleartext listeners.

Fixes: eaed359829 ("Add support for TLS listeners")
Closes: https://github.com/emersion/hydroxide/issues/156
2021-02-25 12:39:03 +01:00
primalmotion eaed359829
Add support for TLS listeners
Support for -tls-cert and -tls-key to point to a certificate and
key to encrypt communications between the user and hydroxide.

Support for -tls-client-ca to ask client to present a certificate
signed by the provided CA.

Closes: https://github.com/emersion/hydroxide/issues/13
2021-02-24 09:48:29 +01:00
Simon Ser b812444ff8 cmd/hydroxide: override flag.Usage with our usage string 2021-02-23 18:39:59 +01:00
Simon Ser edc8a078b9 Set deterministic message boundary
This avoids multiple message fetches from returning a different
boundary.

Closes: https://github.com/emersion/hydroxide/issues/131
2021-01-07 14:35:29 +01:00
Mike Skec f06444c165 Add angled brackets around Message-Id value 2021-01-01 01:28:17 +01:00
Simon Ser d16ec98f49
Update dependencies 2020-12-17 14:30:26 +01:00
Simon Ser fe98e9c3ac
imports: wrap inline part in multipart message
Apparently the ProtonMail API no longer accepts non-multipart messages
when importing. This fixes the error:

    [36027] Imported message is not fully encrypted
2020-12-17 14:28:19 +01:00
Simon Ser 7b6061868f
cmd/hydroxide: fix skipped bytes on eml import 2020-12-17 13:55:47 +01:00
MrViK 4903cb08dd
imap: fix not being able to delete mails and [2000] IDs required
* Advertise imap.DeletedFlag on permanent flags
* Check if `mbox.deleted` has elements before sending API request
2020-12-17 13:32:28 +01:00
Simon Ser b4e52ac715
Add support for mbox files for import-messages 2020-12-10 22:26:54 +01:00
Víctor 86db01792a smtp: fix bcc being ignored
* Save all Rcpt command parameters on allReceivers
* On Data command, if bccList is empty, compare To and CC with
  allReceivers
* Receivers not referenced by To and CC are BCC
2020-11-24 10:42:50 +01:00
Simon Ser 358ca10548
exports: fix typo
Fixes: b116e0d5b0 ("exports: set charset to UTF-8")
2020-11-24 10:38:09 +01:00
Simon Ser b116e0d5b0
exports: set charset to UTF-8
Same as fdc51440c3 ("imap: set charset header to utf-8") but for
exports.
2020-11-23 10:02:20 +01:00
MrViK fdc51440c3
imap: set charset header to utf-8
Fixes #116
2020-11-23 09:59:51 +01:00
Simon Ser 5dc0d0b2e8
protonmail: update calendar endpoints
They are now under the /calendar/v1 prefix.
2020-10-13 17:29:16 +02:00
Simon Ser bcb69ab597
Update dependencies 2020-09-15 10:38:23 +02:00
Simon Ser fce7129990
Add -message-id flag to export-messages command 2020-09-15 10:37:01 +02:00
Simon Ser bd861cdb00
Add export-messages command
Right now only supports exporting conversations, and doesn't support
attachments.
2020-09-14 12:46:47 +02:00
Simon Ser ea188ff133
protonmail: add Client.GetConversation 2020-09-14 12:46:22 +02:00
Simon Ser 0e0fb0c38e
protonmail: introduce Timestamp 2020-09-14 12:09:50 +02:00
Simon Ser 524e2fc323
s/flags/options/ 2020-09-14 11:30:12 +02:00
TheOtherAdam 784a69efa0 Update README.md with new install instructions 2020-07-08 09:13:06 +02:00
Daniel Bertalan fe6f0a620f protonmail: make SRP modulus signature failures fatal
In 93c8007, SRP signature errors were made non-fatal because many
users got the following error:

    openpgp: unsupported feature: public key algorithm 22

This is because Protonmail started signing these messages with an
EDDSA key, an algorithm which the Go OpenPGP library does not
support. The switch to github.com/protonmail/crypto introduces this
algorithm, so messages that haven't been tampered with should pass
the verification.
2020-07-02 12:23:44 +02:00
Daniel Bertalan 06f6d5b8e9 protonmail: verify SRP modulus signatures
Code follows how the official proton-bridge is doing it.
2020-07-02 12:23:44 +02:00
Daniel Bertalan c483823b5c Use Protonmail fork of golang.org/x/crypto
Adds support for ed25519 (termed State-of-the-art by PM) private
keys. SRP modulus signature verification segfaults, so I commented
it out.
2020-07-02 12:23:44 +02:00
Hubcapp 246e71fbfe update usage help to correct flag-command order
Hi, I had a problem where the suggested usage is not actually how hydroxide was able to parse flags.

Currently, `hydroxide help` claims the correct order is
`usage: hydroxide <command> <flags>`

However, my flags are silently ignored when placing them in that order.
```
# hydroxide serve -smtp-port 2024
2020/07/01 01:43:20 CardDAV server listening on 127.0.0.1:8080
2020/07/01 01:43:20 SMTP server listening on 127.0.0.1:1025
2020/07/01 01:43:20 IMAP server listening on 127.0.0.1:1143
```

So I goofed with it a while and found out that hydroxide will not ignore flags if they go *before* the command.
```
hydroxide -smtp-port 2024 serve
2020/07/01 01:44:12 CardDAV server listening on 127.0.0.1:8080
2020/07/01 01:44:12 SMTP server listening on 127.0.0.1:2024
2020/07/01 01:44:12 IMAP server listening on 127.0.0.1:1143
```

The usage information should be changed to reflect this.
2020-07-01 11:34:11 +02:00
Simon Ser 74c2b8fa37
imports: fix io.Copy call for the message body 2020-06-11 11:04:57 +02:00
Simon Ser 346a0443db
imports: don't set empty Content-Type header field 2020-06-11 11:04:05 +02:00
Simon Ser 0b790847d9
protonmail: add ListCalendars, ListCalendarEvents 2020-03-12 01:23:24 +01:00
Simon Ser 1557b45d88
imap: add support for multiple Reply-To fields 2020-03-09 10:08:47 +01:00
Simon Ser d97056a61a
protonmail: add Client.Debug
This prints HTTP requests and responses.
2020-03-07 18:12:53 +01:00
Simon Ser 4ede51e2b0
protonmail: fix "invalid refresh token" errors
The UID is now provided as a header field.

Closes: https://github.com/emersion/hydroxide/issues/81
2020-03-07 18:09:50 +01:00
Simon Ser 87dbf04035
cmd/hydroxide: fix sub-command arg processing 2020-03-07 17:54:40 +01:00
Dmitry Valter ea106494fe Fix Attachment Error 15212
Change AttachmentKeys format from ID:Key to ID:{Algorithm,Key}.
2020-03-02 11:59:24 +01:00
Simon Ser b6073991b8
Update dependencies 2020-02-29 18:10:57 +01:00
Simon Ser 857d122113
cmd/hydroxide: move usage string to global constant 2020-02-29 12:36:48 +01:00
Simon Ser c1888bcc66
cmd/hydroxide: rename hydroxide.go to main.go 2020-02-29 12:35:09 +01:00
Simon Ser d65465dae5
cmd/hydroxide: add -debug flag 2020-02-29 12:34:20 +01:00
Simon Ser 4346b0163f
imap: add backend mutex 2020-02-29 12:13:32 +01:00
Simon Ser 5cd1c7a921
imap: consistently index users by IMAP-supplied username
The IMAP-supplied username may be different from the canonical
ProtonMail username.

References: https://github.com/emersion/hydroxide/issues/83
2020-02-29 12:06:09 +01:00
Simon Ser cbcde22b5b
imap: fix some race conditions 2020-02-29 11:59:15 +01:00