diff options
| author | Paul C. Buetow (mars.fritz.box) <paul@buetow.org> | 2014-07-04 23:31:14 +0200 |
|---|---|---|
| committer | Paul C. Buetow (mars.fritz.box) <paul@buetow.org> | 2014-07-04 23:31:14 +0200 |
| commit | 687511e61fd30f82f8be2fb001a97a3178a05a12 (patch) | |
| tree | dba71cc9ea9da2427d794357ecfd70e9ef937f34 | |
| parent | e251649b3698cc24c18a2d2ef6e582e9d4dd2be2 (diff) | |
add sample configs and manpage
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | README.pod | 113 | ||||
| -rw-r--r-- | debian/control | 2 | ||||
| -rw-r--r-- | docs/muttdelay.1 | 139 | ||||
| -rw-r--r-- | docs/muttdelay.pod | 113 | ||||
| -rw-r--r-- | docs/muttdelay.txt | 126 | ||||
| -rw-r--r-- | src/msmtprc.sample | 15 | ||||
| -rw-r--r-- | src/muttdelay.vim | 8 |
8 files changed, 153 insertions, 365 deletions
@@ -16,6 +16,8 @@ install: cp ./bin/* $(DESTDIR)/usr/bin test ! -d $(DESTDIR)/etc/default && mkdir -p $(DESTDIR)/etc/default || exit 0 cp ./src/muttdelay.default.conf $(DESTDIR)/etc/default/muttdelay + cp ./src/*.vim $(DESTDIR)/usr/share/$(NAME)/ + cp ./src/*.sample $(DESTDIR)/usr/share/$(NAME)/ deinstall: test ! -z "$(DESTDIR)" && test -f $(DESTDIR)/usr/bin/$(NAME) && rm $(DESTDIR)/usr/bin/$(NAME) || exit 0 @@ -1,114 +1,59 @@ =head1 NAME -muttdelay - A muttdelay project +muttdelay - A bash script to delay mails written via mutt =head1 WTF? -You may use this project in order to build your own Debian package for your own project. This has been tested with Debian GNU/Linux Squeeze and Debian GNU/Linux Wheezy. +This is for scheduling the sending of mails for a specific future time. Unlinke postponing a mail which does not involve the scheduling. -Feel free to modify any aspects. This project is just an empty example muttdelay. +=head2 How it works -Follow these steps: +=head3 Configuring Vim -=head2 Install required packages +Do the following: -Run the following: + cp /usr/share/muttdelay/muttdelay.vim ~/.vim/plugin/ + echo 'map ,L :call MuttDelay()<CR>' >> ~/.vimrc - sudo aptitude install lintian devscripts dpkg-dev make perl +=head3 Configuring CRON -Todo: Ensure this are the correct packages. In order to test that I would have to setup a blank Debian system. +And create an hourly cronjob such as: -=head2 Compile the project + 0 * * * * /usr/bin/muttdelay cron -Go to the to level directory and run +=head3 Configuring msmtp - make +For example like this (change your configuration accordingly to fit your needs): -To test run + cp /usr/share/muttdelay/msmtprc.example ~/.msmtprc + vim ~/.msmtprc - ./bin/muttdelay +And ensure that you can send mails like this: -It should print out the version number of the project. + msmtp your@address.example.com <<< Hallo -=head2 Create a Debian package +If it works, you can go on -Go to the to level directory and run +=head3 Use it - make deb +Open mutt, compose an email. Use Vim as your editor. After finishing writing your mail don't close Vim, but run -It will create the files like: + ,L - ../muttdelay_0.0.0.0_all.deb - ../muttdelay_0.0.0.0.dsc - ../muttdelay_0.0.0.0_amd64.changes - ../muttdelay_0.0.0.0.tar.gz +and the mail gets scheduled for sending for a later time. You can now leave vim without sending the mail via mutt directly. -It should create a debian package in ../. Check and install it, e.g: +The mail tself is saved to - lintian --pedantic ../muttdelay_0.0.0.0_all.deb - sudo dpkg -i ../muttdelay_0.0.0.0_all.deb + ~/.muttdelay/SENDTIMESTAMP.COMPOSETIMESTAMP -Run +The cron job checks if there is any SENDTIMESTAMP lower than the current unix time stamp. And if so, all matching mails are sent. - dpkg -L muttdelay +=head1 LICENSE -to see whats in there. You can now run +See package description or project website. - /usr/bin/muttdelay +=head1 AUTHOR -or for example +Paul C. Buetow - <http://muttdelay.buetow.org> - man muttdelay - -=head2 Read the Makefile - -Read the Makefile in order to understand what's going on. - -=head1 Customize - -Now, since you understood everything feel free to customize everything the way you want it. E.g.: - - Don't use POD for documentation but LaTeX - - Compile a C program - - Include a ./lib dir, add it to the 'install' Makefile rule - - etc etc. - -You should also consider the following: - -=head2 Manual page - -This muttdelay is using POD for creating manual pages. Edit ./docs/muttdelay.pod and run - - make documentation - -in order to build ./docs/muttdelay.1. The page will be included in the resulting debian package automatically. You can review the page with - - man ./docs/muttdelay.1 - -=head2 Renaming muttdelay into your project name - -Rename all files which have *muttdelay* included into your own new package name. You can do that with: - - PROJECTNAME=yourproject - find . -name \*muttdelay\* | - while read muttdelay; do git mv $muttdelay ${muttdelay/muttdelay/$PROJECTNAME}; done - -Search all content and rename *muttdelay* into your own new package name. You can do that with: - - grep -R muttdelay . | grep -v .git | - cut -d: -f1 | uniq | xargs sed -i "s/muttdelay/$PROJECTNAME/g" - -=head2 Updating ./debian - -Edit the following files accordingly to your new project (e.g. with vim): - - vim ./debian/{control,copyright,README} - -=head2 Update changelog - -Go to the to level directory and run - - dch -i +=cut diff --git a/debian/control b/debian/control index 26d7003..ce03816 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Vcs-Browser: https://github.com/rantanplan/muttdelay Package: muttdelay Architecture: all -Depends: +Depends: msmtp Description: Delaying the sending of mails A bash script to delay mails written via mutt and msmtp. diff --git a/docs/muttdelay.1 b/docs/muttdelay.1 index 60305d5..6273c6b 100644 --- a/docs/muttdelay.1 +++ b/docs/muttdelay.1 @@ -130,137 +130,70 @@ .if n .ad l .nh .SH "NAME" -muttdelay \- A muttdelay project +muttdelay \- A bash script to delay mails written via mutt .SH "WTF?" .IX Header "WTF?" -You may use this project in order to build your own Debian package for your own project. This has been tested with Debian GNU/Linux Squeeze and Debian GNU/Linux Wheezy. +This is for scheduling the sending of mails for a specific future time. Unlinke postponing a mail which does not involve the scheduling. +.SS "How it works" +.IX Subsection "How it works" +\fIConfiguring Vim\fR +.IX Subsection "Configuring Vim" .PP -Feel free to modify any aspects. This project is just an empty example muttdelay. +Do the following: .PP -Follow these steps: -.SS "Install required packages" -.IX Subsection "Install required packages" -Run the following: -.PP -.Vb 1 -\& sudo aptitude install lintian devscripts dpkg\-dev make perl -.Ve -.PP -Todo: Ensure this are the correct packages. In order to test that I would have to setup a blank Debian system. -.SS "Compile the project" -.IX Subsection "Compile the project" -Go to the to level directory and run -.PP -.Vb 1 -\& make +.Vb 2 +\& cp /usr/share/muttdelay/muttdelay.vim ~/.vim/plugin/ +\& echo \*(Aqmap ,L :call MuttDelay()<CR>\*(Aq >> ~/.vimrc .Ve .PP -To test run -.PP -.Vb 1 -\& ./bin/muttdelay -.Ve +\fIConfiguring \s-1CRON\s0\fR +.IX Subsection "Configuring CRON" .PP -It should print out the version number of the project. -.SS "Create a Debian package" -.IX Subsection "Create a Debian package" -Go to the to level directory and run +And create an hourly cronjob such as: .PP .Vb 1 -\& make deb +\& 0 * * * * /usr/bin/muttdelay cron .Ve .PP -It will create the files like: -.PP -.Vb 4 -\& ../muttdelay_0.0.0.0_all.deb -\& ../muttdelay_0.0.0.0.dsc -\& ../muttdelay_0.0.0.0_amd64.changes -\& ../muttdelay_0.0.0.0.tar.gz -.Ve +\fIConfiguring msmtp\fR +.IX Subsection "Configuring msmtp" .PP -It should create a debian package in ../. Check and install it, e.g: +For example like this (change your configuration accordingly to fit your needs): .PP .Vb 2 -\& lintian \-\-pedantic ../muttdelay_0.0.0.0_all.deb -\& sudo dpkg \-i ../muttdelay_0.0.0.0_all.deb +\& cp /usr/share/muttdelay/msmtprc.example ~/.msmtprc +\& vim ~/.msmtprc .Ve .PP -Run +And ensure that you can send mails like this: .PP .Vb 1 -\& dpkg \-L muttdelay +\& msmtp your@address.example.com <<< Hallo .Ve .PP -to see whats in there. You can now run +If it works, you can go on .PP -.Vb 1 -\& /usr/bin/muttdelay -.Ve +\fIUse it\fR +.IX Subsection "Use it" .PP -or for example +Open mutt, compose an email. Use Vim as your editor. After finishing writing your mail don't close Vim, but run .PP .Vb 1 -\& man muttdelay +\& ,L .Ve -.SS "Read the Makefile" -.IX Subsection "Read the Makefile" -Read the Makefile in order to understand what's going on. -.SH "Customize" -.IX Header "Customize" -Now, since you understood everything feel free to customize everything the way you want it. E.g.: .PP -.Vb 1 -\& Don\*(Aqt use POD for documentation but LaTeX -\& -\& Compile a C program -\& -\& Include a ./lib dir, add it to the \*(Aqinstall\*(Aq Makefile rule -\& -\& etc etc. -.Ve +and the mail gets scheduled for sending for a later time. You can now leave vim without sending the mail via mutt directly. .PP -You should also consider the following: -.SS "Manual page" -.IX Subsection "Manual page" -This muttdelay is using \s-1POD\s0 for creating manual pages. Edit ./docs/muttdelay.pod and run +The mail tself is saved to .PP .Vb 1 -\& make documentation +\& ~/.muttdelay/SENDTIMESTAMP.COMPOSETIMESTAMP .Ve .PP -in order to build ./docs/muttdelay.1. The page will be included in the resulting debian package automatically. You can review the page with -.PP -.Vb 1 -\& man ./docs/muttdelay.1 -.Ve -.SS "Renaming muttdelay into your project name" -.IX Subsection "Renaming muttdelay into your project name" -Rename all files which have *muttdelay* included into your own new package name. You can do that with: -.PP -.Vb 3 -\& PROJECTNAME=yourproject -\& find . \-name \e*muttdelay\e* | -\& while read muttdelay; do git mv $muttdelay ${muttdelay/muttdelay/$PROJECTNAME}; done -.Ve -.PP -Search all content and rename *muttdelay* into your own new package name. You can do that with: -.PP -.Vb 2 -\& grep \-R muttdelay . | grep \-v .git | -\& cut \-d: \-f1 | uniq | xargs sed \-i "s/muttdelay/$PROJECTNAME/g" -.Ve -.SS "Updating ./debian" -.IX Subsection "Updating ./debian" -Edit the following files accordingly to your new project (e.g. with vim): -.PP -.Vb 1 -\& vim ./debian/{control,copyright,README} -.Ve -.SS "Update changelog" -.IX Subsection "Update changelog" -Go to the to level directory and run -.PP -.Vb 1 -\& dch \-i -.Ve +The cron job checks if there is any \s-1SENDTIMESTAMP\s0 lower than the current unix time stamp. And if so, all matching mails are sent. +.SH "LICENSE" +.IX Header "LICENSE" +See package description or project website. +.SH "AUTHOR" +.IX Header "AUTHOR" +Paul C. Buetow \- <http://muttdelay.buetow.org> diff --git a/docs/muttdelay.pod b/docs/muttdelay.pod index 65625e3..6f7bc71 100644 --- a/docs/muttdelay.pod +++ b/docs/muttdelay.pod @@ -1,114 +1,59 @@ =head1 NAME -muttdelay - A muttdelay project +muttdelay - A bash script to delay mails written via mutt =head1 WTF? -You may use this project in order to build your own Debian package for your own project. This has been tested with Debian GNU/Linux Squeeze and Debian GNU/Linux Wheezy. +This is for scheduling the sending of mails for a specific future time. Unlinke postponing a mail which does not involve the scheduling. -Feel free to modify any aspects. This project is just an empty example muttdelay. +=head2 How it works -Follow these steps: +=head3 Configuring Vim -=head2 Install required packages +Do the following: -Run the following: + cp /usr/share/muttdelay/muttdelay.vim ~/.vim/plugin/ + echo 'map ,L :call MuttDelay()<CR>' >> ~/.vimrc - sudo aptitude install lintian devscripts dpkg-dev make perl +=head3 Configuring CRON -Todo: Ensure this are the correct packages. In order to test that I would have to setup a blank Debian system. +And create an hourly cronjob such as: -=head2 Compile the project + 0 * * * * /usr/bin/muttdelay cron -Go to the to level directory and run +=head3 Configuring msmtp - make +For example like this (change your configuration accordingly to fit your needs): -To test run + cp /usr/share/muttdelay/msmtprc.example ~/.msmtprc + vim ~/.msmtprc - ./bin/muttdelay +And ensure that you can send mails like this: -It should print out the version number of the project. + msmtp your@address.example.com <<< Hallo -=head2 Create a Debian package +If it works, you can go on -Go to the to level directory and run +=head3 Use it - make deb +Open mutt, compose an email. Use Vim as your editor. After finishing writing your mail don't close Vim, but run -It will create the files like: + ,L - ../muttdelay_0.0.0.0_all.deb - ../muttdelay_0.0.0.0.dsc - ../muttdelay_0.0.0.0_amd64.changes - ../muttdelay_0.0.0.0.tar.gz +and the mail gets scheduled for sending for a later time. You can now leave vim without sending the mail via mutt directly. -It should create a debian package in ../. Check and install it, e.g: +The mail tself is saved to - lintian --pedantic ../muttdelay_0.0.0.0_all.deb - sudo dpkg -i ../muttdelay_0.0.0.0_all.deb + ~/.muttdelay/SENDTIMESTAMP.COMPOSETIMESTAMP -Run +The cron job checks if there is any SENDTIMESTAMP lower than the current unix time stamp. And if so, all matching mails are sent. - dpkg -L muttdelay +=head1 LICENSE -to see whats in there. You can now run +See package description or project website. - /usr/bin/muttdelay +=head1 AUTHOR -or for example +Paul C. Buetow - <http://muttdelay.buetow.org> - man muttdelay - -=head2 Read the Makefile - -Read the Makefile in order to understand what's going on. - -=head1 Customize - -Now, since you understood everything feel free to customize everything the way you want it. E.g.: - - Don't use POD for documentation but LaTeX - - Compile a C program - - Include a ./lib dir, add it to the 'install' Makefile rule - - etc etc. - -You should also consider the following: - -=head2 Manual page - -This muttdelay is using POD for creating manual pages. Edit ./docs/muttdelay.pod and run - - make documentation - -in order to build ./docs/muttdelay.1. The page will be included in the resulting debian package automatically. You can review the page with - - man ./docs/muttdelay.1 - -=head2 Renaming muttdelay into your project name - -Rename all files which have *muttdelay* included into your own new package name. You can do that with: - - PROJECTNAME=yourproject - find . -name \*muttdelay\* | - while read muttdelay; do git mv $muttdelay ${muttdelay/muttdelay/$PROJECTNAME}; done - -Search all content and rename *muttdelay* into your own new package name. You can do that with: - - grep -R muttdelay . | grep -v .git | - cut -d: -f1 | uniq | xargs sed -i "s/muttdelay/$PROJECTNAME/g" - -=head2 Updating ./debian - -Edit the following files accordingly to your new project (e.g. with vim): - - vim ./debian/{control,copyright,README} - -=head2 Update changelog - -Go to the to level directory and run - - dch -i +=cut diff --git a/docs/muttdelay.txt b/docs/muttdelay.txt index 08f2279..e550312 100644 --- a/docs/muttdelay.txt +++ b/docs/muttdelay.txt @@ -1,114 +1,54 @@ NAME - muttdelay - A muttdelay project + muttdelay - A bash script to delay mails written via mutt WTF? - You may use this project in order to build your own Debian package for - your own project. This has been tested with Debian GNU/Linux Squeeze and - Debian GNU/Linux Wheezy. + This is for scheduling the sending of mails for a specific future time. + Unlinke postponing a mail which does not involve the scheduling. - Feel free to modify any aspects. This project is just an empty example - muttdelay. + How it works + Configuring Vim + Do the following: - Follow these steps: + cp /usr/share/muttdelay/muttdelay.vim ~/.vim/plugin/ + echo 'map ,L :call MuttDelay()<CR>' >> ~/.vimrc - Install required packages - Run the following: + Configuring CRON + And create an hourly cronjob such as: - sudo aptitude install lintian devscripts dpkg-dev make perl + 0 * * * * /usr/bin/muttdelay cron - Todo: Ensure this are the correct packages. In order to test that I - would have to setup a blank Debian system. + Configuring msmtp + For example like this (change your configuration accordingly to fit your + needs): - Compile the project - Go to the to level directory and run + cp /usr/share/muttdelay/msmtprc.example ~/.msmtprc + vim ~/.msmtprc - make + And ensure that you can send mails like this: - To test run + msmtp your@address.example.com <<< Hallo - ./bin/muttdelay + If it works, you can go on - It should print out the version number of the project. + Use it + Open mutt, compose an email. Use Vim as your editor. After finishing + writing your mail don't close Vim, but run - Create a Debian package - Go to the to level directory and run + ,L - make deb + and the mail gets scheduled for sending for a later time. You can now + leave vim without sending the mail via mutt directly. - It will create the files like: + The mail tself is saved to - ../muttdelay_0.0.0.0_all.deb - ../muttdelay_0.0.0.0.dsc - ../muttdelay_0.0.0.0_amd64.changes - ../muttdelay_0.0.0.0.tar.gz + ~/.muttdelay/SENDTIMESTAMP.COMPOSETIMESTAMP - It should create a debian package in ../. Check and install it, e.g: + The cron job checks if there is any SENDTIMESTAMP lower than the current + unix time stamp. And if so, all matching mails are sent. - lintian --pedantic ../muttdelay_0.0.0.0_all.deb - sudo dpkg -i ../muttdelay_0.0.0.0_all.deb +LICENSE + See package description or project website. - Run - - dpkg -L muttdelay - - to see whats in there. You can now run - - /usr/bin/muttdelay - - or for example - - man muttdelay - - Read the Makefile - Read the Makefile in order to understand what's going on. - -Customize - Now, since you understood everything feel free to customize everything - the way you want it. E.g.: - - Don't use POD for documentation but LaTeX - - Compile a C program - - Include a ./lib dir, add it to the 'install' Makefile rule - - etc etc. - - You should also consider the following: - - Manual page - This muttdelay is using POD for creating manual pages. Edit - ./docs/muttdelay.pod and run - - make documentation - - in order to build ./docs/muttdelay.1. The page will be included in the - resulting debian package automatically. You can review the page with - - man ./docs/muttdelay.1 - - Renaming muttdelay into your project name - Rename all files which have *muttdelay* included into your own new - package name. You can do that with: - - PROJECTNAME=yourproject - find . -name \*muttdelay\* | - while read muttdelay; do git mv $muttdelay ${muttdelay/muttdelay/$PROJECTNAME}; done - - Search all content and rename *muttdelay* into your own new package - name. You can do that with: - - grep -R muttdelay . | grep -v .git | - cut -d: -f1 | uniq | xargs sed -i "s/muttdelay/$PROJECTNAME/g" - - Updating ./debian - Edit the following files accordingly to your new project (e.g. with - vim): - - vim ./debian/{control,copyright,README} - - Update changelog - Go to the to level directory and run - - dch -i +AUTHOR + Paul C. Buetow - <http://muttdelay.buetow.org> diff --git a/src/msmtprc.sample b/src/msmtprc.sample new file mode 100644 index 0000000..cd2c748 --- /dev/null +++ b/src/msmtprc.sample @@ -0,0 +1,15 @@ +defaults +tls on +tls_certcheck off +#tls_trust_file /etc/ssl/certs/ca-certificates.crt +#logfile ~/tmp/debug.log + +account myaccount +host smtp.example.org +from example@example.org +auth on +user myuser +password mypass + +account default : myaccount + diff --git a/src/muttdelay.vim b/src/muttdelay.vim new file mode 100644 index 0000000..dff6ce4 --- /dev/null +++ b/src/muttdelay.vim @@ -0,0 +1,8 @@ +" MUTTDELAY + +function! MuttDelay() + write + let l:curfile = expand('%:p') + execute '!muttdelay vim "' . l:curfile . '"' +endfunction + |
