projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use json marshalling
[mirror/userdir-ldap.git]
/
ud-mailgate
diff --git
a/ud-mailgate
b/ud-mailgate
index
8439037
..
fdc3cfd
100755
(executable)
--- a/
ud-mailgate
+++ b/
ud-mailgate
@@
-615,7
+615,7
@@
def HandleChange(Reply,DnRecord,Key):
# Connect to the ldap server
l = connect_to_ldap_and_check_if_locked(DnRecord)
# Connect to the ldap server
l = connect_to_ldap_and_check_if_locked(DnRecord)
- if CommitChanges == 1: # only if we are still good to go
+ if CommitChanges == 1
and len(Attrs) > 0
: # only if we are still good to go
try:
Res = FinishConfirmSudopassword(l, GetAttr(DnRecord,"uid"), Attrs)
if not Res is None:
try:
Res = FinishConfirmSudopassword(l, GetAttr(DnRecord,"uid"), Attrs)
if not Res is None:
@@
-624,8
+624,7
@@
def HandleChange(Reply,DnRecord,Key):
CommitChanges = 0
Result = Result + "FinishConfirmSudopassword raised an error (%s) - no changes committed\n"%(e);
CommitChanges = 0
Result = Result + "FinishConfirmSudopassword raised an error (%s) - no changes committed\n"%(e);
- # Modify the record
- if CommitChanges == 1:
+ if CommitChanges == 1 and len(Attrs) > 0:
Dn = "uid=" + GetAttr(DnRecord,"uid") + "," + BaseDn;
l.modify_s(Dn,Attrs);
Dn = "uid=" + GetAttr(DnRecord,"uid") + "," + BaseDn;
l.modify_s(Dn,Attrs);
@@
-752,8
+751,8
@@
try:
# Get the email
ErrType = EX_PERMFAIL;
ErrMsg = "Failed to understand the email or find a signature:";
# Get the email
ErrType = EX_PERMFAIL;
ErrMsg = "Failed to understand the email or find a signature:";
-
e
mail = email.parser.Parser().parse(sys.stdin);
- Msg = GetClearSig(
e
mail);
+ mail = email.parser.Parser().parse(sys.stdin);
+ Msg = GetClearSig(mail);
ErrMsg = "Message is not PGP signed:"
if Msg[0].find("-----BEGIN PGP SIGNED MESSAGE-----") == -1 and \
ErrMsg = "Message is not PGP signed:"
if Msg[0].find("-----BEGIN PGP SIGNED MESSAGE-----") == -1 and \
@@
-802,8
+801,8
@@
try:
# Determine the sender address
ErrMsg = "A problem occured while trying to formulate the reply";
# Determine the sender address
ErrMsg = "A problem occured while trying to formulate the reply";
- Sender =
e
mail['Reply-To']
- if not Sender: Sender =
e
mail['From']
+ Sender = mail['Reply-To']
+ if not Sender: Sender = mail['From']
if not Sender: raise UDFormatError, "Unable to determine the sender's address";
# Formulate a reply
if not Sender: raise UDFormatError, "Unable to determine the sender's address";
# Formulate a reply