Thanks for the reply, and yes, you're right that I'd only provided a part of my read_from_ldap.pl script. The rest of it is below. Your suggestion helped me get past that error (not sure why I thought it'd be listening on localhost and not the assigned IP but that's OK).
Now when I run my check_disclaimers.sh script I get the following:
Code:
pp-colo:/opt/zimbra/postfix/conf/disclaimers # ../check_disclaimers.sh
Domain: pressaprint.com TRUE
No signature
No HTML signature
cp: cannot stat `/opt/zimbra/postfix/conf/disclaimers/pressaprint.com': No such file or directory
Domain: thesqladvantage.com NONE
I've looked through the read_from_ldap.pl script which is generating that output and I think the relevant lines are these ones:
Code:
$mesg = $ldap->search (
base => $base,
filter => "(&(objectClass=zimbraDomain) (dc=$sub))",
attrs => ['zimbraDomainPrefMailSignature']
);
foreach ($mesg->entries) {
my @result= $_->{'asn'}->{'attributes'};
if($result[0][0]{'vals'}[0]){
open (TMPFILE,">$tmpfile");
print TMPFILE "---------------------------------------------------\n";
print TMPFILE "$result[0][0]{'vals'}[0]\n";
}
else {
print "No signature\n"
}
};
$mesg = $ldap->search (
base => "$base",
filter => "(&(objectClass=zimbraDomain) (dc=$sub))",
attrs => ['zimbraDomainPrefMailSignatureHTML']
);
foreach ($mesg->entries) {
my @result= $_->{'asn'}->{'attributes'};
if($result[0][0]{'vals'}[0]){
open (TMPFILE2,">$tmpfile.html");
print TMPFILE2 "---------------------------------------------------\n";
print TMPFILE2 "$result[0][0]{'vals'}[0]\n";
}
else {
print "No HTML signature\n";
system ("cp -f $tmpfile $tmpfile.html");
}
}; I'm pretty sure that's where it's trying to determine the values for my signatures. I've checked my domain via 'zmprov gd pressaprint.com' and I get the following:
Code:
...
zimbraDomainName: pressaprint.com
zimbraDomainPrefMailSignature: This email is confidential.
zimbraDomainPrefMailSignatureEnabled: TRUE
zimbraDomainPrefMailSignatureHTML: This email is confidential.
...
So I do have those properties and values, but it's either not able to read them or it's not able to create the files where they should be put. I've checked that the disclaimers directory can be written to, but that didn't seem to have any effect. Thanks again for the help!
--Dan