From 6a7dda969b21f5117a34a2475f80b35399d9bae8 Mon Sep 17 00:00:00 2001 From: fkrone Date: Mon, 25 May 2015 00:28:55 +0200 Subject: [PATCH] Bugfix: The mailgate crashes with certain settings when mail is delivered locally --- gpg-mailgate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gpg-mailgate.py b/gpg-mailgate.py index a8738bf..eb11a7e 100755 --- a/gpg-mailgate.py +++ b/gpg-mailgate.py @@ -332,7 +332,8 @@ def sanitize_case_sense( address ): address = address.lower() else: splitted_address = address.split('@') - address = splitted_address[0] + '@' + splitted_address[1].lower() + if len(splitted_address) > 1: + address = splitted_address[0] + '@' + splitted_address[1].lower() return address