diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-20 22:52:38 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-20 22:52:38 +0900 |
| commit | c9e72cfb78f2cc2dd9e3c5f0c49e92255bd2db1a (patch) | |
| tree | abc0ac09afbf1b17c5489506a700681936153b5f | |
init
| -rw-r--r-- | .gitignore | 6 | ||||
| -rw-r--r-- | FUNDING.yml | 2 | ||||
| -rw-r--r-- | LICENSE | 674 | ||||
| -rw-r--r-- | Makefile | 36 | ||||
| -rw-r--r-- | README.md | 226 | ||||
| -rwxr-xr-x | bin/mailsync | 112 | ||||
| -rwxr-xr-x | bin/mw | 422 | ||||
| -rw-r--r-- | completion/_mutt-wizard.zsh | 45 | ||||
| -rwxr-xr-x | lib/openfile | 10 | ||||
| -rw-r--r-- | mailsync.1 | 57 | ||||
| -rw-r--r-- | mw.1 | 302 | ||||
| -rw-r--r-- | share/domains.csv | 343 | ||||
| -rw-r--r-- | share/mailcap | 10 | ||||
| -rw-r--r-- | share/mbsync-temp | 24 | ||||
| -rw-r--r-- | share/mpop-temp | 8 | ||||
| -rw-r--r-- | share/msmtp-temp | 11 | ||||
| -rw-r--r-- | share/mutt-temp | 18 | ||||
| -rw-r--r-- | share/mutt-wizard.muttrc | 194 | ||||
| -rw-r--r-- | share/notmuch-temp | 14 | ||||
| -rw-r--r-- | share/online-temp | 4 | ||||
| -rw-r--r-- | share/switch.muttrc | 10 |
21 files changed, 2528 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8573c25 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +personal.muttrc +*.swp +*.gpg +*.pyc +accounts/ +*mailsynclastrun diff --git a/FUNDING.yml b/FUNDING.yml new file mode 100644 index 0000000..c7c9a22 --- /dev/null +++ b/FUNDING.yml @@ -0,0 +1,2 @@ +custom: ["https://lukesmith.xyz/donate.html"] +github: lukesmithxyz @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..623aaf7 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +.POSIX: + +PREFIX = /usr/local +MANPREFIX = $(PREFIX)/share/man + +install: + mkdir -p $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(PREFIX)/lib/mutt-wizard + mkdir -p $(DESTDIR)$(PREFIX)/share/mutt-wizard + cp -f bin/mailsync $(DESTDIR)$(PREFIX)/bin + cp -f lib/openfile $(DESTDIR)$(PREFIX)/lib/mutt-wizard + chmod 755 $(DESTDIR)$(PREFIX)/share/mutt-wizard + for shared in share/*; do \ + cp -f $$shared $(DESTDIR)$(PREFIX)/share/mutt-wizard; \ + chmod 644 $(DESTDIR)$(PREFIX)/share/mutt-wizard/$$(basename $(notdir $$shared)); \ + done + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + cp -f mailsync.1 $(DESTDIR)$(MANPREFIX)/man1/mailsync.1 + sed 's:/usr/local:$(PREFIX):' < share/mutt-wizard.muttrc > $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrc + sed 's:/usr/local:$(PREFIX):' < share/mailcap > $(DESTDIR)$(PREFIX)/share/mutt-wizard/mailcap + sed 's:/usr/local:$(PREFIX):' < bin/mw > $(DESTDIR)$(PREFIX)/bin/mw + sed 's:/usr/local:$(PREFIX):' < mw.1 > $(DESTDIR)$(MANPREFIX)/man1/mw.1 + chmod 644 $(DESTDIR)$(MANPREFIX)/man1/mw.1 $(DESTDIR)$(MANPREFIX)/man1/mailsync.1 + chmod 755 $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/lib/mutt-wizard/openfile + mkdir -p $(DESTDIR)$(PREFIX)/share/zsh/site-functions/ + chmod 755 $(DESTDIR)$(PREFIX)/share/zsh/site-functions/ + cp -f completion/_mutt-wizard.zsh $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_mutt-wizard.zsh + chmod 644 $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_mutt-wizard.zsh + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/lib/mutt-wizard/openfile + rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard $(DESTDIR)$(PREFIX)/lib/mutt-wizard + rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1 $(DESTDIR)$(MANPREFIX)/man1/mailsync.1 + rm -f $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_mutt-wizard.zsh + +.PHONY: install uninstall diff --git a/README.md b/README.md new file mode 100644 index 0000000..07995cf --- /dev/null +++ b/README.md @@ -0,0 +1,226 @@ +# mutt-wizard + +https://muttwizard.com/ + +Get this great stuff without effort: + +- A full-featured and autoconfigured email client on the terminal with neomutt +- Mail stored offline enabling the ability to: + * view and write emails while you're away from + the internet + * make backups +- Provides a `mailsync` script that can be scheduled to run as often as you + like, which downloads/syncs mail and optionally notifies you when new mail has arrived. + +Specifically, this wizard: + +- Determines your email server's IMAP and SMTP servers and ports +- Creates dotfiles for `neomutt`, `isync`, and `msmtp` appropriate for your + email address +- Encrypts and locally stores your password for easy remote access, accessible + only by your GPG key +- Handles as many as nine separate email accounts automatically +- Auto-creates bindings to switch between accounts or between mailboxes +- Provides sensible defaults and an attractive appearance for the neomutt email + client +- If mutt-wizard doesn't know your server's IMAP/SMTP info by default, it will + prompt you for them and will put them in all the right places. + +## Install + +#### Dependencies + +- `neomutt` - the email client. (If you are using Gentoo GNU/Linux, you will need the `sasl` use flag to be enabled) +- `curl` - tests connections (required at install). +- `isync` - downloads and syncs the mail (required if storing IMAP mail locally). +- `msmtp` - sends the email. +- `pass` - safely encrypts passwords (required at install). +- `ca-certificates` - required for SSL. Probably installed already. +- `gettext` - writes config files. Probably installed already. + +**Note**: There's a chance of errors if you use a slow-release distro like +Ubuntu, Debian, or Mint. If you get errors in `neomutt`, install the most +recent version manually or manually remove the offending lines in the config in +`/usr/share/mutt-wizard/mutt-wizard.muttrc`. + +```bash +git clone https://github.com/LukeSmithxyz/mutt-wizard +cd mutt-wizard +sudo make install +``` + +A user of Arch-based distros can also install the current mutt-wizard release from the AUR as +[mutt-wizard](https://aur.archlinux.org/packages/mutt-wizard/), or the Github master branch, [mutt-wizard-git](https://aur.archlinux.org/packages/mutt-wizard-git/). + +### Optional Dependencies + +- `pam-gnupg` - Automatically logs you into your GPG key on login so you will + never need to input your password once logged on to your system. Check the + repo and directions out [here](https://github.com/cruegge/pam-gnupg). +- `lynx` - view HTML email in neomutt. +- `notmuch` - index and search mail. Install it and run `notmuch setup`, tell + it that your mail is in `~/.local/share/mail/` (although `mw` will do this + automatically if you haven't set notmuch up before). You can run it in mutt + with <kbd>ctrl-f</kbd>. Run `notmuch new` to process new mail. +- `abook` - a terminal-based address book. Pressing tab while typing an address + to send mail to will suggest contacts that are in your abook. +- `urlview` - outputs urls in mail to browser. +- `cronie` - (or any other major cronjob manager) to set up automatic mail + syncing. +- `mpop` - If you want to use POP protocol instead of IMAP. + + +## Usage + +The mutt-wizard runs via the command `mw`. Once setup is complete, you'll use +`neomutt` to access your mail. + +- `mw -a you@email.com` -- add a new email account +- `mw -l` -- list existing accounts +- `mw -d` -- choose an account to delete +- `mw -D your@email.com` -- delete account settings without confirmation +- `mw -t 30` -- toggle automatic mailsync to every 30 minutes +- `mw -T` -- toggle mailsync without specifying minutes (default is 10) +- `mw -r` -- reorder account shortcut numbers +- `pass edit mw-your@email.com` -- revise an account's password +- `mailsync` -- sync all configured email accounts. Also gives notifications of new mail and indexes new mail with notmuch silently. +- `mailsync your@email.com` -- sync a particular (or several) email account(s). + +### Options usable when adding an account + +#### Providing arguments + +- `-u` -- Give an account username if different from the email address. +- `-n` -- A real name to be used by the account. Put in quotations if multiple + words. +- `-i` -- IMAP server address +- `-I` -- IMAP server port (otherwise assumed to be 993) +- `-s` -- SMTP server address +- `-S` -- SMTP server port (otherwise assumed to be 465) +- `-m` -- Maximum number of emails to be kept offline. No maximum is default + functionality. +- `-x` -- Account password. You will be prompted for it otherwise. + +#### General Settings + +- `-f` -- Assume mailbox names and force account configuration without + connecting online at all. +- `-o` -- Configure mutt for an account, but do not keep mail offline. +- `-p` -- Use POP protocol instead of IMAP (requires `mpop` installed). +- `mailsync` gives visual messages of new mail by default. Or, set + `MAILSYNC_MUTE=1` as an environmental variable if you prefer not having them. + +## Neomutt user interface + +To give you an example of the interface, here's an idea: + +- <kbd>m</kbd> - send mail (uses your default `$EDITOR` to write) +- <kbd>j</kbd>/<kbd>k</kbd> and <kbd>d</kbd>/<kbd>u</kbd> - vim-like bindings to go down and up (or <kbd>d</kbd>/<kbd>u</kbd> to go + down/up a page). +- <kbd>l</kbd> - open mail, or attachment page or attachment +- <kbd>h</kbd> - the opposite of <kbd>l</kbd> +- <kbd>r</kbd>/<kbd>R</kbd> - reply/reply all to highlighted mail +- <kbd>s</kbd> - save selected mail or selected attachment +- <kbd>gs</kbd>,<kbd>gi</kbd>,<kbd>ga</kbd>,<kbd>gd</kbd>,<kbd>gS</kbd> - Press <kbd>g</kbd> followed by another letter to change + mailbox: <kbd>s</kbd>ent, <kbd>i</kbd>nbox, <kbd>a</kbd>rchive, <kbd>d</kbd>rafts, <kbd>S</kbd>pam, etc. +- <kbd>M</kbd> and <kbd>C</kbd> - For <kbd>M</kbd>ove and <kbd>C</kbd>opy: follow them with one of the mailbox + letters above, i.e. <kbd>MS</kbd> means "move to Spam". +- <kbd>i#</kbd> - Press <kbd>i</kbd> followed by a number 1-9 to go to a different account. If you + add 9 accounts via mutt-wizard, they will each be assigned a number. +- <kbd>a</kbd> to add address/person to abook and <kbd>Tab</kbd> while typing address to complete + one from abook. +- <kbd>?</kbd> - see all keyboard shortcuts +- <kbd>ctrl-j</kbd>/<kbd>ctrl-k</kbd> - move up and down in sidebar, <kbd>ctrl-o</kbd> opens mailbox. +- <kbd>ctrl-b</kbd> - open a menu to select a URL you want to open in your browser. +- <kbd>p</kbd> - encrypt/sign your message (in compose view, before sending the email). + +## Additional functionality + +- `pam-gnupg` - Automatically logs you into your GPG key on login, so you will + never need to input your password once logged on to your system. Check the + repo and directions out [here](https://github.com/cruegge/pam-gnupg). +- `lynx` - View HTML email in neomutt. +- `notmuch` - Index and search mail. Install it and run `notmuch setup`, tell it + that your mail is in `~/.local/share/mail/` (although `mw` will do this + automatically if you haven't set notmuch up before). You can run it in mutt + with <kbd>ctrl-f</kbd>. Run `notmuch new` to process new mail. +- `abook` - A terminal-based address book. Pressing tab while typing an address + to send mail to will suggest contacts that are in your abook. +- `urlview` - Outputs URLs in an email to your browser. + +## New stuff and improvements since the original release + +- `mw` is now scriptable with command-line options and can run successfully + without any interaction, making it possible to deploy in a script. +- `isync`/`mbsync` has replaced `offlineimap` as the backend. Offlineimap was + error-prone, bloated, used obsolete Python 2 modules, and required separate + steps to install the system. +- `mw` is now an installed program instead of just a script needed to be kept in + your mutt folder. +- `dialog` is no longer used and the interface is simply text commands. +- More autogenerated shortcuts that allow quickly moving and copying mail + between boxes. +- More elegant attachment handling. Image/video/pdf attachments without relying + on the neomutt instance. +- abook integration by default. +- The messy template files and other directories have been moved or removed, + leaving a clean config folder. +- msmtp configs moved to `~/.config/` and mail default location moved to + `~/.local/share/mail/`, reducing mess in `~`. +- `pass` is used as a password manager instead of separately saving passwords. +- Script is POSIX sh compliant. +- Error handling for the many people who don't read or follow directions. Fewer + errors generally. +- Addition of a manual `man mw` +- Now handles POP protocol via `mpop` for those who prefer it (add an account + with the `-p` option). POP configs are still generated automatically. + +## Help the Project! + + +- Try mutt-wizard out on weird machines and weird email addresses and report any + errors. +- Open a PR to add new server information into `domains.csv` so their users can + more easily use mutt-wizard. +- If nothing else, donate: + - XMR: `8AzeWXhJvYJ1VeENHcNXCR1dLMgDALreZ1BdooZVjRKndv6myr3t1ue6C4ML2an5fWSpcP1sTDA9nKUMevkukDXG6chRjNv` + - BTC: `bc1qacqfp36ffv9mafechmvk8f6r8qy4tual6rcm9p` + +## Details for Tinkerers + +- The critical `mutt`/`neomutt` files are in `~/.config/mutt/`. +- Put whatever global settings you want in `muttrc`. mutt-wizard will add some + lines to this file, which you shouldn't remove unless you know what you're + doing, but you can move them up/down over your config lines if you need to. If + you get binding conflict errors in mutt, you might need to do this. +- Each of the accounts that mutt-wizard generates will have custom settings set + in a separate file in `accounts/`. You can edit these freely if you want to + tinker with settings specific to an account. +- In `/usr/share/mutt-wizard` are several global config files, including + `mutt-wizard`'s default settings. You can override this in your `muttrc` if + you wish. + +## Watch out for these things + +- Gmail accounts need to create an + [App Password](https://support.google.com/accounts/answer/185833?hl=en) to + use with "less secure" applications. This password is single-use (i.e. + for setup) and will be stored and encrypted locally. Enabling third-party + applications requires turning off two-factor authentication and this will + circumvent that. You might also need to manually "Enable IMAP" in the + settings. + To create an App Password for your Google account, + you can directly visit the [App Passwords](https://myaccount.google.com/apppasswords) page in your Google Account settings. +- If you have a university email or enterprise-hosted email for work, there + might be other hurdles or two-factor authentication you have to jump through. + Some, for example, will want you to create a separate IMAP password, etc. +- `isync` is not fully UTF-8 compatible, so non-Latin characters may be garbled + (although sync should succeed). `mw` will also not auto-create mailbox + shortcuts since it is looking for English mailbox names. I strongly recommend + you to set your email language to English on your mail server to avoid these + problems. + +## License + +mutt-wizard is free/libre software. This program is released under the GPLv3 +license, which you can find in the file [LICENSE](LICENSE). diff --git a/bin/mailsync b/bin/mailsync new file mode 100755 index 0000000..cbd36ff --- /dev/null +++ b/bin/mailsync @@ -0,0 +1,112 @@ +#!/bin/sh + +# - Syncs mail for all accounts, or a single account given as an argument. +# - Displays a notification showing the number of new mails. +# - Displays a notification for each new mail with its subject displayed. +# - Runs notmuch to index new mail. +# - This script can be set up as a cron job for automated mail syncing. + +# There are many arbitrary and ugly features in this script because it is +# inherently difficult to pass environmental variables to cronjobs and other +# issues. It also should at least be compatible with Linux (and maybe BSD) with +# Xorg and MacOS as well. + +# Run only if not already running in other instance +pgrep mbsync >/dev/null && { echo "mbsync is already running."; exit ;} + +# First, we have to get the right variables for the mbsync file, the pass +# archive, notmuch and the GPG home. This is done by searching common profile +# files for variable assignments. This is ugly, but there are few options that +# will work on the maximum number of machines. +eval "$(grep -h -- \ + "^\s*\(export \)\?\(MBSYNCRC\|MPOPRC\|PASSWORD_STORE_DIR\|PASSWORD_STORE_GPG_OPTS\|NOTMUCH_CONFIG\|GNUPGHOME\|MAILSYNC_MUTE\|XDG_CONFIG_HOME\|XDG_DATA_HOME\)=" \ + "$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \ + "$HOME/.config/zsh/.zshenv" "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" \ + "$HOME/.pam_environment" 2>/dev/null)" + +export GPG_TTY="$(tty)" + +[ -n "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" || MBSYNCRC="$HOME/.mbsyncrc" +[ -n "$MPOPRC" ] || MPOPRC="$HOME/.config/mpop/config" + +lastrun="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" + +# Settings are different for MacOS (Darwin) systems. +case "$(uname)" in + Darwin) notify() { osascript -e "display notification \"$2\" with title \"$1\"" ;} ;; + *) + case "$(readlink -f /sbin/init)" in + *systemd*|*openrc*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; + esac + # remember if a display server is running since `ps` doesn't always contain a display + pgrepoutput="$(pgrep -ax X\(\|org\|wayland\))" + displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)" + [ -z "$displays" ] && [ -d /tmp/.X11-unix ] && displays=$(cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; done) + + notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-:0}; do + export DISPLAY="$x" + notify-send --app-name="mutt-wizard" "$1" "$2" + done ;} + ;; +esac + +# Check account for new mail. Notify if there is new content. +syncandnotify() { + case "$1" in + imap) mbsync -q "$2" ;; + pop) mpop -q "$2" ;; + esac + new=$(find\ + "$HOME/.local/share/mail/$2/"[Ii][Nn][Bb][Oo][Xx]/new/ \ + "$HOME/.local/share/mail/$2/"[Ii][Nn][Bb][Oo][Xx]/cur/ \ + -type f -newer "$lastrun" 2> /dev/null) + newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) + case 1 in + $((newcount > 5)) ) + echo "$newcount new mail for $2." + [ -z "$MAILSYNC_MUTE" ] && notify "New Mail!" "📬 $newcount new mail(s) in \`$2\` account." + ;; + $((newcount > 0)) ) + echo "$newcount new mail for $2." + [ -z "$MAILSYNC_MUTE" ] && + for file in $new; do + # Extract and decode subject and sender from mail. + subject="$(sed -n "/^Subject:/ s|Subject: *|| p" "$file" | + perl -CS -MEncode -ne 'print decode("MIME-Header", $_)')" + from="$(sed -n "/^From:/ s|From: *|| p" "$file" | + perl -CS -MEncode -ne 'print decode("MIME-Header", $_)')" + from="${from% *}" ; from="${from%\"}" ; from="${from#\"}" + notify "📧$from:" "$subject" + done + ;; + *) echo "No new mail for $2." ;; +esac +} + +allaccounts="$(grep -hs "^\(Channel\|account\)" "$MBSYNCRC" "$MPOPRC")" + +# Get accounts to sync. All if no argument. Prefix with `error` if non-existent. +IFS=' +' +if [ -z "$1" ]; then + tosync="$allaccounts" +else + tosync="$(for arg in "$@"; do for availacc in $allaccounts; do + [ "$arg" = "${availacc##* }" ] && echo "$availacc" && break + done || echo "error $arg"; done)" +fi + +for account in $tosync; do + case $account in + Channel*) syncandnotify imap "${account##* }" & ;; + account*) syncandnotify pop "${account##* }" & ;; + error*) echo "ERROR: Account ${account##* } not found." ;; + esac +done + +wait + +notmuch new --quiet + +#Create a touch file that indicates the time of the last run of mailsync +touch "$lastrun" @@ -0,0 +1,422 @@ +#!/bin/sh + +set -a + +prefix="/usr/local" +maildir="${XDG_DATA_HOME:-$HOME/.local/share}/mail" +muttshare="$prefix/share/mutt-wizard" +cachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard" +muttrc="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc" +accdir="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/accounts" +msmtprc="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/config" +msmtplog="${XDG_STATE_HOME:-$HOME/.local/state}/msmtp/msmtp.log" +mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}" +mpoprc="${XDG_CONFIG_HOME:-$HOME/.config}/mpop/config" +mpoptemp="$muttshare/mpop-temp" +mbsynctemp="$muttshare/mbsync-temp" +mutttemp="$muttshare/mutt-temp" +msmtptemp="$muttshare/msmtp-temp" +onlinetemp="$muttshare/online-temp" +notmuchtemp="$muttshare/notmuch-temp" +# With the use of templates, it's impossible to use parameter substitution. +# Therefore, some default variables that might be otherwise overwritten are set +# here. +iport="993" +sport="465" +imapssl="IMAPS" +tlsline="tls_starttls off" +maxmes="0" + +alias mbsync='mbsync -c "$mbsyncrc"' + +# mbsync now requires "Far/Near" rather than "Master/Slave", but Ubuntu/Debian +# have the older version. +if command -V apt-get >/dev/null 2>&1; then + master="Master" + slave="Slave" +else + master="Far" + slave="Near" +fi + +for x in "/etc/ssl/certs/ca-certificates.crt" \ + "/etc/pki/tls/certs/ca-bundle.crt" "/etc/ssl/cert.pem" \ + "/etc/ssl/ca-bundle.pem" "/etc/pki/tls/cacert.pem" \ + "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" \ + "/usr/local/share/ca-certificates/"; do + [ -f "$x" ] && sslcert="$x" && break +done || { echo "CA Certificate not found. Please install one or link it to /etc/ssl/certs/ca-certificates.crt" && exit 1; } + +checkbasics() { + command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" + PASSWORD_STORE_DIR="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] || { + echo "First run \`pass init <yourgpgemail>\` to set up a password archive." + echo "(If you don't already have a GPG key pair, first run \`$GPG --full-generate-key\`.)" + exit 1 + } +} + +getaccounts() { accounts="$(find -L "$accdir" -type f 2>/dev/null | grep -o "\S*.muttrc" | sed "s|.*/\([0-9]-\)*||;s/\.muttrc$//" | nl)"; } + +list() { getaccounts && [ -n "$accounts" ] && echo "$accounts" || exit 1; } + +prepmsmtp() { + mkdir -p "${msmtprc%/*}" "${msmtplog%/*}" + ln -s "$msmtprc" "$HOME/.msmtprc" 2>/dev/null + envsubst <"$msmtptemp" >>"$msmtprc" +} + +prepmbsync() { + mkdir -p "${mbsyncrc%/*}" + [ -f "$mbsyncrc" ] && echo >>"$mbsyncrc" + envsubst <"$mbsynctemp" >>"$mbsyncrc" +} + +prepmpop() { + mkdir -p "${mpoprc%/*}" + envsubst <"$mpoptemp" >>"$mpoprc" +} + +prepmutt() { + mkdir -p "${muttrc%/*}" "$accdir" + envsubst <"$mutttemp" >"$accdir/$fulladdr.muttrc" + [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" >"$muttrc" + ! grep -q "^source.*mutt-wizard.muttrc" "$muttrc" && echo "source $muttshare/mutt-wizard.muttrc" >>"$muttrc" + ! grep "^source.*.muttrc" "$muttrc" | grep -qv "$muttshare/mutt-wizard.muttrc" && echo "source $accdir/$fulladdr.muttrc" >>"$muttrc" + echo "macro index,pager i$idnum '<sync-mailbox><enter-command>source $accdir/$fulladdr.muttrc<enter><change-folder>!<enter>;<check-stats>' \"switch to $fulladdr\"" >>"$muttrc" +} + +getprofiles() { + safename="$(echo $fulladdr | sed 's/@/_/g')" + case "$type" in + online) + folder="imaps://$login@$imap:$iport" + extra="$(envsubst <"$onlinetemp")" + ;; + pop) prepmpop ;; + *) + case "$iport" in + 1143) imapssl=None ;; + 143) imapssl=STARTTLS ;; + esac + prepmbsync + ;; + esac + prepmsmtp + prepmutt + prepnotmuch +} + +parsedomains() { + serverinfo="$(grep "^${fulladdr#*@}" "$muttshare/domains.csv" 2>/dev/null)" + + [ -z "$serverinfo" ] && serverinfo="$(grep "$(echo "${fulladdr#*@}" | sed "s/\.[^\.]*$/\.\\\*/")" "$muttshare/domains.csv" 2>/dev/null)" + + IFS=, read -r service imapsugg iportsugg smtpsugg sportsugg <<EOF +$serverinfo +EOF + imap="${imap:-$imapsugg}" + smtp="${smtp:-$smtpsugg}" + sport="${sport:-$sportsugg}" + iport="${iport:-$iportsugg}" +} + +delete() { + if [ -z "${fulladdr+x}" ]; then + echo "Select the account you would like to delete (by number):" + list || exit 1 + read -r input + match="^\s*$input\s\+" + else + match="\s\+$fulladdr$" + getaccounts + fi + + fulladdr="$(echo "$accounts" | grep "$match" | grep -o "\S*@\S*")" + + [ -z "$fulladdr" ] && echo "$fulladdr is not a valid account name." && return 1 + + sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" 2>/dev/null + rm -f "$mbsyncrc"bu + rm -rf "${cachedir:?}/${fulladdr:?}" "$accdir/$fulladdr.muttrc" "$accdir/"[0-9]-"$fulladdr.muttrc" + sed -ibu "/\([0-9]-\)\?$fulladdr.muttrc/d" "$muttrc" 2>/dev/null + rm -f "$muttrc"bu + sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$msmtprc" 2>/dev/null + rm -f "$msmtprc"bu + sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$mpoprc" 2>/dev/null + rm -f "$mpoprc"bu + pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1 + [ -n "${purge+x}" ] && safename="$(echo $fulladdr | sed 's/@/_/g')" && rm -rf "${cachedir:?}/${safename:?}" "${maildir:?}/${fulladdr:?}" +} + +askinfo() { + [ -z "$fulladdr" ] && echo "Give the full email address to add:" && + read -r fulladdr + while ! echo "$fulladdr" | grep -qE "^.+@.+\.[A-Za-z]+$"; do + echo "$fulladdr is not a valid email address. Please retype the address:" + read -r fulladdr + done + folder="$maildir/$fulladdr" + getaccounts + echo "$accounts" | grep -q "\s$fulladdr$" 2>/dev/null && + { echo "$fulladdr has already been added" && exit 1; } + { [ -z "$imap" ] || [ -z "$smtp" ]; } && parsedomains + [ -z "$imap" ] && echo "Give your email server's IMAP address (excluding the port number):" && + read -r imap + [ -z "$smtp" ] && echo "Give your email server's SMTP address (excluding the port number):" && + read -r smtp + case $sport in + 587) tlsline="# tls_starttls" ;; + esac + [ -z "$realname" ] && realname="${fulladdr%%@*}" + [ -z "$passprefix" ] && passprefix="" + hostname="${fulladdr#*@}" + login="${login:-$fulladdr}" + if [ -n "${password+x}" ] && [ ! -f "$PASSWORD_STORE_DIR/$passprefix$fulladdr.gpg" ]; then + insertpass + elif [ ! -f "$PASSWORD_STORE_DIR/$passprefix$fulladdr.gpg" ]; then + getpass + fi +} + +insertpass() { + printf "%s" "$password" | pass insert -fe "$PASSWORD_STORE_DIR/$passprefix$fulladdr" +} + +errorexit() { + echo "Log-on not successful." + case "$imap" in + imap.gmail.com) + echo "This account with $service is using Google's Gmail servers, which disable all third-party applications without an application-specific password. +Please be sure you are using OAUTH with your Gmail account, or better yet, stop using Gmail." + ;; + imap.mail.me.com) + echo "This account with $service is using Apple's iCloud servers, which disable all non-Apple applications by default. +Please be sure you either enable third-party applications, or create an app-specific password, or best of all, stop using Apple." + ;; + esac + exit 1 +} + +getpass() { while :; do + pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1 + pass insert -f "$passprefix$fulladdr" && break +done; } + +getboxes() { + if [ -n "${force+x}" ]; then + mailboxes="$(printf "INBOX\\nDrafts\\nJunk\\nTrash\\nSent\\nArchive")" + else + info="$(curl --location-trusted -s -m 5 --user "$login:$(pass "$passprefix$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")" + [ -z "$info" ] && errorexit + mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')" + fi + [ "$type" = "pop" ] && mailboxes="INBOX" + for x in $( + sed -n "/^macro.* i[0-9] / s/\(^macro.* i\| .*\)//gp " "$muttrc" 2>/dev/null | sort -u + echo 0 + ); do + idnum=$((idnum + 1)) + [ "$idnum" -eq "$x" ] || break + done + toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/;s/'/\\\'/g" | paste -sd ' ' -)" +} + +finalize() { + echo "$toappend" >>"$accdir/$fulladdr.muttrc" + [ "$type" != "online" ] && echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$fulladdr/{}/cur" "$maildir/$fulladdr/{}/tmp" "$maildir/$fulladdr/{}/new" + mkdir -p "$cachedir/$safename/bodies" + echo "$fulladdr (account #$idnum) added successfully." + command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" >"$HOME/.urlview" + return 0 +} + +prepnotmuch() { + [ -z "$NOTMUCH_CONFIG" ] && NOTMUCH_CONFIG="$HOME/.notmuch-config" + [ -f "$NOTMUCH_CONFIG" ] && return 0 + envsubst <"$notmuchtemp" >"$NOTMUCH_CONFIG" +} + +togglecron() { + cron="$(mktemp)" + crontab -l >"$cron" + if grep -q mailsync "$cron"; then + echo "Removing automatic mailsync..." + sed -ibu /mailsync/d "$cron" + rm -f "$cron"bu + else + echo "Adding automatic mailsync every ${cronmin:-10} minutes..." + echo "*/${cronmin:-10} * * * * $prefix/bin/mailsync" >>"$cron" + fi && + crontab "$cron" + rm -f "$cron" +} + +setact() { if [ -n "${action+x}" ] && [ "$action" != "$1" ]; then + echo "Running $1 with $action..." + echo "Incompatible options given. Only one action may be specified per run." + exit 1 +else + action="$1" +fi; } + +mwinfo() { + cat <<EOF +mw: mutt-wizard, auto-configure email accounts for mutt +including downloadable mail with \`isync\`. + +Main actions: + -a your@email.com Add an email address + -l List email addresses configured + -d Remove an already added address + -D your@email.com Force remove account without confirmation + -t number Toggle automatic mailsync every <number> minutes + -T Toggle automatic mailsync + -r Reorder account numbers + +Options allowed with -a: + -u Account login name if not full address + -n "Real name" to be on the email account + -i IMAP/POP server address + -I IMAP/POP server port + -s SMTP server address + -S SMTP server port + -x Password for account (recommended to be in double quotes) + -p Add for a POP server instead of IMAP. + -P Pass Prefix (prefix of the file where password is stored) + -X Delete an account's local email too when deleting. + -o Configure address, but keep mail online. + -f Assume typical English mailboxes without attempting log-on. + +NOTE: Once at least one account is added, you can run +\`mbsync -a\` to begin downloading mail. + +To change an account's password, run \`pass edit '$passprefix'your@email.com\`. +EOF +} + +reorder() { + tempfile="$(mktemp -u)" + trap 'rm -f $tempfile' HUP INT QUIT TERM PWR EXIT + echo "# Carefully reorder these accounts with the desired numbers in the first column. +# DO NOT reorder rows or rename the accounts in the second column." >"$tempfile" + sed -n " + / i[0-9] / s?\(.* i\|'<sync.*/\|\.muttrc.*\)??g p + " "$muttrc" >>"$tempfile" + ${EDITOR:-vim} "$tempfile" || exit 1 + sed -i -e 's/#.*//' -e '/^$/d' "$tempfile" + default="$(sort -n "$tempfile" | head -n 1)" + default="${default#* }" + sed -ibu " + /.* i[0-9] .*.muttrc/d + /^source.*accounts.*.muttrc/d + " "$muttrc" 2>/dev/null + rm -f "$muttrc"bu + awk -v a="$accdir" -v d="$default" ' BEGIN { print "source "a"/"d".muttrc" } + { + print "macro index,pager i"$1" '\''<sync-mailbox><enter-command>source "a"/"$2".muttrc<enter><change-folder>!<enter>;<check-stats>'\'' \"switch to "$2"\"" + } + ' "$tempfile" >>"$muttrc" +} + +while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:P:x:m:t:" o; do case "${o}" in + l) setact list ;; + r) setact reorder ;; + d) setact delete ;; + D) + setact delete + fulladdr="$OPTARG" + ;; + y) + setact sync + fulladdr="$OPTARG" + ;; + Y) setact sync ;; + a) + setact add + fulladdr="$OPTARG" + ;; + i) + setact add + imap="$OPTARG" + ;; + I) + setact add + iport="$OPTARG" + ;; + s) + setact add + smtp="$OPTARG" + ;; + S) + setact add + sport="$OPTARG" + ;; + u) + setact add + login="$OPTARG" + ;; + n) + setact add + realname="$OPTARG" + ;; + P) + setact add + passprefix="$OPTARG" + ;; + m) + setact add + maxmes="$OPTARG" + ;; + o) + setact add + type="online" + ;; + p) + setact add + type="pop" + protocol="pop3s" + iport="${iport:-995}" + ;; + f) + setact add + force=True + ;; + x) + setact add + password="$OPTARG" + ;; + X) + setact delete + purge=True + ;; + t) + setact toggle + cronmin="$OPTARG" + ;; + T) setact toggle ;; + h) setact info ;; + \?) + echo "See \`$(basename $0) -h\` for possible options and help." + exit 1 + ;; + esac done + +[ -z "$action" ] && action="info" + +case "$action" in +list) list ;; +add) checkbasics && askinfo && getboxes && getprofiles && finalize ;; +delete) delete ;; +sync) + echo "\`mw -y\` and \`mw -Y\` are now deprecated and will be removed in a future update. Please switch to using \`mailsync\`." + mailsync $fulladdr + ;; +toggle) togglecron ;; +reorder) reorder ;; +info) + mwinfo + exit 1 + ;; +esac diff --git a/completion/_mutt-wizard.zsh b/completion/_mutt-wizard.zsh new file mode 100644 index 0000000..18c3e2e --- /dev/null +++ b/completion/_mutt-wizard.zsh @@ -0,0 +1,45 @@ +#compdef mw + +_arguments \ + '1:flag:->flags' \ + '*:: :->args' + +case "$state" in + flags) + local -a opts + opts=( + '-a:Add an email address' + '-l:List email addresses configured' + '-d:Remove an already added address' + '-D:Force remove account without confirmation' + '-y:Sync mail for account by name' + '-Y:Sync mail for all accounts' + '-t:Toggle automatic mailsync every <number> minutes' + '-T:Toggle automatic mailsync every 10 minutes' + '-r:order account numbers' + ) + _describe 'flags' opts + ;; + args) + case $line[1] in + -a) + _alternative \ + 'args: :(( + -u\:"Account login name if not full address" + -n\:"Real name to be on the email account" + -i\:"IMAP/POP server address" + -I\:"IMAP/POP server port" + -s\:"SMTP server address" + -S\:"SMTP server port" + -x\:"Password for account (recommended to be in double quotes)" + -P\:"Pass Prefix (prefix of the file where password is stored)" + -p\:"Add for a POP server instead of IMAP." + -X\:"Delete an account'"'"'s local email too when deleting." + -o\:"Configure address, but keep mail online." + -f\:"Assume typical English mailboxes without attempting log-on." + ))' + ;; + -D|-y) + _values 'email list' $(mw -l | cut -f2) 2>/dev/null + esac +esac diff --git a/lib/openfile b/lib/openfile new file mode 100755 index 0000000..0f60b10 --- /dev/null +++ b/lib/openfile @@ -0,0 +1,10 @@ +#!/bin/sh + +# Helps open a file with xdg-open from mutt in a external program without weird side effects. +tempdir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard/files" +file="$tempdir/${1##*/}" +[ "$(uname)" = "Darwin" ] && opener="open" || opener="setsid -f xdg-open" +mkdir -p "$tempdir" +cp -f "$1" "$file" +$opener "$file" >/dev/null 2>&1 +find "${tempdir:?}" -mtime +1 -type f -delete diff --git a/mailsync.1 b/mailsync.1 new file mode 100644 index 0000000..e9bdd6d --- /dev/null +++ b/mailsync.1 @@ -0,0 +1,57 @@ +.TH MAILSYNC 1 +.SH NAME +mailsync \- sync mail accounts set up with +.B mw. +.SH SYNOPSIS +.B mailsync +[ +.I OPTIONS +]... [ +.I ACCOUNTS +] +.SH DESCRIPTION +.B mailsync +syncs the mail of all accounts set up with +.B +mw, +or if account names are given, syncs only those accounts. + +.B +mailsync +is a wrapper for +.B mbsync +and +.B +mpop, +but also automatically reindexes new mail with +.B notmuch, +gives notifications if new mail is found and can also be set as a cronjob to sync and index mail quietly in the background. +.SH COMMANDS +.TP +.B mailsync +sync all mail accounts and notify user if there is new mail +.TP +.B mailsync account@example.org +only sync the +.B account@example.org +account. +.SH CONFIGURATION +While +.B +mailsync +gives notifications on the arrival of new mail by default, this can be diabled by setting the variable +.I +MAILSYNC_MUTE=1. +.SH AUTHORS +Written by Luke Smith <luke@lukesmith.xyz> originally in 2018. +.SH LICENSE +GPLv3 +.SH SEE ALSO +.BR mw (1), +.BR neomutt (1), +.BR neomuttrc (1) +.BR mbsync (1), +.BR mpop (1), +.BR msmtp (1), +.BR notmuch (1), +.BR abook (1) @@ -0,0 +1,302 @@ +.TH MW 1 mutt-wizard +.SH NAME +mw \- mutt-wizard \- autoconfigure email accounts for neomutt and isync +.SH SYNOPSIS +.B mw +[ +.I OPTIONS +] +.SH DESCRIPTION +.B mw +takes a user email account and sets up a terminal-based email interface for it with +.B neomutt. +This can include offline email with +.B isync/mbsync +and configs for +.B msmtp +for sending mail, and also passwords automatically encrypted and stored with +.B pass. +.SH COMMANDS +.TP +.B -a your@email.com +add an email address +.TP +.B -l +list all email accounts configured by mutt-wizard +.TP +.B -d +pick an already configured account and remove its configuration +.TP +.B -D your@email.com +remove a configured account without confirmation +.TP +.B -y your@email.com +download and upload mail for an email account +.TP +.B -Y +sync all email accounts +.TP +.B -t 15 +toggle a cronjob that syncs your mail every 15 minutes (or any other number under 60) +.TP +.B -T +toggle a cronjob without specifying minutes between sync +.TP +.B -r +reorder account shortcut numbers +.SH OPTIONS FOR ADDING ACCOUNTS +These can be specified on the command line, otherwise, you will be prompted for what is necessary. mutt-wizard knows the IMAP/SMTP server information for most email providers, so specifying them is usually redundant. +.TP +.B -u billy +Account logon/username if required and different from email address. +.TP +.B -n Billy +Real name which will appear in emails. Should be put in quotes if multiple words. +.TP +.B -m number +Set a maximum number of messages to be stored offline. +.TP +.B -i +IMAP/POP server address +.TP +.B -I +IMAP/POP server port (assumed to be 993 for IMAP and 995 for POP if not specified) +.TP +.B -s +SMTP server address +.TP +.B -S +SMTP server port (assumed to be 465 if not specified) +.TP +.B -x +Account password. You will be prompted for the password interactively if this option is not given. +.B -P +Pass Prefix. The password will be stored using pass at <passprefix><email> +.SH OTHER OPTIONS +.TP +.B -f +Force account creation and guess mailboxes without attempting to connect to server. Otherwise if connection cannot be made, the configured account settings will not be persistent. +.TP +.B -o +Create settings for an account to be used online only without mail syncing abilities. Without +.B -f +connection will still be attempted in setup to discover mailboxes. +.TP +.B -X +When removing an email profile with either +.I -d +or +.I -D, +also delete the local mail (will not delete the mail on the server). +.TP +.B -p +Use POP protocol instead of IMAP. Requires +.I mpop +to download mail after configuration. Server details can still be given with the +.I -i +and +.I -I +options as if it were a IMAP. +.SH DETAILS +.TP +.B mailsync +mutt-wizard calls a script +.I mailsync +to sync mail. This script additionally indexes new mail with notmuch and gives you a notification if new mail has arrived. If you want to bypass its additional features, you can always just run +.I mbsync -a +to sync your mail directly. +.TP +.B Mail location +If the user chooses to keep offline email with +.B isync, +it will be kept in +.I ~/.local/share/mail/. +.B notmuch +can be used to index and search this mail by giving this directory when first running +.B notmuch setup. +If you have not set up notmuch before, mutt-wizard will automatically set it up in the background the first time you add an account. +.TP +.B muttrc files +mutt-wizard will create a muttrc file for each created account holding account-specific details. These will appear in +.I ~/.config/mutt/accounts/ +and can be edited by the user if needbe. Note that the mutt-wizard will also source these files and create the bindings to switch between them, and these will appear in your default +.I ~/.config/mutt/muttrc +file. +.TP +.B Mail deletion +mutt-wizard's delete action will delete configuration files and +.I not +downloaded mail for safety (and time)'s sake. If you want to delete downloaded mail, do so manually by removing it from the directory above. +.TP +.B Default settings +The mutt-wizard has many default settings that focus on making it aesthetically pleasing and supplying more vim-like bindings. These can be found in +.I /usr/local/share/mutt-wizard/mutt-wizard.muttrc +and the default mailcap file can be found in +.I +/usr/local/share/mutt-wizard/mailcap. +Any of these settings can be overwritten in +.I ~/.config/mutt/muttrc, +but be mindful that your overriding binds should appear after the +.I +mutt-wizard.muttrc +file is sourced. +.TP +.B Detecting server settings +mutt-wizard has a repository of email services and their server information kept in +.I /usr/local/share/mutt-wizard/domains.csv +which is used to automatically configure email settings. +If your email provider is not found there, it will prompt you to input your email service's IMAP and SMTP server information which can usually be found by searching online. + +If you would like to help develop mutt-wizard for others, you are invited to add this service information to +.I domains.csv +on mutt-wizard's Github <https://github.com/lukesmithxyz/mutt-wizard> or Gitlab <https://gitlab.com/lukesmithxyz/mutt-wizard> pages. +.TP +.B Gmail accounts +Google will require you to allow "less-secure" (third party) applications or remove two-factor authentication in order to access their IMAP servers to download your mail. If you use Gmail, be sure to handle this before running mutt-wizard <https://support.google.com/accounts/answer/6010255>. +.TP +.B Enterprise and university accounts +Many universities and businesses might host their domain's email via Google or another service. This often requires a special IMAP/SMTP-specific password that you must generate and use. Again, mutt-wizard can handle these systems, but only once they've been set up. +.TP +.B Password decryption +mutt-wizard uses +.I pass +and therefore +.I gpg +to decrypt your passwords. Provided your GPG key has a password, this might mean that you will be prompted for your GPG password the first time you sync or send mail in a session. Once your password is cached, it might also expire later as well. + +Because of this I strongly recommend the program +.I pam-gnupg +<https://github.com/cruegge/pam-gnupg> which automatically unlocks your GPG password on login and keeps it active, thus giving you, with mutt-wizard, secure access to all your email accounts on your system without ever having to input a password. + +If you don't want to use this program, you can also increase the cache time of an inputted GPG password with the +.I default-cache-ttl +and +.I max-cache-ttl +variables in your +.I +gpg-agent.conf. +.SH MUTT-WIZARD'S NEOMUTT CONFIGURATION +Here is a list of not only mutt-wizard's particular defaults, but what you need to get the most out of email accounts configured with mutt-wizard. +.TP +.B Color +The mutt-wizard's default settings add color to messages in the index and color mail details to make them easier to see. New mail, in addition to being marked by the typical N, will also be bold. +.TP +.B Movement with h/j/k/l +Use vim keys to move down +.I j +or up +.I k +in mail, while +.I l +opens mail, then the attachment view, then an attachment, while +.I h +is the reverse. +While mail is open, go to next or previous mail with +.I J +and +.I K. +In the mail index, +.I d +and +.I u +go down and up by a half page and +.I gg +and +.I G +go to the very top and very bottom. +.TP +.B Search mail +If you have +.B notmuch +configured with your proper mail directory (see above), you may run +.I ctrl-f +to search for mail containing any given sequence. +Even without notmuch, +.I L +limits mail, showing only those with the given sequence in the subject while +.I A +shows all mail (same as limiting to "all"). +.TP +.B Deleting mail +.I D +deletes mail, while +.I U +undeletes it (type in mail number to get to deleted mail). Note that +.I S +saves your mailbox, finalizing deletion. If you have a +.I Trash +box, deleted mail is moved there. If you want it to skip that and simply be deleted, comment out or remove the +.I set trash +line in that account's muttrc. +.TP +.B Send mail +.I m +creates a new mail message; +.I r +replies to the selected message; +.I R +replies all to the selected message and +.I f +forwards the selected message. +.TP +.B Compose mail screen +Once you write mail and save the buffer you will be brought to the compose screen. Press +.I a +to add attachments, use +.I s/t/c/b/d +to change the subject/to/CC/BCC/description. Press +.I S +to change the signature/encryption. Press +.I y +to send the mail. +.TP +.B Saving and autocompleting email addresses with abook +Install the optional dependency abook and you will be able to save the sender's email address with +.I a. +Once this is done, when you are typing in any email/contact prompt, you may press +.I Tab +to find contacts matching your input. Although abook is often used with mutt, it is also a useful program in its own right. +.TP +.B Switching and moving mail between mailboxes +The +.I g +key can be paired with several other keys to automatically move to another mailbox: gi: Inbox; gs: Sent; gd: Drafts; ga: Archive; gS: Spam; gj: Junk; gt: Trash. These bindings will only be present for accounts that have the boxes in question. Instead of +.I g, +you can also press +.I C +to copy mail or +.I M +to move mail to the same boxes. +.TP +.B Switching between accounts +mutt-wizard can configure as many as nine accounts each numbered by the lowest available number when configured. Press +.I i +followed by an account's number to change to that account: i2, i5, etc. +.I ctrl-b +to open a menu to select a url you want to open in you browser. +.TP +.B Sidebar +mutt-wizard enables the sidebar by default which displays your account's boxes with mail tallies. +.I B +will toggle the sidebar. Move up and down in it with +.I ctrl-k/j. +Open a box with +.I ctrl-o. +.TP +.B More information +Remember that you can press +.I ? +at any time in neomutt to get a list of all key-bindings and functions. This list can also vary for different context menus. +.SH AUTHORS +Written by Luke Smith <luke@lukesmith.xyz> originally in 2018. +.SH LICENSE +GPLv3 +.SH SEE ALSO +.BR mailsync (1), +.BR neomutt (1), +.BR neomuttrc (1) +.BR mbsync (1), +.BR mpop (1), +.BR msmtp (1), +.BR notmuch (1), +.BR abook (1) diff --git a/share/domains.csv b/share/domains.csv new file mode 100644 index 0000000..beb7a1e --- /dev/null +++ b/share/domains.csv @@ -0,0 +1,343 @@ +ADDRESS,IMAP,imap port,SMTP,smtp port +126.com,imap.126.com,993,smtp.126.com,587 +163.com,imap.163.com,993,smtp.163.com,587 +3nt3.de,mail.3nt3.de,993,mail.3nt3.de,465 +420blaze.it,mail.cock.li,993,mail.cock.li,587 +8chan.co,mail.cock.li,993,mail.cock.li,587 +aaathats3as.com,mail.cock.li,993,mail.cock.li,587 +accountant.com,imap.mail.com,993,smtp.mail.com,587 +activist.com,imap.mail.com,993,smtp.mail.com,587 +ad.unsw.edu.au,outlook.office365.com,993,smtp.office365.com,587 +adexec.com,imap.mail.com,993,smtp.mail.com,587 +airmail.cc,mail.cock.li,993,mail.cock.li,587 +allergist.com,imap.mail.com,993,smtp.mail.com,587 +alumni.bits-pilani.ac.in,imap.gmail.com,993,smtp.gmail.com,465 +alumni.com,imap.mail.com,993,smtp.mail.com,587 +alumni.unitn.it,imap.gmail.com,993,smtp.gmail.com,587 +alumnidirector.com,imap.mail.com,993,smtp.mail.com,587 +alunos.utfpr.edu.br,imap.gmail.com,993,smtp.gmail.com,587 +anche.no,mail.autistici.org,993,smtp.autistici.org,465 +angelic.com,imap.mail.com,993,smtp.mail.com,587 +anu.edu.au,outlook.office365.com,993,smtp.office365.com,587 +aol.com,imap.aol.com,993,smtp.aol.com,465 +appraiser.net,imap.mail.com,993,smtp.mail.com,587 +aquilenet.fr,imap.aquilenet.fr,993,smtp.aquilenet.fr,587 +archaeologist.com,imap.mail.com,993,smtp.mail.com,587 +arcticmail.com,imap.mail.com,993,smtp.mail.com,587 +artlover.com,imap.mail.com,993,smtp.mail.com,587 +asia.com,imap.mail.com,993,smtp.mail.com,587 +auctioneer.net,imap.mail.com,993,smtp.mail.com,587 +autistiche.org,mail.autistici.org,993,smtp.autistici.org,465 +autistici.org,mail.autistici.org,993,smtp.autistici.org,465 +autograf.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +autoproduzioni.net,mail.autistici.org,993,smtp.autistici.org,465 +bartender.net,imap.mail.com,993,smtp.mail.com,587 +bastardi.net,mail.autistici.org,993,smtp.autistici.org,465 +beaumccartney.xyz,mail.beaumccartney.xyz,993,mail.beaumccartney.xyz,465 +bguth.de,wp300.webpack.hosteurope.de,993,wp300.webpack.hosteurope.de,587 +bigpond.com,imap.telstra.com,143,smtp.telstra.com,587 +bikerider.com,imap.mail.com,993,smtp.mail.com,587 +billycarlyle.uk,mail.muny.us,993,mail.muny.us,465 +biomed.ee.ethz.ch,mail.ethz.ch,993,mail.ethz.ch,587 +birdlover.com,imap.mail.com,993,smtp.mail.com,587 +bjoernguthphotography.de,wp300.webpack.hosteurope.de,993,wp300.webpack.hosteurope.de,587 +bocken.org,mail.bocken.org,993,mail.bocken.org,587 +brew-meister.com,imap.mail.com,993,smtp.mail.com,587 +bruttocarattere.org,mail.autistici.org,993,smtp.autistici.org,465 +btinternet.com,mail.btinternet.com,993,mail.btinternet.com,587 +calstatela.edu,outlook.office365.com,993,smtp.office365.com,587 +campus.fct.unl.pt,imap.gmail.com,993,smtp.gmail.com,587 +canaglie.net,mail.autistici.org,993,smtp.autistici.org,465 +canaglie.org,mail.autistici.org,993,smtp.autistici.org,465 +carleton.ca,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +cash4u.com,imap.mail.com,993,smtp.mail.com,587 +cedars.xyz,mail.cedars.xyz,993,mail.cedars.xyz,465 +ceng.metu.edu.tr,imap.ceng.metu.edu.tr,993,mailhost.ceng.metu.edu.tr,587 +cerex.no,mail.cerex.no,993,mail.cerex.no,465 +cheerful.com,imap.mail.com,993,smtp.mail.com,587 +chef.net,imap.mail.com,993,smtp.mail.com,587 +chemist.com,imap.mail.com,993,smtp.mail.com,587 +chrissx.ga,chrissx.ga,993,chrissx.ga,25 +clarkson.edu,imap.gmail.com,993,smtp.gmail.com,587 +clasnet.sunyocc.edu,outlook.office365.com,993,smtp.office365.com,587 +clerk.com,imap.mail.com,993,smtp.mail.com,587 +clubmember.org,imap.mail.com,993,smtp.mail.com,587 +cmail.carleton.ca,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +cn.edu,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +cocaine.ninja,mail.cock.li,993,mail.cock.li,587 +cock.email,mail.cock.li,993,mail.cock.li,587 +cock.li,mail.cock.li,993,mail.cock.li,587 +cock.lu,mail.cock.li,993,mail.cock.li,587 +coldmail.xyz,mail.sheriffmediocre.xyz,993,mail.sheriffmediocre.xyz,465 +collector.org,imap.mail.com,993,smtp.mail.com,587 +columnist.com,imap.mail.com,993,smtp.mail.com,587 +comcast.net,imap.comcast.net,993,smtp.comcast.net,465 +comic.com,imap.mail.com,993,smtp.mail.com,587 +computer4u.com,imap.mail.com,993,smtp.mail.com,587 +consultant.com,imap.mail.com,993,smtp.mail.com,587 +contractor.net,imap.mail.com,993,smtp.mail.com,587 +coolsite.net,imap.mail.com,993,smtp.mail.com,587 +counsellor.com,imap.mail.com,993,smtp.mail.com,587 +cryptolab.net,mail.autistici.org,993,smtp.autistici.org,465 +cumallover.me,mail.cock.li,993,mail.cock.li,587 +cyberservices.com,imap.mail.com,993,smtp.mail.com,587 +datentopf.org,mail.datentopf.org,993,mail.datentopf.org,587 +deliveryman.com,imap.mail.com,993,smtp.mail.com,587 +dicksinhisan.us,mail.cock.li,993,mail.cock.li,587 +dicksinmyan.us,mail.cock.li,993,mail.cock.li,587 +diplomats.com,imap.mail.com,993,smtp.mail.com,587 +dismail.de,imap.dismail.de,993,smtp.dismail.de,465 +disroot.org,disroot.org,993,disroot.org,587 +distruzione.org,mail.autistici.org,993,smtp.autistici.org,465 +domeneshop.no,imap.domeneshop.no,993,smtp.domeneshop.no,587 +dorriseaton.com,outlook.office365.com,993,smtp.office365.com,587 +dr.com,imap.mail.com,993,smtp.mail.com,587 +duke.edu,outlook.office365.com,993,smtp.office365.com,587 +e.email,mail.ecloud.global,993,mail.ecloud.global,587 +email.arizona.edu,imap.gmail.com,993,smtp.gmail.com,587 +email.com,imap.mail.com,993,smtp.mail.com,587 +eneco.com,outlook.office365.com,993,smtp.office365.com,587 +engineer.com,imap.mail.com,993,smtp.mail.com,587 +erciyes.edu.tr,mail.erciyes.edu.tr,993,mail.erciyes.edu.tr,587 +ethancoe.com,mail.privateemail.com,993,mail.privateemail.com,465 +ethz.ch,mail.ethz.ch,993,mail.ethz.ch,587 +etu.sorbonne-universite.fr,imaps.sorbonne-universite.fr,993,smtps.sorbonne-universite.fr,465 +etu.upmc.fr,imaps.sorbonne-universite.fr,993,smtps.sorbonne-universite.fr,465 +europe.com,imap.mail.com,993,smtp.mail.com,587 +ex-studenti.unitn.it,imap.gmail.com,993,smtp.gmail.com,587 +faks.no,mail.uniweb.no,993,mail.uniweb.no,465 +fastmail.com,imap.fastmail.com,993,smtp.fastmail.com,465 +fastmail.fm,imap.fastmail.com,993,smtp.fastmail.com,465 +fct.unl.pt,imap.gmail.com,993,smtp.gmail.com,587 +fidei.email,box.fidei.email,993,box.fidei.email,465 +firemail.cc,mail.cock.li,993,mail.cock.li,587 +forpsi.com,imap.forpsi.com,993,smtp.forpsi.com,465 +forthnet.gr,mail.forthnet.gr,993,smtp-auth.forthnet.gr,465 +freedom.nl,imap.freedom.nl,993,smtp.freedom.nl,465 +freedom.xyz,imap.nixnet.email,143,smtp.nixnet.email,587 +fsmpi.rwth-aachen.de,mail.fsmpi.rwth-aachen.de,993,mail.fsmpi.rwth-aachen.de,465 +fsu-jena,exchange.uni-jena.de,993,smtp.uni-jena.de,587 +fz-juelich.de,imap.fz-juelich.de,993,mail.fz-juelich.de,587 +gcc.edu,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +getbackinthe.kitchen,mail.cock.li,993,mail.cock.li,587 +ghalv.no,mail.ghalv.no,993,mail.ghalv.no,465 +gmail.com,imap.gmail.com,993,smtp.gmail.com,587 +gmx.*,imap.gmx.net,993,mail.gmx.net,587 +go2.pl,poczta.o2.pl,993,poczta.o2.pl,465 +goat.si,mail.cock.li,993,mail.cock.li,587 +googlemail.com,imap.googlemail.com,993,smtp.googlemail.com,587 +gordon.edu,outlook.office365.com,993,smtp.office365.com,587 +grrlz.net,mail.autistici.org,993,smtp.autistici.org,465 +hacari.*,mail.autistici.org,993,smtp.autistici.org,465 +helsinki.fi,outlook.office365.com,993,smtp.helsinki.fi,587 +hhu.de,mail.hhu.de,993,mail.hhu.de,465 +hitler.rocks,mail.cock.li,993,mail.cock.li,587 +horsefucker.org,mail.cock.li,993,mail.cock.li,587 +hostgator,gator4171.hostgator.com,993,gator4171.hostgator.com,587 +hotmail.*,outlook.office365.com,993,smtp.office365.com,587 +hs-mittweida.de,mail.hs-mittweida.de,993,mail.hs-mittweida.de,465 +humbug.pw,imap.migadu.com,993,smtp.migadu.com,587 +hushmail.com,imap.hushmail.com,993,smtp.hushmail.com,465 +icloud.com,imap.mail.me.com,993,smtp.mail.me.com,587 +ik.me,mail.infomaniak.com,993,mail.infomaniak.com,587 +illinois.edu, imap.gmail.com,993,smtp.gmail.com,465 +in.tum.de,mail.in.tum.de,993,mail.in.tum.de,465 +iname.com,imap.mail.com,993,smtp.mail.com,587 +inbox.lv,mail.inbox.lv,993,mail.inbox.lv,465 +inf.h-brs.de,imap.inf.h-brs.de,993,smtp.inf.h-brs.de,587 +infomaniak.com,imap.infomaniak.com,993,imap.infomaniak.com,587 +insiberia.net,mail.autistici.org,993,smtp.autistici.org,465 +insicuri.net,mail.autistici.org,993,smtp.autistici.org,465 +interactio.io,imap.gmail.com,993,smtp.gmail.com,587 +interia.*,poczta.interia.pl,993,poczta.interia.pl,465 +inventati.org,mail.autistici.org,993,smtp.autistici.org,465 +ionos.de,imap.ionos.de,993,smtp.ionos.de,587 +itu.dk,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +iu.edu,imap.exchange.iu.edu,993,mail-relay.iu.edu,587 +kalli.st,mail.kalli.st,993,kalli.st,587 +kean.edu,imap.gmail.com,993,smtp.gmail.com,587 +kipras.org,mail.kipras.org,993,mail.kipras.org,587 +krutt.org,mail.autistici.org,993,smtp.autistici.org,465 +kth.se,webmail.kth.se,993,smtp.kth.se,587 +lancaster.ac.uk,outlook.office365.com,993,smtp.office365.com,587 +larbs.xyz,mail.larbs.xyz,993,mail.larbs.xyz,587 +lavabit.com,lavabit.com,993,lavabit.com,587 +librem.one,imap.librem.one,993,smtp.librem.one,465 +linux.monster,imap.nixnet.email,143,smtp.nixnet.email,587 +linuxmail.org,imap.mail.com,993,smtp.mail.com,587 +live.com,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +live.de,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +live.rhul.ac.uk,outlook.office365.com,993,smtp.office365.com,587 +logorroici.org,mail.autistici.org,993,smtp.autistici.org,465 +loves.dicksinhisan.us,mail.cock.li,993,mail.cock.li,587 +loves.dicksinmyan.us,mail.cock.li,993,mail.cock.li,587 +lukesmith.xyz,mail.cedars.xyz,993,mail.cedars.xyz,465 +luther.edu,imap.gmail.com,993,smtp.gmail.com,587 +mac.com,imap.mail.me.com,993,smtp.mail.me.com,587 +mace.ac.in,imap.gmail.com,993,smtp.gmail.com,587 +mail.com,imap.mail.com,993,smtp.mail.com,587 +mail.de,imap.mail.de,993,smtp.mail.de,465 +mail.mcgill.ca,outlook.office365.com,993,smtp.office365.com,587 +mail.polimi.it,outlook.office365.com,993,smtp.office365.com,587 +mail.ru,imap.mail.ru,993,smtp.mail.ru,465 +mail.utoronto.ca,outlook.office365.com,993,smtp.office365.com,587 +mailbox.org,imap.mailbox.org,993,smtp.mailbox.org,587 +mailbox.tu-dresden.de,msx.tu-dresden.de,993,msx.tu-dresden.de,587 +mailfence.com,imap.mailfence.com,993,smtp.mailfence.com,465 +mailo.com,mail.mailo.com,993,mail.mailo.com,465 +marquette.edu,outlook.office365.com,993,smtp.office365.com,587 +me.com,imap.mail.me.com,993,smtp.mail.me.com,587 +memeware.net,mail.cock.li,993,mail.cock.li,587 +metu.edu.tr,imap.metu.edu.tr,993,smtp.metu.edu.tr,465 +mit.edu,imap.exchange.mit.edu,993,outgoing.mit.edu,465 +ml1.net,imap.fastmail.com,993,smtp.fastmail.com,465 +mortemale.org,mail.autistici.org,993,smtp.autistici.org,465 +msn.com,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +muny.us,mail.muny.us,993,mail.muny.us,465 +myself.com,imap.mail.com,993,smtp.mail.com,587 +myseneca.ca,outlook.office365.com,993,outlook.office365.com,587 +narod.ru,imap.yandex.com,993,smtp.yandex.com,587 +national.shitposting.agency,mail.cock.li,993,mail.cock.li,587 +ncsu.edu,imap.gmail.com,993,smtp.gmail.com,587 +netcourrier.com,mail.netcourrier.com,993,mail.netcourrier.com,465 +nigge.rs,mail.cock.li,993,mail.cock.li,587 +niser.ac.in,imap.gmail.com,993,smtp.gmail.com,465 +nixnet.email,imap.nixnet.email,143,smtp.nixnet.email,587 +nixnet.xyz,imap.nixnet.email,143,smtp.nixnet.email,587 +nixnetmail.com,imap.nixnet.email,143,smtp.nixnet.email,587 +nuke.africa,mail.cock.li,993,mail.cock.li,587 +nyu.edu,imap.gmail.com,993,smtp.gmail.com,587 +o2.pl,poczta.o2.pl,993,poczta.o2.pl,465 +odu.edu,imap.gmail.com,993,smtp.gmail.com,587 +one.com,imap.one.com,993,send.one.com,465 +onenetbeyond.org,mail.autistici.org,993,smtp.autistici.org,465 +onet.com.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +onet.eu,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,587 +online.de,imap.1und1.de,993,smtp.1und1.de,465 +op.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +opoczta.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +orange.fr,imap.orange.fr,993,smtp.orange.fr,465 +outlook.*,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +outlook.es,outlook.office365.com,993,smtp.office365.com,587 +parabolas.xyz,mail.parabolas.xyz,993,mail.parabolas.xyz,587 +paranoici.org,mail.autistici.org,993,smtp.autistici.org,465 +paranoid.email,imap.paranoid.email,993,smtp.paranoid.email,25 +paranoid.network,imap.nixnet.email,143,smtp.nixnet.email,587 +poczta.fm,poczta.interia.pl,993,poczta.interia.pl,465 +poczta.onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +polimi.it,outlook.office365.com,993,smtp.office365.com,587 +polito.it,mail.polito.it,993,mail.polito.it,465 +post.com,imap.mail.com,993,smtp.mail.com,587 +posteo.*,posteo.de,993,posteo.de,465 +privateemail.com,mail.privateemail.com,993,mail.privateemail.com,443 +privacy.xyz,imap.nixnet.email,143,smtp.nixnet.email,587 +privacyrequired.com,mail.autistici.org,993,smtp.autistici.org,465 +prokonto.pl,poczta.o2.pl,993,poczta.o2.pl,465 +purelymail.com,imap.purelymail.com,993,smtp.purelymail.com,465 +pwned.life,imap.nixnet.email,143,smtp.nixnet.email,587 +qq.com,imap.qq.com,993,smtp.qq.com,587 +rape.lol,mail.cock.li,993,mail.cock.li,587 +redchan.it,mail.cock.li,993,mail.cock.li,587 +resch.pw,mail.resch.pw,993,mail.resch.pw,587 +riseup.net,mail.riseup.net,993,mail.riseup.net,465 +rmcacs.org,imap.gmail.com,993,smtp.gmail.com,587 +runbox.com,mail.runbox.com,993,mail.runbox.com,587 +rwth-aachen.de,mail.rwth-aachen.de,993,mail.rwth-aachen.de,587 +sapo.pt,imap.sapo.pt,993,smtp.sapo.pt,587 +seznam.cz,imap.seznam.cz,993,smtp.seznam.cz,465 +sheridancollege.ca,outlook.office365.com,993,smtp.office365.com,587 +shu.edu.cn,imap.shu.edu.cn,143,smtp.shu.edu.cn,25 +sina.cn,imap.sina.cn,993,smtp.sina.cn,587 +sina.com,imap.sina.com,993,smtp.sina.com,587 +sis.hust.edu.vn,outlook.office365.com,993,smtp.office365.com,587 +smail.inf.h-brs.de,imap.inf.h-brs.de,993,smtp.inf.h-brs.de,587 +sms.ed.ac.uk,pod51015.outlook.com,993,pod51015.outlook.com,587 +snopyta.org,mail.snopyta.org,993,mail.snopyta.org,465 +sohu.com,imap.sohu.com,143,smtp.sohu.com,25 +southwales.ac.uk,imap.gmail.com,993,smtp.gmail.com,587 +spoko.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +st.amu.edu.pl,outlook.office365.com,993,smtp.office365.com,587 +stevens.edu,imap.outlook.com,993,smtp.outlook.com,587 +stronzi.org,mail.autistici.org,993,smtp.autistici.org,465 +stud.feec.vutbr.cz,imap.stud.feec.vutbr.cz,993,smtp.stud.feec.vutbr.cz,587 +stud.tu-darmstadt.de,imap.stud.tu-darmstadt.de,993,smtp.tu-darmstadt.de,465 +stud.uis.no,outlook.office365.com,993,smtp.office365.com,587 +stud.uni-bamberg.de,outlook.office365.com,993,smtp.office365.com,587 +stud.uni-saarland.de,mail.hiz-saarland.de,993,mail.hiz-saarland.de,465 +student.binadarma.ac.id,imap.gmail.com,993,smtp.gmail.com,587 +student.ethz.ch,mail.ethz.ch,993,mail.ethz.ch,587 +student.rmit.edu.au,outlook.office365.com,993,smtp.office365.com,587 +student.tuwien.ac.at,mail.student.tuwien.ac.at,993,mail.student.tuwien.ac.at,587 +student.uj.edu.pl,outlook.office365.com,993,smtp.office365.com,587 +student.utwente.nl,imap.gmail.com,993,smtp.gmail.com,587 +studenti.unipi.it,outlook.office365.com,993,smtp.office365.com,587 +studenti.unitn.it,imap.gmail.com,993,smtp.gmail.com,587 +students.rmcacs.org,imap.gmail.com,993,smtp.gmail.com,587 +students.southwales.ac.uk,imap.gmail.com,993,smtp.gmail.com,587 +studio.unibo.it,outlook.office365.com,993,smtp.office365.com,587 +studserv.uni-leipzig.de,studserv.uni-leipzig.de,993,studserv.uni-leipzig.de,25 +subvertising.org,mail.autistici.org,993,smtp.autistici.org,465 +t-online.de,secureimap.t-online.de,993,securesmtp.t-online.de,465 +techie.com,imap.mail.com,993,smtp.mail.com,587 +tecnico.ulisboa.pt,mail.tecnico.ulisboa.pt,993,mail.tecnico.ulisboa.pt,465 +teknik.io,mail.teknik.io,993,mail.teknik.io,587 +telenet.be,imap.telenet.be,993,smtp.telenet.be,587 +tfwno.gf,mail.cock.li,993,mail.cock.li,587 +thamognya.com,mail.thamognya.com,993,mail.thamognya.com,587 +thunix.net,thunix.net,143,thunix.net,25 +tlen.pl,poczta.o2.pl,993,poczta.o2.pl,465 +tlu.edu,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +tquad.ai,imap.mail.eu-west-1.awsapps.com,993,smtp.mail.eu-west-1.awsapps.com,465 +tu-harburg.de,mail.tu-harburg.de,993,mail.tu-harburg.de,587 +tuhh.de,mail.tu-harburg.de,993,mail.tu-harburg.de,587 +tum.de,xmail.mwn.de,993,postout.lrz.de,587 +txstate.edu,outlook.office365.com,993,smtp.office365.com,587 +ua.pt,outlook.office365.com,993,mail.ua.pt,25 +uach.mx,imap.gmail.com,993,smtp.gmail.com,587 +ucalgary.ca,outlook.office365.com,993,smtp.office365.com,587 +ucdavis.edu,imap.gmail.com,993,smtp.gmail.com,587 +uclive.ac.nz,outlook.office365.com,993,smtp.office365.com,587 +ucsb.edu,imap.gmail.com,993,smtp.gmail.com,587 +ucsc.edu,imap.gmail.com,993,smtp.gmail.com,587 +ukr.net,imap.ukr.net,993,smtp.ukr.net,465 +umbc.edu,imap.gmail.com,993,smtp.gmail.com,587 +uni-duesseldorf.de,mail.hhu.de,993,mail.hhu.de,465 +uni-jena.de,imap.uni-jena.de,993,smtp.uni-jena.de,587 +uni.edu.pe,imap.gmail.com,993,smtp.gmail.com,587 +uni.strath.ac.uk,outlook.office365.com,993,smtp.office365.com,587 +unilodz.eu,outlook.office365.com,993,smtp.office365.com,587 +unitn.it,imap.gmail.com,993,smtp.gmail.com,587 +unitybox.de,mail.unity-mail.de,993,mail.unity-mail.de,587 +univ-ubs.fr,partage.univ-ubs.fr,993,partage.univ-ubs.fr,587 +uoregon.edu,imap.uoregon.edu,993,smtp.uoregon.edu,587 +uqtr.ca,outlook.office365.com,993,smtp.office365.com,587 +usa.com,imap.mail.com,993,smtp.mail.com,587 +usp.br,imap.gmail.com,993,smtp.gmail.com,465 +utas.edu.au,outlook.office365.com,993,smtp.office365.com,587 +utdallas.edu,outlook.office365.com,993,smtp.office365.com,587 +uw.edu,imap.gmail.com,993,smtp.gmail.com,465 +uwcad.it,imap.gmail.com,993,smtp.gmail.com,465 +ux.uis.no,imap.ux.uis.no,993,broremann.ux.uis.no,25 +uymail.com,imap.mail.com,993,smtp.mail.com,587 +vip.onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +vivaldi.net,imap.vivaldi.net,993,smtp.vivaldi.net,587 +vp.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +vt.edu,imap.gmail.com,993,smtp.gmail.com,587 +vxempire.xyz,vxempire.xyz,993,vxempire.xyz,465 +waifu.club,mail.cock.li,993,mail.cock.li,587 +wanadoo.fr,imap.orange.fr,993,smtp.orange.fr,465 +wants.dicksinhisan.us,mail.cock.li,993,mail.cock.li,587 +wants.dicksinmyan.us,mail.cock.li,993,mail.cock.li,587 +web.de,imap.web.de,993,smtp.web.de,587 +wit.edu,outlook.office365.com,993,smtp.office365.com,587 +wp.pl,imap.wp.pl,993,smtp.wp.pl,465 +writeme.com,imap.mail.com,993,smtp.mail.com,587 +ya.ru,imap.yandex.com,993,smtp.yandex.com,587 +yahoo.*,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,587 +yandex.*,imap.yandex.com,993,smtp.yandex.com,587 +ymail.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,465 +zaclys.net,mail.zaclys.net,993,mail.zaclys.net,465 +zju.edu.cn,imap.zju.edu.cn,993,smtp.zju.edu.cn,994 +zoho.com,imap.zoho.com,993,smtp.zoho.com,465 +zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 diff --git a/share/mailcap b/share/mailcap new file mode 100644 index 0000000..601419c --- /dev/null +++ b/share/mailcap @@ -0,0 +1,10 @@ +text/plain; $EDITOR %s ; +text/html; /usr/local/lib/mutt-wizard/openfile %s ; nametemplate=%s.html +text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump -width=1024 %s; nametemplate=%s.html; copiousoutput; +image/*; /usr/local/lib/mutt-wizard/openfile %s ; +video/*; setsid mpv --quiet %s &; copiousoutput +audio/*; mpv %s ; +application/pdf; /usr/local/lib/mutt-wizard/openfile %s ; +application/pgp-encrypted; gpg -d '%s'; copiousoutput; +application/pgp-keys; gpg --import '%s'; copiousoutput; +application/x-subrip; $EDITOR %s ; diff --git a/share/mbsync-temp b/share/mbsync-temp new file mode 100644 index 0000000..4e77b09 --- /dev/null +++ b/share/mbsync-temp @@ -0,0 +1,24 @@ +IMAPStore $fulladdr-remote +Host $imap +Port $iport +User $login +PassCmd "pass $passprefix$fulladdr" +AuthMechs LOGIN +SSLType $imapssl +CertificateFile $sslcert + +MaildirStore $fulladdr-local +Subfolders Verbatim +Path $maildir/$fulladdr/ +Inbox $maildir/$fulladdr/INBOX + +Channel $fulladdr +Expunge Both +$master :$fulladdr-remote: +$slave :$fulladdr-local: +Patterns * !"[Gmail]/All Mail" !"*fts-flatcurve*" !"*virtual*" +Create Both +SyncState * +MaxMessages $maxmes +ExpireUnread no +# End profile diff --git a/share/mpop-temp b/share/mpop-temp new file mode 100644 index 0000000..cc51d75 --- /dev/null +++ b/share/mpop-temp @@ -0,0 +1,8 @@ +account $fulladdr +tls on +user $login +host $imap +port $iport +timeout 10 +delivery maildir $maildir/$fulladdr/INBOX +passwordeval pass $passprefix$fulladdr diff --git a/share/msmtp-temp b/share/msmtp-temp new file mode 100644 index 0000000..7333437 --- /dev/null +++ b/share/msmtp-temp @@ -0,0 +1,11 @@ +account $fulladdr +host $smtp +port $sport +from $fulladdr +user $login +passwordeval "pass $passprefix$fulladdr" +auth on +tls on +tls_trust_file $sslcert +logfile $msmtplog +$tlsline diff --git a/share/mutt-temp b/share/mutt-temp new file mode 100644 index 0000000..63841ad --- /dev/null +++ b/share/mutt-temp @@ -0,0 +1,18 @@ +# vim: filetype=neomuttrc +# muttrc file for account $fulladdr +set real_name = "$realname" +set from = "$fulladdr" +set sendmail = "msmtp -a $fulladdr" +alias me $realname <$fulladdr> +set folder = "$folder" +set header_cache = "$cachedir/$safename/headers" +set message_cachedir = "$cachedir/$safename/bodies" +set mbox_type = Maildir +set hostname = "$hostname" +source $muttshare/switch.muttrc +set spool_file = "+INBOX" +set postponed = "+Drafts" +set trash = "+Trash" +set record = "+Sent" +$extra +macro index o "<shell-escape>mailsync $fulladdr<enter>" "sync $fulladdr" diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc new file mode 100644 index 0000000..f236bc4 --- /dev/null +++ b/share/mutt-wizard.muttrc @@ -0,0 +1,194 @@ +# vim: filetype=neomuttrc +# This file contains all of mutt-wizard's default settings. +# mutt-wizard will have this file sourced from your muttrc. +# In the interest of seamless updating, do not edit this file. +# If you want to override any settings, set those in your muttrc. +set send_charset="us-ascii:utf-8" +set mailcap_path = $HOME/.config/mutt/mailcap:/usr/local/share/mutt-wizard/mailcap:$mailcap_path +set mime_type_query_command = "file --mime-type -b %s" +set date_format="%y/%m/%d %I:%M%p" +set index_format="%2C %Z %?X?A& ? %D %-15.15F %s (%-4.4c)" +set sort = 'reverse-date' +set smtp_authenticators = 'gssapi:login' +set query_command = "abook --mutt-query '%s'" +set rfc2047_parameters = yes +set sleep_time = 0 # Pause 0 seconds for informational messages +set markers = no # Disables the `+` displayed at line wraps +set mark_old = no # Unread mail stay unread until read +set mime_forward = no # mail body is forwarded as text +set forward_attachments = yes # attachments are forwarded with mail +set wait_key = no # mutt won't ask "press key to continue" +set fast_reply # skip to compose when replying +set fcc_attach # save attachments with the body +set forward_format = "Fwd: %s" # format of subject when forwarding +set forward_quote # include message in forwards +set reverse_name # reply as whomever it was to +set include # include message in replies +set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example) +auto_view text/html # automatically show html (mailcap uses lynx) +auto_view application/pgp-encrypted +#set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. +alternative_order text/plain text/enriched text/html + +bind index,pager i noop +bind index,pager g noop +bind index \Cf noop +bind index,pager M noop +bind index,pager C noop + +# General rebindings +bind index gg first-entry +bind index j next-entry +bind index k previous-entry +bind attach <return> view-mailcap +bind attach l view-mailcap +bind editor <space> noop +bind index G last-entry +bind pager,attach h exit +bind pager j next-line +bind pager k previous-line +bind pager l view-attachments +bind index D delete-message +bind index U undelete-message +bind index L limit +bind index h noop +bind index l display-message +bind index,query <space> tag-entry +#bind browser h goto-parent +macro browser h '<change-dir><kill-line>..<enter>' "Go to parent folder" +bind index,pager H view-raw-message +bind browser l select-entry +bind browser gg top-page +bind browser G bottom-page +bind pager gg top +bind pager G bottom +bind index,pager,browser d half-down +bind index,pager,browser u half-up +bind index,pager S sync-mailbox +bind index,pager R group-reply +bind index \031 previous-undeleted # Mouse wheel +bind index \005 next-undeleted # Mouse wheel +bind pager \031 previous-line # Mouse wheel +bind pager \005 next-line # Mouse wheel +bind editor <Tab> complete-query + +macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox" +macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox" +macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox" +macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts" +macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts" +macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts" +macro index,pager gj "<change-folder>=Junk<enter>" "go to junk" +macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk" +macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk" +macro index,pager gt "<change-folder>=Trash<enter>" "go to trash" +macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash" +macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash" +macro index,pager gs "<change-folder>=Sent<enter>" "go to sent" +macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent" +macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent" +macro index,pager ga "<change-folder>=Archive<enter>" "go to archive" +macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive" +macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to archive" + +#set crypt_auto_sign = yes +#set crypt_opportunistic_encrypt = yes +#set pgp_self_encrypt = yes +#set pgp_default_key = 'your@gpgemailaddre.ss' +macro index \eg "<enter-command>unset wait_key<enter><shell-escape>gpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; $prefix/libexec/gpg-wks-client --create \\\$eFGPT \\\$eID | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>" "publish GPG key to WKS provider" +macro index \eh "<pipe-message>$prefix/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>" "confirm GPG publication" + +macro index,pager a "<enter-command>set my_pipe_decode=\$pipe_decode pipe_decode<return><pipe-message>abook --add-email<return><enter-command>set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<return>" "add the sender address to abook" +macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read" +macro index O "<shell-escape>mailsync<enter>" "run mailsync to sync all mail" +macro index \Cf "<enter-command>unset wait_key<enter><shell-escape>printf 'Enter a search term to find with notmuch: '; read x; echo \$x >\"\${XDG_CACHE_HOME:-\$HOME/.cache}/mutt_terms\"<enter><limit>~i \"\`notmuch search --output=messages \$(cat \"\${XDG_CACHE_HOME:-\$HOME/.cache}/mutt_terms\") | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/g for@a; s/\\$/\\\\\\$/g for@a;print@a' \`\"<enter>" "show only messages matching a notmuch pattern" +macro index A "<limit>all\n" "show all messages (undo limit)" + +# Sidebar mappings +set sidebar_visible = yes +set sidebar_width = 20 +set sidebar_short_path = yes +set sidebar_next_new_wrap = yes +set mail_check_stats +set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?' +bind index,pager \Ck sidebar-prev +bind index,pager \Cj sidebar-next +bind index,pager \Co sidebar-open +bind index,pager \Cp sidebar-prev-new +bind index,pager \Cn sidebar-next-new +bind index,pager B sidebar-toggle-visible + +# Default index colors: +color index yellow default '.*' +color index_author red default '.*' +color index_number blue default +color index_subject cyan default '.*' + +# New mail is boldened: +color index brightyellow black "~N" +color index_author brightred black "~N" +color index_subject brightcyan black "~N" + +# Tagged mail is highlighted: +color index brightyellow blue "~T" +color index_author brightred blue "~T" +color index_subject brightcyan blue "~T" + +# Flagged mail is highlighted: +color index brightgreen default "~F" +color index_subject brightgreen default "~F" +color index_author brightgreen default "~F" + +# Other colors and aesthetic settings: +mono bold bold +mono underline underline +mono indicator reverse +mono error bold +color normal default default +color indicator brightblack white +color sidebar_highlight red default +color sidebar_divider brightblack black +color sidebar_flagged red black +color sidebar_new green black +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +color status brightyellow black +color hdrdefault brightgreen default +color quoted green default +color quoted1 blue default +color quoted2 cyan default +color quoted3 yellow default +color quoted4 red default +color quoted5 brightred default +color signature brightgreen default +color bold black default +color underline black default + +# Regex highlighting: +color header brightmagenta default "^From" +color header brightcyan default "^Subject" +color header brightwhite default "^(CC|BCC)" +color header blue default ".*" +color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses +color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL +color body green default "\`[^\`]*\`" # Green text between ` and ` +color body brightblue default "^# \.*" # Headings as bold blue +color body brightcyan default "^## \.*" # Subheadings as bold cyan +color body brightgreen default "^### \.*" # Subsubheadings as bold green +color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow +color body brightcyan default "[;:][-o][)/(|]" # emoticons +color body brightcyan default "[;:][)(|]" # emoticons +color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? +color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? +color body red default "(BAD signature)" +color body cyan default "(Good signature)" +color body brightblack default "^gpg: Good signature .*" +color body brightyellow default "^gpg: " +color body brightyellow red "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" +color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" diff --git a/share/notmuch-temp b/share/notmuch-temp new file mode 100644 index 0000000..c91eef9 --- /dev/null +++ b/share/notmuch-temp @@ -0,0 +1,14 @@ +[database] +path=$maildir +[user] +name=$realname +primary_email=$fulladdr +[new] +tags=unread;inbox; +ignore=.mbsyncstate;.uidvalidity +[search] +exclude_tags=deleted;spam; +[maildir] +synchronize_flags=true +[crypto] +gpg_path=$GPG diff --git a/share/online-temp b/share/online-temp new file mode 100644 index 0000000..5fd385c --- /dev/null +++ b/share/online-temp @@ -0,0 +1,4 @@ +set imap_user = "$login" +set imap_pass = "`pass $passprefix$fulladdr`" +set ssl_starttls = yes +set ssl_force_tls = yes diff --git a/share/switch.muttrc b/share/switch.muttrc new file mode 100644 index 0000000..c808c99 --- /dev/null +++ b/share/switch.muttrc @@ -0,0 +1,10 @@ +# vim: filetype=neomuttrc + +# This is an embarrassing and hacky file that unbinds a bunch of binds between +# switching accounts. It is called each time an account is changed. + +unset hostname +unmy_hdr Organization +unmailboxes * +unalternates * +unset signature |
