send and receive with mailsync.sh

This commit is contained in:
Pig Monkey 2015-12-25 19:52:44 -08:00
parent 4a97eaebd1
commit c4938ea9bd
3 changed files with 5 additions and 6 deletions

View file

@ -1,11 +1,12 @@
#!/bin/sh
# Original source: http://bit.ly/1Ztk5wg
# Run mbsync when full internet connectivity is available.
# Send and receive mail when full internet connectivity is available.
STATE=`nmcli networking connectivity`
if [ $STATE = 'full' ]
then
/usr/local/bin/msmtp-queue -r
/usr/bin/mbsync -a
exit $?
fi

View file

@ -4,11 +4,6 @@
tags:
- mbsync
- name: Push mail sync script
copy: src=mailsync.sh dest=/usr/local/bin/mailsync mode=755
tags:
- mbsync
- name: Push mbsync service file
copy: src=mbsync.service dest=/etc/systemd/system/mbsync@.service
when: isync

View file

@ -12,6 +12,9 @@
- name: Install notmuch
pacman: name=notmuch state=present
- name: Push mail sync script
copy: src=mailsync.sh dest=/usr/local/bin/mailsync mode=755
- include: msmtp.yml
- include: isync.yml
- include: offlineimap.yml