ソースを参照

Merge pull request #35 from meain/macos

MacOS compatibility
tags/v3.1
Luke Smith 6年前
committed by GitHub
コミット
56cb13e822
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
6個のファイルの変更45行の追加5行の削除
  1. +2
    -0
      README.md
  2. +6
    -0
      autoconf/offlineimap_header.macos
  3. +19
    -0
      autoconf/offlineimap_profile.macos
  4. +7
    -2
      etc/mailsync.sh
  5. +10
    -3
      mutt-wizard.sh
  6. +1
    -0
      muttrc

+ 2
- 0
README.md ファイルの表示

@@ -27,6 +27,8 @@ Note also that Gmail and some providers require you to enable sign-ins from thir

## Installation and Dependencies

> **MacOS prerequisites** - Install `iproute2mac` and `mpv` ( brew install iproute2mac mpv )

`dialog`, `neomutt` and `offlineimap` should be installed. You also need to have a GPG public/private key pair for the wizard to automatically store your passwords. The whole repo should be cloned to `~/.config/mutt/`. (If you have a previous mutt folder, you'll want to back it up or delete it first.)

```


+ 6
- 0
autoconf/offlineimap_header.macos ファイルの表示

@@ -0,0 +1,6 @@
[general]
accounts =
starttls = yes
ssl = true
pythonfile = ~/.config/mutt/credentials/imappwd.py


+ 19
- 0
autoconf/offlineimap_profile.macos ファイルの表示

@@ -0,0 +1,19 @@
[Account $title]

localrepository = $title-local
remoterepository = $title-remote

[Repository $title-remote]
auth_mechanisms = LOGIN
type = $type
remoteuser = $login
sslcacertfile = /usr/local/etc/openssl/cert.pem
remotepasseval = mailpasswd("$title")
remotehost = $imap
remoteport = $iport
folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail']
sslcacertfile = /usr/local/etc/openssl/cert.pem

[Repository $title-local]
type = Maildir
localfolders = ~/.mail/$title

+ 7
- 2
etc/mailsync.sh ファイルの表示

@@ -7,8 +7,13 @@
#
# I have this run as a cronjob every 5 minutes.

# Check for internet connection. Exit script if none.
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit
# Check for internet connection. Exit script if none. (timeout in mac is `-t`)
if [ "$(uname)" == "Darwin" ]
then
ping -q -t 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit
else
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit
fi

# Get current number of new mail, then begin sync.
ori=$(find ~/.mail -wholename '*/new/*' | grep -vi "spam\|trash\|junk" | wc -l)


+ 10
- 3
mutt-wizard.sh ファイルの表示

@@ -1,5 +1,12 @@
#!/bin/bash

if [[ "$(uname)" == "Darwin" ]]
then
os=".macos"
else
os=""
fi

muttdir="$HOME/.config/mutt/"

chooseSync() { (crontab -l && testSync) || dialog --msgbox "No cronjob manager detected. Please install one and return to enable automatic mailsyncing" 10 60 ;}
@@ -173,8 +180,8 @@ addAccount() {
mkdir -p "$muttdir"accounts/$title/cache/bodies

# Creating the offlineimaprc if it doesn't exist already.
if [ ! -f ~/.offlineimaprc ]; then cp "$muttdir"autoconf/offlineimap_header ~/.offlineimaprc; fi
cat "$muttdir"autoconf/offlineimap_profile | sed -e "$replacement" >> ~/.offlineimaprc
if [ ! -f ~/.offlineimaprc ]; then cp "$muttdir"autoconf/offlineimap_header"$os" ~/.offlineimaprc; fi
cat "$muttdir"autoconf/offlineimap_profile"$os" | sed -e "$replacement" >> ~/.offlineimaprc
mkdir -p ~/.mail/$title

# Add the mutt profile.
@@ -183,7 +190,7 @@ addAccount() {
echo "macro index,pager i$idnum '<sync-mailbox><enter-command>source "$muttdir"accounts/$title.muttrc<enter><change-folder>!<enter>'" >> "$muttdir"personal.muttrc

# Add to offlineimaprc sync list.
sed -i "s/^accounts =.*[a-zA-Z]$/&, $title/g;s/^accounts =\s*$/accounts = $title/g" ~/.offlineimaprc
sed -i.bu "s/^accounts =.*[a-zA-Z]$/&, $title/g;s/^accounts =\s*$/accounts = $title/g" ~/.offlineimaprc && rm ~/.offlineimaprc.bu

# Makes account default if there is no default account.
grep "$muttdir"personal.muttrc -e "^source .*accounts.*" >/dev/null && echo there || \


+ 1
- 0
muttrc ファイルの表示

@@ -19,6 +19,7 @@ set forward_format = "Fwd: %s"
set markers = no
set mark_old = no
set mime_forward = yes
set smtp_authenticators = 'gssapi:login'
auto_view text/html
auto_view application/pdf
alternative_order text/plain text/enriched text/html


読み込み中…
キャンセル
保存