Search mailbox for matching messages. (typ, [data]) = .search(charset, criterion, ...) 'data' is space separated list of matching message numbers. If UTF8 is enabled, charset MUST be None.
(self, charset, *criteria)
| 718 | |
| 719 | |
| 720 | def search(self, charset, *criteria): |
| 721 | """Search mailbox for matching messages. |
| 722 | |
| 723 | (typ, [data]) = <instance>.search(charset, criterion, ...) |
| 724 | |
| 725 | 'data' is space separated list of matching message numbers. |
| 726 | If UTF8 is enabled, charset MUST be None. |
| 727 | """ |
| 728 | name = 'SEARCH' |
| 729 | if charset: |
| 730 | if self.utf8_enabled: |
| 731 | raise IMAP4.error("Non-None charset not valid in UTF8 mode") |
| 732 | typ, dat = self._simple_command(name, 'CHARSET', charset, *criteria) |
| 733 | else: |
| 734 | typ, dat = self._simple_command(name, *criteria) |
| 735 | return self._untagged_response(typ, dat, name) |
| 736 | |
| 737 | |
| 738 | def select(self, mailbox='INBOX', readonly=False): |
no test coverage detected