List of mails to file

Issue #1240 closed
TOmi created an issue

I need to generate list of messages from some period of time and from one address , but there are 5400 messages so only way is mysql , how can I do it ? I’m tryingn this way :

[root@Piler ~]# mysql -h 127.0.0.1 -P 9306

SELECT id FROM main1,dailydelta1,delta1 WHERE   sent >= 1643670000  AND      MATCH('@from invoiceXdomainXorg @subject Invoice ') ORDER BY sent DESC LIMIT 0,10000 OPTION max_matches=10000;

and it generate list of messages id

+----------+
| id |
+----------+
| 10814174 |

………………..

| 10078530 |
+----------+
5475 rows in set (0.03 sec)

but when I as form other field I have error

MySQL [(none)]> SELECT `from` FROM main1,dailydelta1,delta1 WHERE   sent >= 1643670000  AND      MATCH('@from invoiceXdomainXorg @subject Invoice ') ORDER BY `sent` DESC LIMIT 0,10000 OPTION max_matches=10000;
ERROR 1064 (42000): index dailydelta1,delta1,main1: parse error: unknown column: from
MySQL [(none)]> describe main1;
+------------------+--------+
| Field            | Type   |
+------------------+--------+
| id               | bigint |
| from             | field  |
| to               | field  |
| fromdomain       | field  |
| todomain         | field  |
| subject          | field  |
| arrived          | field  |
| body             | field  |
| direction        | field  |
| folder           | field  |
| attachment_types | field  |
| sent             | uint   |
| size             | uint   |
| attachments      | uint   |
+------------------+--------+
14 rows in set (0.00 sec)

How can I do it ?on console ?

Comments (3)

  1. TOmi reporter

    I was tryin do it to complicate , …

    simply way , simply solutoin …

    mysql -p

    MariaDB [piler]> select * from metadata where from='invoice@domain.org';

  2. Log in to comment