Skip to content

Commit 5300aa7

Browse files
authored
Merge pull request #924 from CarlosLoboxyz/master
Add goimapnotify for push notifications
2 parents 05fcf7b + 650794b commit 5300aa7

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ https://muttwizard.com/
44

55
Get this great stuff without effort:
66

7-
- A full-featured and autoconfigured email client on the terminal with neomutt
7+
- A full-featured and autoconfigured email client on the terminal wibuiltth neomutt
88
- Mail stored offline enabling the ability to:
99
* view and write emails while you're away from
1010
the internet
@@ -54,6 +54,8 @@ A user of Arch-based distros can also install the current mutt-wizard release fr
5454

5555
### Optional Dependencies
5656

57+
- `goimapnotify` - required for push notifications.
58+
[Check here for reference](https://wiki.archlinux.org/title/Isync#With_imapnotify).
5759
- `pam-gnupg` - Automatically logs you into your GPG key on login so you will
5860
never need to input your password once logged on to your system. Check the
5961
repo and directions out [here](https://github.com/cruegge/pam-gnupg).
@@ -134,6 +136,12 @@ To give you an example of the interface, here's an idea:
134136
- <kbd>ctrl-b</kbd> - open a menu to select a URL you want to open in your browser.
135137
- <kbd>p</kbd> - encrypt/sign your message (in compose view, before sending the email).
136138

139+
## Enable push notifications per mail
140+
**Note**: Replace the `fulladdrs` with your actual email address. You have to do this for each new mail you want to setup instant notifications.
141+
```bash
142+
systemctl enable --user goimapnotify@fulladdrs.service
143+
```
144+
137145
## Additional functionality
138146

139147
- `pam-gnupg` - Automatically logs you into your GPG key on login, so you will

‎bin/mw‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ msmtprc="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/config"
1212
msmtplog="${XDG_STATE_HOME:-$HOME/.local/state}/msmtp/msmtp.log"
1313
mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}"
1414
mpoprc="${XDG_CONFIG_HOME:-$HOME/.config}/mpop/config"
15+
imapnotify="${XDG_CONFIG_HOME:-$HOME/.config}/imapnotify"
1516
mpoptemp="$muttshare/mpop-temp"
1617
mbsynctemp="$muttshare/mbsync-temp"
1718
mutttemp="$muttshare/mutt-temp"
1819
msmtptemp="$muttshare/msmtp-temp"
1920
onlinetemp="$muttshare/online-temp"
2021
notmuchtemp="$muttshare/notmuch-temp"
22+
imapnotifytemp="$muttshare/imapnotify-temp"
2123
# With the use of templates, it's impossible to use parameter substitution.
2224
# Therefore, some default variables that might be otherwise overwritten are set
2325
# here.
@@ -78,6 +80,10 @@ prepmpop() {
7880
envsubst <"$mpoptemp" >>"$mpoprc"
7981
}
8082

83+
prepimapnotify() {
84+
mkdir -p "${imapnotify%/*}" ; envsubst < "$imapnotifytemp" >> "$imapnotify/$fulladdr.conf"
85+
}
86+
8187
prepmutt() {
8288
mkdir -p "${muttrc%/*}" "$accdir"
8389
envsubst <"$mutttemp" >"$accdir/$fulladdr.muttrc"
@@ -106,6 +112,7 @@ getprofiles() {
106112
prepmsmtp
107113
prepmutt
108114
prepnotmuch
115+
prepimapnotify
109116
}
110117

111118
parsedomains() {

‎share/imapnotify-temp‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"host": "$imap",
3+
"port": $iport,
4+
"tls": true,
5+
"tlsOptions": {
6+
"rejectUnauthorized": false
7+
},
8+
"username": "$login",
9+
"password": "",
10+
"passwordCmd": "pass $passprefix$fulladdr",
11+
"onNewMail": "mailsync",
12+
"onNewMailPost": "",
13+
"boxes": [ "INBOX" ]
14+
}
15+

0 commit comments

Comments
 (0)