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)
| 823 | |
| 824 | |
| 825 | def search(self, charset, *criteria): |
| 826 | """Search mailbox for matching messages. |
| 827 | |
| 828 | (typ, [data]) = <instance>.search(charset, criterion, ...) |
| 829 | |
| 830 | 'data' is space separated list of matching message numbers. |
| 831 | If UTF8 is enabled, charset MUST be None. |
| 832 | """ |
| 833 | name = 'SEARCH' |
| 834 | if charset: |
| 835 | if self.utf8_enabled: |
| 836 | raise IMAP4.error("Non-None charset not valid in UTF8 mode") |
| 837 | typ, dat = self._simple_command(name, 'CHARSET', charset, *criteria) |
| 838 | else: |
| 839 | typ, dat = self._simple_command(name, *criteria) |
| 840 | return self._untagged_response(typ, dat, name) |
| 841 | |
| 842 | |
| 843 | def select(self, mailbox='INBOX', readonly=False): |
no test coverage detected