1. getting your notes done

    i stumbled upon a great idea: store quick notes in a private mailbox. it's a very smart solution especially because the notes are searchable and available from anywhere. the concept is very easy to implement therefore it's adjustable to various toolchains.

    pbrisbin provides a command-line+mutt+GMail solution. i did a few modifications to accomplish a GMail free and 'offline-working' version. i replaced mutt by msmtpQ a wrapper for msmtp and GMail by a procmail filter. in addition i made the subject prefix optional and added a custom e-mail header to tag the note.

    #shell script
    function noteit() {
      # http://www.christoph-polcin.com/blog/getting-your-notes-done
      # based on http://pbrisbin.com/posts/notes
    
      local message subject="$*" mail="YOUR@EMAIL.com"
    
      [[ -z "$subject" ]] && { echo 'no subject.'; return 1; }
    
      echo -e "^D to save, ^C to cancel\nNote:\n"
    
      message="$(cat)"
    
      [[ -z "$message" ]] && { echo 'no message.'; return 1; }
    
      echo "From: $mail\nTo: $mail\nSubject: $subject\nX-Tag: note\n\n$message" \
           |/usr/local/bin/msmtpQ $mail &> /dev/null
    
      [[ $? -ne 0 ]] && { echo "failed."; return 1; }
    }
    
    #procmail filter
    :0
    * ^From:.*@MY-DOMAIN\.COM
    * (^X-Tag:.*note|^Subject:.*\[note\])
    mail/mynotes
    
  2. Post new comment

    The content of this field is kept private and will not be shown publicly.
    • Web page addresses and e-mail addresses turn into links automatically.
    • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
    • Lines and paragraphs break automatically.

    More information about formatting options

    Image CAPTCHA
    Enter the characters shown in the image.