Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

procmail

  • Loading branch information...
commit 60a920130c76c7ab7b6cb38219a8e13dcd3e0707 1 parent f829e1b
@dlobraico authored
View
0  mutt/auto_alias.sh → mutt/bin/auto_alias.sh
File renamed without changes
View
45 mutt/bin/get_keychain_password.py
@@ -0,0 +1,45 @@
+#!/usr/bin/python
+import re, subprocess, argparse
+
+def get_keychain_pass(account=None, server=None):
+ params = {
+ 'security': '/usr/bin/security',
+ 'command': 'find-internet-password',
+ 'account': account,
+ 'server': server,
+ 'keychain': '/Users/dlobraico/Library/Keychains/login.keychain',
+ }
+ command = "sudo -u dlobraico %(security)s -v %(command)s -g -a %(account)s -s %(server)s %(keychain)s" % params
+ output = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT)
+ outtext = [l for l in output.splitlines()
+ if l.startswith('password: ')][0]
+
+ result = re.match(r'password: "(.*)"', outtext)
+ if result == None:
+ return re.match(r'password: (.*) "(.*)"', outtext).group(2).decode('string_escape')
+ else:
+ return result.group(1)
+
+def main(**kwargs):
+ escaped = kwargs["escaped"]
+ result = get_keychain_pass(account=kwargs["ACCOUNT"], server=kwargs["SERVER"])
+ if escaped:
+ print result.replace('\\', '\\\\')
+ else:
+ print result
+ return result
+
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(
+ description='Fetch an account password from the login Keychain.',
+ version='$(prog)s 0.1')
+ parser.add_argument('ACCOUNT', type=str, help='account username')
+ parser.add_argument('SERVER', type=str, help='account server')
+ parser.add_argument('--escaped',
+ action="store_true",
+ default=False,
+ help='escape backslashes and would-be control sequences')
+ args = parser.parse_args()
+ main(**vars(args))
+
View
0  mutt/offlineimap.py → mutt/bin/offlineimap.py
File renamed without changes
View
0  mutt/view_attachment.sh → mutt/bin/view_attachment.sh
File renamed without changes
View
20 mutt/mailcap
@@ -1,22 +1,22 @@
# MS Word documents
-application/msword; ~/.mutt/view_attachment.sh %s "-" '/Applications/TextEdit.app'
-application/vnd.openxmlformats-officedocument.wordprocessingml.document; ~/.mutt/view_attachment.sh %s docx
+application/msword; ~/.mutt/bin/view_attachment.sh %s "-" '/Applications/TextEdit.app'
+application/vnd.openxmlformats-officedocument.wordprocessingml.document; ~/.mutt/bin/view_attachment.sh %s docx
# Images
-image/jpg; ~/.mutt/view_attachment.sh %s jpg
-image/jpeg; ~/.mutt/view_attachment.sh %s jpg
-image/pjpeg; ~/.mutt/view_attachment.sh %s jpg
-image/png; ~/.mutt/view_attachment.sh %s png
-image/gif; ~/.mutt/view_attachment.sh %s gif
+image/jpg; ~/.mutt/bin/view_attachment.sh %s jpg
+image/jpeg; ~/.mutt/bin/view_attachment.sh %s jpg
+image/pjpeg; ~/.mutt/bin/view_attachment.sh %s jpg
+image/png; ~/.mutt/bin/view_attachment.sh %s png
+image/gif; ~/.mutt/bin/view_attachment.sh %s gif
# PDFs
-application/pdf; ~/.mutt/view_attachment.sh %s pdf
+application/pdf; ~/.mutt/bin/view_attachment.sh %s pdf
# HTML
-#text/html; ~/.mutt/view_attachment.sh %s html
+#text/html; ~/.mutt/bin/view_attachment.sh %s html
text/html; pandoc -f html -t markdown; copiousoutput; compose=vim %s
text/plain; less %s
# Unidentified files
-application/octet-stream; ~/.mutt/view_attachment.sh %s "-"
+application/octet-stream; ~/.mutt/bin/view_attachment.sh %s "-"
View
4 muttrc
@@ -36,7 +36,7 @@ set thorough_search
bind compose p postpone-message
bind index p recall-message
-auto_view text/html message/rfc822
+auto_view text/html
# Editor
set text_flowed = yes
@@ -159,7 +159,7 @@ set query_command = "contacts -Sf '%e;%n' '%s' | awk -F ';' '$1' | sort -k 1 | s
set alias_file = "$HOME/.mutt/aliases"
source "$HOME/.mutt/aliases"
-set display_filter = "$HOME/.mutt/auto_alias.sh"
+set display_filter = "$HOME/.mutt/bin/auto_alias.sh"
# Search
#bind index N search-opposite
View
2  offlineimaprc
@@ -4,7 +4,7 @@ accounts = personal, school, csd, tds
maxsyncaccounts = 4
status_backend = sqlite
ui = ttyui
-pythonfile=~/.mutt/offlineimap.py
+pythonfile=~/.mutt/bin/offlineimap.py
fsync = False
#### Personal Google Apps - d@lobraico.com
View
7 procmail/rc.sent
@@ -0,0 +1,7 @@
+# Render markdown email to HTML
+:0f
+| $HOME/.mutt/bin/markdownmail
+
+# Send via msmtp
+:0w
+| msmtp $msmtp_args
Please sign in to comment.
Something went wrong with that request. Please try again.