Return results in a format that mutt expects
authorWade Berrier <wberrier@gmail.com>
Sat, 19 Jan 2013 20:55:41 +0000 (13:55 -0700)
committerWade Berrier <wberrier@gmail.com>
Sat, 19 Jan 2013 20:55:41 +0000 (13:55 -0700)
According to: http://www.mutt.org/doc/manual/manual-4.html#ss4.5

mutt-ldap.py

index f7159378762e0f55ed009e8923cb0d3a143a6258..92607edb54900db99d546ee189f74e4519530d65 100755 (executable)
@@ -103,7 +103,9 @@ def format_entry(entry):
     if 'mail' in data:
         name = data.get('displayName', data['cn'])[-1]
         for m in data['mail']:
-            yield email.utils.formataddr((name, m))
+            # http://www.mutt.org/doc/manual/manual-4.html#ss4.5
+            # Describes the format mutt expects: address\tname
+            yield "\t".join([m, name])
 
 
 if __name__ == '__main__':