rolkey / indyproject

Automatically exported from code.google.com/p/indyproject
0 stars 0 forks source link

TIdEmailAddress fails for valid addresses #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
TIdEmailAddress fails for a valid address like '"Sm\"art\"POP@JAM" 
<smart@pop.de>'

Code to reproduce:

var
  addr: TIdEMailAddressItem;
  decodedFrom, parsedAddr: WideString;
begin
  decodedFrom := '"Sm\"art\"POP@JAM" <smart@pop.de>';
  addr.Text := decodedFrom;
  parsedAddr := addr.Text;
  Assert(SameText(parsedAddr, decodedFrom), 'Addresses are not equal:' + 
parsedAddr + ' <--> ' + decodedFrom);
end;

The problem is now that name contains the value including the quoted 
(quoted with '\') double quotes. Then the quote symbol '\' is duplicated 
when using the GetText function: '"Sm\\"art\\"POP@JAM" <smart@pop.de>'

Original issue reported on code.google.com by gambit47 on 24 Nov 2009 at 1:24

GoogleCodeExporter commented 8 years ago
More addresses:

addr.Text := '<<someuser@somehost.somehost2.com>>';
Results in an Address of '<someuser@somehost.somehost2.com'

addr.Text := '<<<someuser@somehost.somehost2.com>>>';
Results in an Address of '<<someuser@somehost.somehost2.com'

Original comment by gambit47 on 25 Oct 2010 at 10:17

GoogleCodeExporter commented 8 years ago

Original comment by gambit47 on 12 Dec 2012 at 7:34

GoogleCodeExporter commented 8 years ago
Another example:

addr.Text := '"name" <"user"@domain>';
Results in a Name of 'name" <"user' and an Address of '@domain>'

Original comment by gambit47 on 24 Oct 2014 at 9:50