I have read this topic, but it don't work for me ... 

I have create a file rcpt_rewrite with :

--------------------------------------
#aliasdomains

use Qpsmtpd::DSN;

sub hook_rcpt {
  my ($self, $transaction) = (shift, shift);
#  $_[0]->user("newuser");
  $_[0]->host("domain.com");
  return DECLINED;
}
---------------------------

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 :

---------------------------------
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
dont_require_anglebrackets
check_earlytalker
count_unrecognized_commands 4
check_relay
auth/auth_ldap_bind
require_resolvable_fromhost
rhsbl
dnsbl
check_badmailfrom
check_badrcptto
check_spamhelo
rcpt_ldap
rcpt_ok
check_loop
queue/qmail-queue
-------------------------------------------

thanks for your quick reply !

Julien.





Le mercredi 28 janvier 2009 à 13:50 +0000, Steve Kemp a écrit :
> On Wed Jan 28, 2009 at 14:45:08 +0100, Julien wrote:
> 
> > But this don't work, the next plugins rcpt_ldap gets the old recipient
> > (not rewrite) maybe it's not the right variable ? If somebody have an
> > idea about the way to do this in qpsmtpd ...
> 
>   You can do this rewriting as this:
> 
> sub hook_rcpt 
> {
>     my ($self, $transaction) = (shift, shift);
> 
>     $_[0]->user("newuser");
>     $_[0]->host("new.host.tld");
> 
>     return DECLINED;
> }
> 
>   This was the solution presented when I raised the topic last time.
>  Thread starts here:
> 
>     http://www.mail-archive.com/qpsmtpd@perl.org/msg08199.html
> 
>   I use very similar code in the spam_gourmet plugin which you can
>  study for reference here:
> 
>     http://wiki.qpsmtpd.org/plugins:spam:gourmet
> 
> Steve

Reply via email to