From: Wade Berrier Date: Sat, 19 Jan 2013 20:55:41 +0000 (-0700) Subject: Return results in a format that mutt expects X-Git-Tag: v0.1~27^2~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1af8ca5768188324c8ab48d7496e530f07de2587;p=mutt-ldap.git Return results in a format that mutt expects According to: http://www.mutt.org/doc/manual/manual-4.html#ss4.5 --- 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__':