proton-alias-send 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- proton_alias_send-0.1.0/.gitignore +11 -0
- proton_alias_send-0.1.0/CHANGELOG.md +24 -0
- proton_alias_send-0.1.0/LICENSE +203 -0
- proton_alias_send-0.1.0/PKG-INFO +157 -0
- proton_alias_send-0.1.0/README.md +129 -0
- proton_alias_send-0.1.0/pyproject.toml +79 -0
- proton_alias_send-0.1.0/src/proton_alias_send/__init__.py +7 -0
- proton_alias_send-0.1.0/src/proton_alias_send/__main__.py +8 -0
- proton_alias_send-0.1.0/src/proton_alias_send/cli.py +578 -0
- proton_alias_send-0.1.0/src/proton_alias_send/py.typed +0 -0
- proton_alias_send-0.1.0/tests/__init__.py +0 -0
- proton_alias_send-0.1.0/tests/test_api.py +306 -0
- proton_alias_send-0.1.0/tests/test_cli.py +287 -0
- proton_alias_send-0.1.0/tests/test_config.py +150 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2026-11-07
|
|
10
|
+
|
|
11
|
+
Initial release to PyPi.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `proton-alias-send CONTACT_EMAIL` creates a SimpleLogin reverse alias and prints it to
|
|
16
|
+
stdout.
|
|
17
|
+
- TOML config file with `--init-config`, created mode `600` on Unix.
|
|
18
|
+
- Setting resolution: command line > config file > `$SIMPLELOGIN_API_KEY` / defaults.
|
|
19
|
+
- `--copy/--no-copy` clipboard support via `pbcopy`, `wl-copy`, `xclip`, `xsel`, or `clip`.
|
|
20
|
+
- `--base-url` for self-hosted SimpleLogin instances.
|
|
21
|
+
- `find_alias_id` and `create_contact` are importable for use as a library.
|
|
22
|
+
|
|
23
|
+
[Unreleased]: https://github.com/fictiontoreality/proton-alias-send/compare/v0.1.0...HEAD
|
|
24
|
+
[0.1.0]: https://github.com/fictiontoreality/proton-alias-send/releases/tag/v0.1.0
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Jesse Johnson
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
203
|
+
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: proton-alias-send
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Create Proton Pass / SimpleLogin reverse aliases from the command line
|
|
5
|
+
Project-URL: Homepage, https://github.com/fictiontoreality/proton-alias-send
|
|
6
|
+
Project-URL: Repository, https://github.com/fictiontoreality/proton-alias-send
|
|
7
|
+
Project-URL: Issues, https://github.com/fictiontoreality/proton-alias-send/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/fictiontoreality/proton-alias-send/blob/main/CHANGELOG.md
|
|
9
|
+
Author-email: Jesse Johnson <gpg@fictiontoreality.dev>
|
|
10
|
+
License-Expression: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: alias,cli,email,privacy,proton,proton-pass,simplelogin
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: Communications :: Email
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: >=3.11
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# proton-alias-send
|
|
30
|
+
|
|
31
|
+
[](https://pypi.org/project/proton-alias-send/)
|
|
32
|
+
[](https://pypi.org/project/proton-alias-send/)
|
|
33
|
+
[](https://github.com/fictiontoreality/proton-alias-send/blob/main/LICENSE)
|
|
34
|
+
|
|
35
|
+
Create a Proton Pass / SimpleLogin **reverse alias** from the command line or Python, so you can
|
|
36
|
+
send mail *from* one of your aliases without opening the web dashboard.
|
|
37
|
+
|
|
38
|
+
SimpleLogin aliases forward mail to you out of the box, but replying from an alias to a
|
|
39
|
+
brand-new recipient requires creating a "contact" first. The dashboard makes you click
|
|
40
|
+
through several screens for this. This tool does it in one command and prints the reverse
|
|
41
|
+
alias address you actually put in your mail client's To: field.
|
|
42
|
+
|
|
43
|
+
```console
|
|
44
|
+
$ proton-alias-send boss@example.com
|
|
45
|
+
Looking up alias ID for work@simplelogin.io ...
|
|
46
|
+
Found alias ID: 1234567
|
|
47
|
+
Creating contact for boss@example.com ...
|
|
48
|
+
Done.
|
|
49
|
+
ra+abc123xyz@simplelogin.co
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Mail sent to `ra+abc123xyz@simplelogin.co` arrives at `boss@example.com`
|
|
53
|
+
appearing to come from `work@simplelogin.io`. Send it from a mailbox linked to that alias;
|
|
54
|
+
SimpleLogin only accepts mail to a reverse alias from those mailboxes.
|
|
55
|
+
|
|
56
|
+
## Install
|
|
57
|
+
|
|
58
|
+
```console
|
|
59
|
+
pipx install proton-alias-send
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
or
|
|
63
|
+
|
|
64
|
+
```console
|
|
65
|
+
uv tool install proton-alias-send
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
It has **no dependencies** outside the standard library and needs Python 3.11+.
|
|
69
|
+
|
|
70
|
+
## Setup
|
|
71
|
+
|
|
72
|
+
```console
|
|
73
|
+
$ proton-alias-send --init-config
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
That writes a commented config file (mode `600` on Unix) to:
|
|
77
|
+
|
|
78
|
+
| Platform | Path |
|
|
79
|
+
| ------------ | ----------------------------------------------------------------- |
|
|
80
|
+
| Linux / BSD | `$XDG_CONFIG_HOME/proton-alias-send/config.toml`, else `~/.config/...` |
|
|
81
|
+
| macOS | `~/.config/proton-alias-send/config.toml` |
|
|
82
|
+
| Windows | `%APPDATA%\proton-alias-send\config.toml` |
|
|
83
|
+
|
|
84
|
+
Fill in your API key from <https://app.simplelogin.io/dashboard/api_key> and the alias you
|
|
85
|
+
usually send from. The key must belong to the SimpleLogin account that holds the alias.
|
|
86
|
+
|
|
87
|
+
```toml
|
|
88
|
+
api_key = "your-api-key-here"
|
|
89
|
+
alias = "work@simplelogin.io"
|
|
90
|
+
copy = true
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
If you'd rather not keep the key on disk, leave `api_key = ""` and export
|
|
94
|
+
the environment variable `SIMPLELOGIN_API_KEY` instead. Avoid `-k` on shared machines: a
|
|
95
|
+
key on the command line is visible in `ps` and saved in your shell history.
|
|
96
|
+
|
|
97
|
+
## Usage
|
|
98
|
+
|
|
99
|
+
```console
|
|
100
|
+
$ proton-alias-send --help
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| Flag | Purpose |
|
|
104
|
+
| ------------------- | -------------------------------------------------------------- |
|
|
105
|
+
| `-a`, `--alias` | Alias to send from, overriding the config default |
|
|
106
|
+
| `-k`, `--api-key` | API key, overriding config and `$SIMPLELOGIN_API_KEY` |
|
|
107
|
+
| `--base-url` | Point at a self-hosted SimpleLogin instance (warns on plain `http://`) |
|
|
108
|
+
| `--copy/--no-copy` | Copy the result to the clipboard (`pbcopy`/`wl-copy`/`xclip`/`xsel`/`clip`) |
|
|
109
|
+
| `-q`, `--quiet` | Silence progress output on stderr |
|
|
110
|
+
| `--config PATH` | Use an alternate config file |
|
|
111
|
+
| `--init-config` | Write the sample config and exit |
|
|
112
|
+
|
|
113
|
+
Settings resolve as **command line > config file > environment / built-in default**, so any
|
|
114
|
+
config value can be overridden for a single run — including booleans, via `--no-copy` and
|
|
115
|
+
`--no-quiet`.
|
|
116
|
+
|
|
117
|
+
### Scripting
|
|
118
|
+
|
|
119
|
+
The reverse alias is the only thing written to stdout; all progress and errors go to
|
|
120
|
+
stderr. That makes it safe to capture:
|
|
121
|
+
|
|
122
|
+
```console
|
|
123
|
+
$ open "mailto:$(proton-alias-send -q boss@example.com)"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Exit status is `0` on success, `1` on any error, `130` if interrupted.
|
|
127
|
+
|
|
128
|
+
Creating a contact is idempotent — running it twice for the same recipient returns the
|
|
129
|
+
same reverse alias rather than failing.
|
|
130
|
+
|
|
131
|
+
### As a library
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from proton_alias_send import create_contact, find_alias_id
|
|
135
|
+
|
|
136
|
+
alias_id = find_alias_id("https://app.simplelogin.io", api_key, "work@simplelogin.io")
|
|
137
|
+
reverse = create_contact("https://app.simplelogin.io", api_key, alias_id, "boss@example.com")
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Both raise `RuntimeError` with a readable message on any API, network, or protocol failure.
|
|
141
|
+
|
|
142
|
+
## Development
|
|
143
|
+
|
|
144
|
+
```console
|
|
145
|
+
$ uv sync # create the venv, including dev tools
|
|
146
|
+
$ uv run pytest # tests
|
|
147
|
+
$ uv run pytest tests/test_config.py::test_merge_prefers_cli # a single test
|
|
148
|
+
$ uv run ruff check . # lint (formatting is deliberately not enforced)
|
|
149
|
+
$ uv run mypy # type check (strict)
|
|
150
|
+
$ uv build # build sdist + wheel into dist/
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
Apache-2.0. See [LICENSE](https://github.com/fictiontoreality/proton-alias-send/blob/main/LICENSE).
|
|
156
|
+
|
|
157
|
+
Not affiliated with Proton AG or SimpleLogin.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# proton-alias-send
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/proton-alias-send/)
|
|
4
|
+
[](https://pypi.org/project/proton-alias-send/)
|
|
5
|
+
[](https://github.com/fictiontoreality/proton-alias-send/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
Create a Proton Pass / SimpleLogin **reverse alias** from the command line or Python, so you can
|
|
8
|
+
send mail *from* one of your aliases without opening the web dashboard.
|
|
9
|
+
|
|
10
|
+
SimpleLogin aliases forward mail to you out of the box, but replying from an alias to a
|
|
11
|
+
brand-new recipient requires creating a "contact" first. The dashboard makes you click
|
|
12
|
+
through several screens for this. This tool does it in one command and prints the reverse
|
|
13
|
+
alias address you actually put in your mail client's To: field.
|
|
14
|
+
|
|
15
|
+
```console
|
|
16
|
+
$ proton-alias-send boss@example.com
|
|
17
|
+
Looking up alias ID for work@simplelogin.io ...
|
|
18
|
+
Found alias ID: 1234567
|
|
19
|
+
Creating contact for boss@example.com ...
|
|
20
|
+
Done.
|
|
21
|
+
ra+abc123xyz@simplelogin.co
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Mail sent to `ra+abc123xyz@simplelogin.co` arrives at `boss@example.com`
|
|
25
|
+
appearing to come from `work@simplelogin.io`. Send it from a mailbox linked to that alias;
|
|
26
|
+
SimpleLogin only accepts mail to a reverse alias from those mailboxes.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```console
|
|
31
|
+
pipx install proton-alias-send
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
or
|
|
35
|
+
|
|
36
|
+
```console
|
|
37
|
+
uv tool install proton-alias-send
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
It has **no dependencies** outside the standard library and needs Python 3.11+.
|
|
41
|
+
|
|
42
|
+
## Setup
|
|
43
|
+
|
|
44
|
+
```console
|
|
45
|
+
$ proton-alias-send --init-config
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
That writes a commented config file (mode `600` on Unix) to:
|
|
49
|
+
|
|
50
|
+
| Platform | Path |
|
|
51
|
+
| ------------ | ----------------------------------------------------------------- |
|
|
52
|
+
| Linux / BSD | `$XDG_CONFIG_HOME/proton-alias-send/config.toml`, else `~/.config/...` |
|
|
53
|
+
| macOS | `~/.config/proton-alias-send/config.toml` |
|
|
54
|
+
| Windows | `%APPDATA%\proton-alias-send\config.toml` |
|
|
55
|
+
|
|
56
|
+
Fill in your API key from <https://app.simplelogin.io/dashboard/api_key> and the alias you
|
|
57
|
+
usually send from. The key must belong to the SimpleLogin account that holds the alias.
|
|
58
|
+
|
|
59
|
+
```toml
|
|
60
|
+
api_key = "your-api-key-here"
|
|
61
|
+
alias = "work@simplelogin.io"
|
|
62
|
+
copy = true
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If you'd rather not keep the key on disk, leave `api_key = ""` and export
|
|
66
|
+
the environment variable `SIMPLELOGIN_API_KEY` instead. Avoid `-k` on shared machines: a
|
|
67
|
+
key on the command line is visible in `ps` and saved in your shell history.
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
```console
|
|
72
|
+
$ proton-alias-send --help
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
| Flag | Purpose |
|
|
76
|
+
| ------------------- | -------------------------------------------------------------- |
|
|
77
|
+
| `-a`, `--alias` | Alias to send from, overriding the config default |
|
|
78
|
+
| `-k`, `--api-key` | API key, overriding config and `$SIMPLELOGIN_API_KEY` |
|
|
79
|
+
| `--base-url` | Point at a self-hosted SimpleLogin instance (warns on plain `http://`) |
|
|
80
|
+
| `--copy/--no-copy` | Copy the result to the clipboard (`pbcopy`/`wl-copy`/`xclip`/`xsel`/`clip`) |
|
|
81
|
+
| `-q`, `--quiet` | Silence progress output on stderr |
|
|
82
|
+
| `--config PATH` | Use an alternate config file |
|
|
83
|
+
| `--init-config` | Write the sample config and exit |
|
|
84
|
+
|
|
85
|
+
Settings resolve as **command line > config file > environment / built-in default**, so any
|
|
86
|
+
config value can be overridden for a single run — including booleans, via `--no-copy` and
|
|
87
|
+
`--no-quiet`.
|
|
88
|
+
|
|
89
|
+
### Scripting
|
|
90
|
+
|
|
91
|
+
The reverse alias is the only thing written to stdout; all progress and errors go to
|
|
92
|
+
stderr. That makes it safe to capture:
|
|
93
|
+
|
|
94
|
+
```console
|
|
95
|
+
$ open "mailto:$(proton-alias-send -q boss@example.com)"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Exit status is `0` on success, `1` on any error, `130` if interrupted.
|
|
99
|
+
|
|
100
|
+
Creating a contact is idempotent — running it twice for the same recipient returns the
|
|
101
|
+
same reverse alias rather than failing.
|
|
102
|
+
|
|
103
|
+
### As a library
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from proton_alias_send import create_contact, find_alias_id
|
|
107
|
+
|
|
108
|
+
alias_id = find_alias_id("https://app.simplelogin.io", api_key, "work@simplelogin.io")
|
|
109
|
+
reverse = create_contact("https://app.simplelogin.io", api_key, alias_id, "boss@example.com")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Both raise `RuntimeError` with a readable message on any API, network, or protocol failure.
|
|
113
|
+
|
|
114
|
+
## Development
|
|
115
|
+
|
|
116
|
+
```console
|
|
117
|
+
$ uv sync # create the venv, including dev tools
|
|
118
|
+
$ uv run pytest # tests
|
|
119
|
+
$ uv run pytest tests/test_config.py::test_merge_prefers_cli # a single test
|
|
120
|
+
$ uv run ruff check . # lint (formatting is deliberately not enforced)
|
|
121
|
+
$ uv run mypy # type check (strict)
|
|
122
|
+
$ uv build # build sdist + wheel into dist/
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
Apache-2.0. See [LICENSE](https://github.com/fictiontoreality/proton-alias-send/blob/main/LICENSE).
|
|
128
|
+
|
|
129
|
+
Not affiliated with Proton AG or SimpleLogin.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "proton-alias-send"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
description = "Create Proton Pass / SimpleLogin reverse aliases from the command line"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = "Apache-2.0"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
keywords = ["simplelogin", "proton", "proton-pass", "alias", "email", "privacy", "cli"]
|
|
10
|
+
authors = [{ name = "Jesse Johnson", email = "gpg@fictiontoreality.dev" }]
|
|
11
|
+
dependencies = []
|
|
12
|
+
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Intended Audience :: End Users/Desktop",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Topic :: Communications :: Email",
|
|
25
|
+
"Topic :: Utilities",
|
|
26
|
+
"Typing :: Typed",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/fictiontoreality/proton-alias-send"
|
|
31
|
+
Repository = "https://github.com/fictiontoreality/proton-alias-send"
|
|
32
|
+
Issues = "https://github.com/fictiontoreality/proton-alias-send/issues"
|
|
33
|
+
Changelog = "https://github.com/fictiontoreality/proton-alias-send/blob/main/CHANGELOG.md"
|
|
34
|
+
|
|
35
|
+
[project.scripts]
|
|
36
|
+
proton-alias-send = "proton_alias_send.cli:main"
|
|
37
|
+
|
|
38
|
+
[build-system]
|
|
39
|
+
requires = ["hatchling>=1.27"]
|
|
40
|
+
build-backend = "hatchling.build"
|
|
41
|
+
|
|
42
|
+
[tool.hatch.version]
|
|
43
|
+
path = "src/proton_alias_send/__init__.py"
|
|
44
|
+
|
|
45
|
+
[tool.hatch.build.targets.wheel]
|
|
46
|
+
packages = ["src/proton_alias_send"]
|
|
47
|
+
|
|
48
|
+
[tool.hatch.build.targets.sdist]
|
|
49
|
+
include = ["src/", "tests/", "README.md", "LICENSE", "CHANGELOG.md"]
|
|
50
|
+
|
|
51
|
+
[dependency-groups]
|
|
52
|
+
dev = [
|
|
53
|
+
"mypy>=1.11",
|
|
54
|
+
"pytest>=8.0",
|
|
55
|
+
"ruff>=0.6",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[tool.ruff]
|
|
59
|
+
line-length = 100
|
|
60
|
+
src = ["src", "tests"]
|
|
61
|
+
|
|
62
|
+
[tool.ruff.lint]
|
|
63
|
+
select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"]
|
|
64
|
+
|
|
65
|
+
[tool.mypy]
|
|
66
|
+
python_version = "3.11"
|
|
67
|
+
files = ["src", "tests"]
|
|
68
|
+
strict = true
|
|
69
|
+
|
|
70
|
+
# Test helpers take pytest fixtures and monkeypatched stand-ins; demanding full
|
|
71
|
+
# annotations on every one of them costs more than it catches.
|
|
72
|
+
[[tool.mypy.overrides]]
|
|
73
|
+
module = "tests.*"
|
|
74
|
+
disallow_untyped_defs = false
|
|
75
|
+
disallow_incomplete_defs = false
|
|
76
|
+
disallow_any_generics = false
|
|
77
|
+
|
|
78
|
+
[tool.pytest.ini_options]
|
|
79
|
+
testpaths = ["tests"]
|