jaromail

a commandline tool to easily and privately handle your e-mail
git clone git://parazyd.org/jaromail.git
Log | Files | Refs | Submodules | README

commit 5ec3e9ffa0a522fc8a71f24ef4793980eb10580d
parent 13317deda93aff611f332b95083f3e5bf1be05f7
Author: Jaromil <jaromil@dyne.org>
Date:   Sun,  8 Jul 2012 13:36:52 +0200

build on fedora and various optimizations to stats

Diffstat:
MTODO | 18++++++++++++------
Mbuild/build-gnu.sh | 105++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
Mdoc/jaromail-manual.org | 4++--
Minstall.sh | 22++++++++++++++++------
Msrc/zlibs/email | 4++--
Msrc/zlibs/stats | 10++++++++--
6 files changed, 131 insertions(+), 32 deletions(-)

diff --git a/TODO b/TODO @@ -4,26 +4,32 @@ + Integration with org-remember via org-protocol or maybe just to taskwarrior +* TBT + time based text, all included in html mails + * Anonymizer + Built-in support for Mixmaster + Built-in support for Tor Mail * Install + Full integration with the Tomb process creation + + integrate install/setup command in jaro -* Mutt +* Mouse enable MUA + mutt or mu in debian? + Find out how to make mouse selection work -* Stats - + Have some fancy statistics - use timecloud for a jquery visualization - * Speedmail or Quickmail write down a mail from commandline and send it right away (if online) doesn't uses Mutt to generate the mail body but might read Mutt.txt configuration for headers and such -* Filtering +* Stats + + Have some fancy statistics + use timecloud for a jquery visualization + + include anu arg's mailinglist statistics + +* DONE Filtering filter out bounces in some zz.bounces - header: : Sender: mailman-bounces@ diff --git a/build/build-gnu.sh b/build/build-gnu.sh @@ -7,6 +7,8 @@ distro=unknown cflags="-O2" which apt-get && distro=debian +which yum && distro=fedora + # no other distro supported atm @@ -24,9 +26,9 @@ case $distro in which wipe || sudo apt-get install wipe echo "Checking build dependencies" - which gcc || sudo apt-get install bison + which gcc || sudo apt-get install gcc which bison || sudo apt-get install bison - which flex || sudo apt-get install bison + which flex || sudo apt-get install flex [ -r /usr/share/doc/libgnome-keyring-dev/copyright ] || \ sudo apt-get install libglib2.0-dev libgnome-keyring-dev @@ -36,8 +38,81 @@ case $distro in echo "fetchaddr" - gcc $cflags -c fetchaddr.c helpers.c rfc2047.c rfc822.c; \ + gcc $cflags -c fetchaddr.c helpers.c rfc2047.c rfc822.c; \ + gcc $cflags -o fetchaddr fetchaddr.o helpers.o rfc2047.o rfc822.o + cd - > /dev/null + + echo "Compiling the search engine..." + cd src/mairix + ./configure + make > /dev/null + cd - > /dev/null + + + echo -n "Compiling the date parser... " + cd src + gcc $cflags -I mairix -c fetchdate.c + gcc $cflags -DHAS_STDINT_H -DHAS_INTTYPES_H -DUSE_GZIP_MBOX \ + -o fetchdate fetchdate.o \ + mairix/datescan.o mairix/db.o mairix/dotlock.o \ + mairix/expandstr.o mairix/glob.o mairix/md5.o \ + mairix/nvpscan.o mairix/rfc822.o mairix/stats.o \ + mairix/writer.o mairix/dates.o mairix/dirscan.o \ + mairix/dumper.o mairix/fromcheck.o mairix/hash.o mairix/mbox.o \ + mairix/nvp.o mairix/reader.o mairix/search.o mairix/tok.o \ + -lz + echo "fetchdate" + cd - > /dev/null + + cp src/mairix/mairix build/gnu/ + cp src/fetchaddr build/gnu/ + cp src/fetchdate build/gnu/ + + echo "Compiling gnome-keyring" + cd src/gnome-keyring + gcc jaro-gnome-keyring.c \ + `pkg-config --cflags --libs glib-2.0 gnome-keyring-1` \ + $cflags -o jaro-gnome-keyring + cd - > /dev/null + cp src/gnome-keyring/jaro-gnome-keyring build/gnu/ + + echo "Done compiling." + echo "Now run ./install.sh and Jaro Mail will be ready in ~/Mail" + echo "or \"./install.sh path\" to install it somewhere else." + ;; + + + fedora) + mkdir -p build/gnu + + echo "Checking software to install..." + which zsh || sudo yum install zsh + which mutt || sudo yum install mutt + which procmail || sudo yum install procmail + which msmtp || sudo yum install msmtp + which pinentry || sudo yum install pinentry + which fetchmail || sudo yum install fetchmail + which wipe || sudo yum install wipe + + echo "Checking build dependencies" + which gcc || sudo yum install gcc + which bison || sudo yum install bison + which flex || sudo yum install flex + { test -r /usr/share/doc/libgnome-keyring-3.2.0/COPYING } && { + sudo yum install glib2-devel libgnome-keyring-devel } + + echo "All dependencies installed" + cd src + echo -n "Compiling the address parser... " + + + echo "fetchaddr" + gcc $cflags -c fetchaddr.c helpers.c rfc2047.c rfc822.c; \ gcc $cflags -o fetchaddr fetchaddr.o helpers.o rfc2047.o rfc822.o + + echo "dotlock" + gcc $cflags -c dotlock.c + gcc $cflags -o dotlock dotlock.o cd - > /dev/null echo "Compiling the search engine..." @@ -49,28 +124,28 @@ case $distro in echo -n "Compiling the date parser... " cd src - gcc $cflags -I mairix -c fetchdate.c - gcc $cflags -DHAS_STDINT_H -DHAS_INTTYPES_H -DUSE_GZIP_MBOX \ - -o fetchdate fetchdate.o \ - mairix/datescan.o mairix/db.o mairix/dotlock.o \ - mairix/expandstr.o mairix/glob.o mairix/md5.o \ - mairix/nvpscan.o mairix/rfc822.o mairix/stats.o \ - mairix/writer.o mairix/dates.o mairix/dirscan.o \ - mairix/dumper.o mairix/fromcheck.o mairix/hash.o mairix/mbox.o \ - mairix/nvp.o mairix/reader.o mairix/search.o mairix/tok.o \ - -lz + gcc $cflags -I mairix -c fetchdate.c + gcc $cflags -DHAS_STDINT_H -DHAS_INTTYPES_H -DUSE_GZIP_MBOX \ + -o fetchdate fetchdate.o \ + mairix/datescan.o mairix/db.o mairix/dotlock.o \ + mairix/expandstr.o mairix/glob.o mairix/md5.o \ + mairix/nvpscan.o mairix/rfc822.o mairix/stats.o \ + mairix/writer.o mairix/dates.o mairix/dirscan.o \ + mairix/dumper.o mairix/fromcheck.o mairix/hash.o mairix/mbox.o \ + mairix/nvp.o mairix/reader.o mairix/search.o mairix/tok.o echo "fetchdate" cd - > /dev/null cp src/mairix/mairix build/gnu/ cp src/fetchaddr build/gnu/ cp src/fetchdate build/gnu/ + cp src/dotlock build/gnu/ echo "Compiling gnome-keyring" cd src/gnome-keyring gcc jaro-gnome-keyring.c \ `pkg-config --cflags --libs glib-2.0 gnome-keyring-1` \ - -O2 -o jaro-gnome-keyring + $cflags -o jaro-gnome-keyring cd - > /dev/null cp src/gnome-keyring/jaro-gnome-keyring build/gnu/ @@ -79,6 +154,8 @@ case $distro in echo "or \"./install.sh path\" to install it somewhere else." ;; + + *) echo "Error: no distro recognized, build by hand." ;; diff --git a/doc/jaromail-manual.org b/doc/jaromail-manual.org @@ -355,8 +355,8 @@ what you delete here will be removed from the server and won't be there when you download it from home. This functionality can be also very useful if you are from a slow -connection and need to delete some email that is clogging your mailbox -and that you are not able to download because of its size. +connection and need to delete some email that is clogging it and that +you are not able to download because of its size. ** Send emails whenever possible diff --git a/install.sh b/install.sh @@ -154,6 +154,10 @@ name To Be Configured # Email address (default is same as login) email unknown@gmail.com +# Aliases also received on this mail +# alias mimesis@gmail.com +# alias nemesis@gmail.com + # Internet address host imap.gmail.com @@ -178,9 +182,15 @@ port 993 options keep # Imap folders -# uncommend to provide a list of folders to be fetched +# uncomment to provide a list of folders to be fetched # folders INBOX, known, priv, lists, ml.unsorted, unsorted +# Remote sieve +# command to upload a sieve filter to the server +# %% will be filled in automatically with our file +# remote_sieve_cmd scp %% assata.dyne.org:/var/mail/sieve-scripts/email + + # # The password field will be filled in automatically # @@ -239,12 +249,12 @@ cp src/fetchdate $WORKDIR/bin/ case $OS in MAC) cp -a build/osx/* $WORKDIR/bin ;; GNU) cp -a build/gnu/* $WORKDIR/bin -rm -f $WORKDIR/bin/dotlock -cat <<EOF > $WORKDIR/bin/dotlock +#rm -f $WORKDIR/bin/dotlock +#cat <<EOF > $WORKDIR/bin/dotlock #!/usr/bin/env zsh -mutt_dotlock \${=@} -EOF -chmod a+x $WORKDIR/bin/dotlock +#mutt_dotlock \${=@} +#EOF +#chmod a+x $WORKDIR/bin/dotlock ;; esac diff --git a/src/zlibs/email b/src/zlibs/email @@ -28,7 +28,7 @@ queue() { # add mails to the sendout queue ${=mkdir} $MAILDIRS/outbox - cd $MAILDIRS/outbox || return 1 + pushd $MAILDIRS/outbox notice "Adding mail to the outbox queue" # Create new unique filenames of the form # MAILFILE: ccyy-mm-dd-hh.mm.ss[-x].mail @@ -54,7 +54,7 @@ queue() { # Write the mail to $MAILFILE cat > "$mailfile" unlock $msmtpfile - cd - + popd return 0 } diff --git a/src/zlibs/stats b/src/zlibs/stats @@ -95,8 +95,12 @@ EOF error "Error creating temporary week stats database." return 1 } + act "gathering timestamps..." for m in ${maildirs}; do - for f in `find $MAILDIRS/${m} -type f`; do + func " ${m}" + rm -rf $TMPDIR/weekstats.db.mdir + cp -r $MAILDIRS/${m} $TMPDIR/weekstats.db.mdir + for f in `find $TMPDIR/weekstats.db.mdir -type f`; do timestamp=`fetchdate "%Y-%U" ${f}` mdir=`print $m|cut -d. -f1` cat <<EOF | ${SQL} -batch $db > $sql @@ -118,7 +122,9 @@ EOF fi done done - # gather results from the database + # render results from the database + act "rendering results..." + table=$WORKDIR/.stats/jaromail.html ${=mkdir} $WORKDIR/.stats