On 2007-12-05 04:01:02 -0800, [EMAIL PROTECTED] wrote:
> > What are the two patches that need to be appied? (I don't see them in
> > the plugins documentation).
> 
> I've updated the documentation in the Wiki:
> 
> Right now, this plug-in always returns DECLINED because recipient->
> host and sender->host are always empty when a email address with IDN
> arrives into qpsmtpd.

Yes. We check rather strictly whether the address conforms to the syntax
given in RFC 2821 (I think I took some shortcuts with IPv6 address
literals, and some obsolete forms aren't recognized). RFC 2821 allows
only ASCII characters in email addresses (but it allows stupid stuff
like control characters!).

> A simple patch is needed for Qpsmtpd::Address method canonify(), like
> replacing this line:
> 
> my $subdomain = '(?:[a-zA-Z0-9](?:[-a-zA-Z0-9]*[a-zA-Z0-9])?)';
> 
> with this line:
> 
> my $subdomain = '([^\.]{2,})?';

It may be possible to accept a more generic form of addresses (e.g.,
with non-ascii characters etc.) here and delegate the strict syntax
check to a plugin. Problem is that the syntax is rather complex (as you
can see in the code) and I'm not sure whether it is possible to get all
the wierd corner cases of SMTP 2822 correct and allow useful extensions.

If somebody comes up with a good proposal I'm all for it.

> Also, the method Qpsmtpd::Address method host() need to be patched in
> order to allow overwriting of the host:
> 
> sub host {
>     my ($self, $host) = @_;
>     if ($host) { $self->{_host} = $host; } else { return $self-
> >{_host}; }
> }

That one looks ok to me and may be useful for other address
manipulations. So I applied a similar patch (for user(), too).

        hp

-- 
   _  | Peter J. Holzer    | It took a genius to create [TeX],
|_|_) | Sysadmin WSR       | and it takes a genius to maintain it.
| |   | [EMAIL PROTECTED]         | That's not engineering, that's art.
__/   | http://www.hjp.at/ |    -- David Kastrup in comp.text.tex

Attachment: signature.asc
Description: Digital signature

Reply via email to