Le mercredi 28 janvier 2009 à 14:00 +0000, Steve Kemp a écrit :
> On Wed Jan 28, 2009 at 14:57:31 +0100, Julien wrote:
> 
> > I have read this topic, but it don't work for me ... 
> 
>   (I'll assume you didn't forget to restart.)

I do a : svc -d /service/qpsmtpd ; svc -u /service/qpsmtpd
and logs says : tcpserver: status: 0/10

> 
> > --------------------------------------
> > #aliasdomains
> 
>   I hope this is in rcpt_rewrite.pm

My plugin file is in /usr/local/qpsmtpd/plugins/rcpt_rewrite

Other plugins don't have extension ...

> 
> > So the recipient should always be rewrite to someth...@domain.com but it
> > don't ! rcpt_ldap plugins get the old recipient (original recipient)
> > Maybe it is a problem of plugin order ? my config/plugins file looks
> > like :
> 
>   Have you looked at rcpt_ldap to see how it is getting the recipient?
>   Or added logging to see what is executed?

The rcpt_ldap plugin get the recipient with :

sub ldap_rcpt {
    use Net::LDAP qw(:all);
    use Qpsmtpd::Constants;

    my ($self, $transaction, $recipient) = @_;


And then use : $recipient->user, $recipient->host
So I try : 

--------------rcpt_rewrite--------------------------------
use Qpsmtpd::DSN;

sub hook_rcpt { 
  my ($self, $transaction, $recipient) = (shift, shift, shift); 
  $recipient->host("domain.com");
  return DECLINED; 
} 
---------------------------------------------------------
Without any success, I still got/get the original recipient.

I try with :

$recipient->host = "domain.com";

but I have an error :

FATAL PLUGIN ERROR:  Can't modify non-lvalue subroutine call
at ./plugins/rcpt_rewrite line 5, <STDIN> line 3.

I will look to the aliases rewrite plugins for postfix to see if there
another way modify the recipient...



> 
> > tls /usr/local/qpsmtpd/plugins/ssl/qpsmtpd-server.crt  
> > /usr/local/qpsmtpd/plugins/ssl/qpsmtpd-server.key  
> > /usr/local/qpsmtpd/plugins/ssl/qpsmtpd-ca.crt
> > hosts_allow
> > rcpt_rewrite
> ..
> 
> > rcpt_ldap
> > rcpt_ok
> 
>   Looks fine - you do want the rewriting plugin to come first.
> 
> Steve

Reply via email to