[EMAIL PROTECTED] schreef:

> Date: Wed, 2 Apr 2008 12:59:01 +0200
> From: Mark Martinec <[EMAIL PROTECTED]>
> Subject: Re: [AMaViS-user] Help with custom config / lookups
> To: [email protected]
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain;  charset="iso-8859-1"
>
> Patrick,
>
>   
>> > I am trying to implement a vacation module for amavis,
>> > using the amavisd-custom config.
>>     
> For new development work using amavisd-custom config,
> please use amavisd-new-2.6.0-rc1 and its amavisd-custom.conf
> as a template. There were some incompatible changes in
> custom hooks since 2.5.4.
>
> The 2.6.0-rc1 already provides a simple template (by the
> very end of the file 'amavisd') for auto-responses.
> It is stored in a variable $notify_autoresp_templ.
> (access it through: cr('notify_release_templ_by_ccat').
>
> It is currently unused (juas read and stored), intended
> to be used from custom hooks.
>
>   
>> > I have trouble doing 
>> > LDAP lookups. Does someone have a code snippet
>> > or other example of how to setup LDAP lookups from
>> > the custom config?
>>     
>
> I'm not using LDAP myself, so I'm haven't tried it.
> Perhaps the low-level use through Amavis::Lookup::LDAPattr->new
> and $obj->lookup_ldap_attr would be easiest.
>
>   

I have added a special field called 'autorespondertext' to the LDAP schema.
The end user can define the content of this himself.

I have added some stuff to the amavisd-custom.conf:

BEGIN {
 ......
  import Amavis::Lookup;
}

in before_send:

   my($ll) = 5;
   my $ldap_connection = Amavis::LDAP::Connection->new($default_ldap);
   my $ldap_policy = 
Amavis::Lookup::LDAP->new($default_ldap,$ldap_connection);
   my $lf = sub{Amavis::Lookup::LDAPattr->new($ldap_policy,@_)};
   my @autoresponder_usertext_ldap  = $lf->('autorespondertext', 'S-');

I have the following problem: I don't know how to handle the result of
$lf->('autorespondertext', 'S-'), i.e. how do I get the autorespondertext.

I inspected the variable with dump, and got the following result,
which does not make much sense for me:

$VAR1 = bless( {
                 'attrname' => 'autorespondertext',
                 'ldap_query' => bless( {
                                          'base' => 'dc=xxxxxx',
                                          'query_filter' => 
'(&(objectClass=xxxxxxxxxxxxx)(uid=%m))',
                                          'conn_h' => bless( {
                                                               'base' => 
'dc=pine',
                                                               'ldap' => 
undef,
                                                               'bind_dn' 
=> 'cn=spamassassin,dc=xxxxxxxx',
                                                               
'hostname' => 'localhost',
                                                               'tls' => 0,
                                                               'port' => 
389,
                                                               'deref' 
=> 'find',
                                                               
'bind_password' => 'xxxxxxxx',
                                                               'timeout' 
=> 120,
                                                               
'incarnation' => 1,
                                                               'scope' 
=> 'sub'
                                                             }, 
'Amavis::LDAP::Connection' ),
                                          'incarnation' => 0,
                                          'scope' => 'sub'
                                        }, 'Amavis::Lookup::LDAP' ),
                 'attrtype' => 'S-'
               }, 'Amavis::Lookup::LDAPattr' );


Also the LDAP lookups don't appear in the log, though $ll is set to 5 in 
both
amavisd and in the custom config.


Any advice?
> Calls to do_log from custom hooks should work normally.
> See the amavisd-custom.conf example.
>
>   Mark


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to