From 1af8ca5768188324c8ab48d7496e530f07de2587 Mon Sep 17 00:00:00 2001 From: Wade Berrier Date: Sat, 19 Jan 2013 13:55:41 -0700 Subject: [PATCH] Return results in a format that mutt expects According to: http://www.mutt.org/doc/manual/manual-4.html#ss4.5 --- mutt-ldap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mutt-ldap.py b/mutt-ldap.py index f715937..92607ed 100755 --- a/mutt-ldap.py +++ b/mutt-ldap.py @@ -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__': -- 2.26.2