| 463 | |
| 464 | |
| 465 | class Mailbox(TokenList): |
| 466 | |
| 467 | token_type = 'mailbox' |
| 468 | |
| 469 | @property |
| 470 | def display_name(self): |
| 471 | if self[0].token_type == 'name-addr': |
| 472 | return self[0].display_name |
| 473 | |
| 474 | @property |
| 475 | def local_part(self): |
| 476 | return self[0].local_part |
| 477 | |
| 478 | @property |
| 479 | def domain(self): |
| 480 | return self[0].domain |
| 481 | |
| 482 | @property |
| 483 | def route(self): |
| 484 | if self[0].token_type == 'name-addr': |
| 485 | return self[0].route |
| 486 | |
| 487 | @property |
| 488 | def addr_spec(self): |
| 489 | return self[0].addr_spec |
| 490 | |
| 491 | |
| 492 | class InvalidMailbox(TokenList): |