Set mail to only display mail within 30 or 60 days, Here are two examples. 1. normal E.g: A654 FETCH 2:4 (FLAGS BODY[HEADER.FIELDS (DATE FROM)]) * 2 FETCH (FLAGS (\Seen) BODY[HEADER.FIELDS (DATE FROM)] {73} Date: Tue, 07 May 2020 12:26:55 +0800 From: <test at www.chengmail.ml> ) * 3 FETCH (FLAGS (\Seen) BODY[HEADER.FIELDS (DATE FROM)] {62} Date: Tue, 07 May 2020 12:35:34 +0800 From: lty at cndns.com ) * 4 FETCH (FLAGS (\Seen) BODY[HEADER.FIELDS (DATE FROM)] {62} Date: Tue, 07 Jul 2020 17:41:53 +0800 From: lty at cndns.com ) A654 OK Fetch completed (0.002 + 0.000 + 0.001 secs). 2. Set to display mail within 30 days E.g: A654 FETCH 2:4 (FLAGS BODY[HEADER.FIELDS (DATE FROM)]) * 4 FETCH (FLAGS (\Seen) BODY[HEADER.FIELDS (DATE FROM)] {62} Date: Tue, 07 Jul 2020 17:41:53 +0800 From: lty at cndns.com ) A654 OK Fetch completed (0.002 + 0.000 + 0.001 secs). Is there any way to display the result of case 2? I found lua. https://doc.dovecot.org/admin_manual/lua/#mail-lua But I don't know how to edit the lua script, Are there more examples? I also watched the help, but it doesn't help much. https://doc.dovecot.org/configuration_manual/authentication/lua_based_authentication/#authentication-lua-based-authentication https://doc.dovecot.org/configuration_manual/push_notification/#lua-push-notifications Can Lua fulfill my needs?