Mailing List Archive

[Bug 485] Exim mistakenly prohibits underscore (_) in /HELO/EHLO commands
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=485





------- Comment #1 from graeme@graemef.net 2007-03-16 08:30 -------
On Fri, 2007-03-16 at 03:52 +0000, exim@themitchells.org wrote:
> 2007-03-11 21:11:21 rejected HELO from gfhowalogon.glensfallshosp.org
> [64.80.241.66]: syntactically invalid argument(s):
> gfh_exchange.glensfallshosp.org
>
> Following RFC 1425, EHLO is:
> ehlo-cmd ::= "EHLO" SP domain CR LF
> 'domain' is defined in RFC822:
> domain = sub-domain *("." sub-domain)
> sub-domain = domain-ref / domain-literal
> domain-ref = atom
> atom = 1*<any CHAR except specials, SPACE and CTLs>
> specials = "(" / ")" / "<" / ">" / "@" ; Must be in quoted-
> / "," / ";" / ":" / "\" / <"> ; string, to use
> / "." / "[" / "]" ; within a word.
> CHAR = <any ASCII character> ; ( 0-177, 0.-127.)
> Since underscore is not in specials, nor is it a SPACE or CTL, it is not
> prohibited. Hence, by definition, it is not "syntactically invalid". Or is
> there something I'm missing?

RFC1425 obsoleted by 1651, then by 1869, then by 2821. From RFC2821:

The argument field contains the fully-qualified domain name of the SMTP
client if one is available.

An FQDN may not contain underscores, as per the RFCs for domain name
construction (I forget which).

If you have a problem, set one or more of:

helo_allow_chars = _
helo_accept_junk_hosts = some.host.name:some.ip.add.ress

All of which are well documented.

Graeme

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 485] Exim mistakenly prohibits underscore (_) in /HELO/EHLO commands [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=485


holmgren@lysator.liu.se changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID




------- Comment #2 from holmgren@lysator.liu.se 2007-03-16 10:51 -------
Resolving as invalid.

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 485] Exim mistakenly prohibits underscore (_) in /HELO/EHLO commands [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=485





------- Comment #3 from anomie@users.sourceforge.net 2007-03-16 17:13 -------
On Fri, Mar 16, 2007 at 08:30:42AM +0000, graeme@graemef.net wrote:
>
> An FQDN may not contain underscores, as per the RFCs for domain name
> construction (I forget which).

For SMTP purposes, domain name labels are restricted by RFC 2821 section
2.3.5 to consist of ASCII letters, digits, and hyphens. Later on, the
BNF also specifies that a hyphen cannot be the first or last character
of a label.

> helo_accept_junk_hosts = some.host.name:some.ip.add.ress

Note that if you set this it really will accept anything, if you just
want to accept underscores you should probably use helo_allow_chars
instead. If you do use helo_accept_junk_hosts, you would probably want
to include a rule like this in your helo ACL:

deny condition = ${if match{$sender_helo_name} \
{\N[^\x01-\x09\x0b\x0c\x0e-\x7f]\N}}
message = 501 RFC 2821 specifies US-ASCII only in SMTP commands.

Then add more rules to check for more specific syntax you want to allow.
This rule catches a few attempts per day here, I'm not sure whether it's
spambots trying to exploit holes in someone's filter or just spambots
using the compromised machine's Chinese/Japanese/Korean/etc Windos
computer name.

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 485] Exim mistakenly prohibits underscore (_) in /HELO/EHLO commands [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=485





------- Comment #4 from bugzilla.exim.org@subzero5.yi.org 2007-03-18 05:24 -------
graeme@graemef.net wrote:

>
> RFC1425 obsoleted by 1651, then by 1869, then by 2821. From RFC2821:
>
> The argument field contains the fully-qualified domain name of the SMTP
> client if one is available.
>
> An FQDN may not contain underscores, as per the RFCs for domain name
> construction (I forget which).
>
> If you have a problem, set one or more of:
>
> helo_allow_chars = _
> helo_accept_junk_hosts = some.host.name:some.ip.add.ress
>
> All of which are well documented.

Yes, I ended up setting the helo_allow_chars. Since the newer RFC's
don't really provide explicit syntax definitions, I went by the older
ones which do. I also don't have 'verify = helo' enabled, which I would
expect to have rejected the HELO response.

It's not a huge deal either way. I have it working now. I should point
out that to really enforce strict FQDN syntax, the first character of a
label can only be a letter and the last can only be a letter or digit.
The first character cannot be a digit or hyphen, nor can the last be a
hyphen. 3com.com is not a syntactically correct FQDN and should be
rejected as such ;-) RFC 1035 Section 2.3.1

-David

>
> Graeme
>

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 485] Exim mistakenly prohibits underscore (_) in /HELO/EHLO commands [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=485





------- Comment #5 from ph10@hermes.cam.ac.uk 2007-03-19 09:44 -------
On Sun, 18 Mar 2007, bugzilla.exim.org@subzero5.yi.org wrote:

> It's not a huge deal either way. I have it working now. I should point
> out that to really enforce strict FQDN syntax, the first character of a
> label can only be a letter and the last can only be a letter or digit.
> The first character cannot be a digit or hyphen, nor can the last be a
> hyphen. 3com.com is not a syntactically correct FQDN and should be
> rejected as such ;-) RFC 1035 Section 2.3.1

Sigh.

RFC1123 APPLICATIONS LAYER -- GENERAL October 1989

2. GENERAL ISSUES

This section contains general requirements that may be applicable to
all application-layer protocols.

2.1 Host Names and Numbers

The syntax of a legal Internet host name was specified in RFC-952
[DNS:4]. One aspect of host name syntax is hereby changed: the
restriction on the first character is relaxed to allow either a
letter or a digit. Host software MUST support this more liberal
syntax.


Philip

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##