Package: smbldap-tools
Version: 0.9.4-1
The '-T' parameter suffer some bugs, by the way of how smbldap-tools
handle parsing.
1) help and manpage say that -T parameter can have a list of email
comma separated, but:
smbldap-usermod -T "cristina,[email protected]" cristina
failed to modify entry: mailRoutingAddress: multiple values provided at
/usr/sbin/smbldap-usermod line 617.
2) if i have to reset the email forwarding, i have to use:
smbldap-usermod -T "," cristina
if i use -T "" does nothing.
Both trouble arise from the fact that mailRoutingAddress are
single-valued, so have to take a string and not an array as input.
Quick patch/hack attached, that probably have to be adapted also for
smbldap-useradd (i've not tested).
--- smbldap-usermod.orig 2010-04-23 10:02:56.000000000 +0200
+++ smbldap-usermod 2010-04-23 10:09:11.000000000 +0200
@@ -398,9 +398,10 @@
$mailobj = 1;
}
-if ($tmp= $Options{'T'}) {
+if (defined($tmp= $Options{'T'})) {
my $action= '';
my @old;
+ my $suserMailTo;
# action si + or - for adding or deleting an entry
if ($tmp =~ s/^([+-])+\s*//) {
$action= $1;
@@ -414,7 +415,8 @@
} elsif ($action eq '-') {
@userMailTo = &list_minus(\...@old, \...@usermailto);
}
- push(@mods, 'mailRoutingAddress', [ @userMailTo ]);
+ $suserMailTo = join(',', @userMailTo);
+ push(@mods, 'mailRoutingAddress' => $suserMailTo );
$mailobj = 1;
}
if ($mailobj) {