[sork] Re: Backquotes in parser

Espen Jürgensen espen at hhkol.dk
Fri Apr 9 03:28:45 PDT 2004


> Most newer versions of software don't require them anymore, but some
> still do, and lots of people still run older versions.  What they
> do is prevent mail from looping in older versions.  So it is very
> important to use them and support them.
> 
> > `hello at hello.com` becomes mailbox=`hello and host=hello.com`
> > ` hello at hello.com` gives syntax error.
> 
> But would be valid in a .forward file, so we need to account for it.
> Maybe run it through trim() and what have you first...
> 

I don't know about older/other MTA's, we only use Exim (Debian/stable,
so perhaps it is 2 years old), and it seems to treat backquotes just
like imap_rfc822..():

`user at host.com` gives Unknown hostname host.com`
` user at host.com` gives missing or malformed local part (syntax error)
`user at host.com gives unknown local-part
` user at host.com gives missing or malformed local part (syntax error)

If I used trim(), then the consistency between the two would break.

Anyway, perhaps speculating so much about certain characters is going
down the wrong track. As we discussed earlier, what is wanted is that
the parser raises a warning when it encounters content which couldn't
have been constructed by Vacation og Forward. Since Vacation only saves
predefined stuff, this means concentrating on stuff that is accepted by
Forwards/make_email_address. If accepted by make_email, it should be
accepted by the parser (and what is denied by make_email should be
denied by the parser). So we don't really need to think about every
imaginable kind .forward, just making the same tests as make_email.

The parser and make_email work in much the same manner, and could be
brought to work exactly the same. This could be done simply by changing
from imap_rfc822_.. to PEAR/parseAddressList. However, I personally
would recommend changing from PEAR to imap_rfc in make_email instead,
because:

1) It would lower the amount of dependencies
2) PEAR/parseAddressList accepts too much garbage (ie ` user at host.com`)
3) PEAR/parseAddressList is broken, if you give it something really bad
it returns:
Fatal error: Call to undefined function: raiseerror() in
/usr/share/php/Mail/RFC822.php on line 189


> You might want to update your copy as the discussion continues, and
> submit an updated patch afterwards...
> 

Yes, I will do that.

Regards,
Espen



More information about the sork mailing list