Closed Phil12n closed 1 year ago
With "lmtp_recipient:" you specify the receiving mailcow mailbox. After email delivery (through the LMTP protocol to deovcot) the work of getmail is done. To sort the emails into different folders (e.g. Junk, INBOX, etc. ) within the mailcow mailbox you need to use Sieve (part of Dovecot). Using the email header information (e.g. X-Spam-Flag, X-getmail-retrieved-from-mailbox-user, etc.) you can then build the sorting rules you want.
https://en.wikipedia.org/wiki/Sieve_(mail_filtering_language) https://www.linux-magazin.de/ausgaben/2007/06/ausgesiebt/ (Mailcow: Mail Setup -> Filters -> Add Filter)
Example Mailcow "Global Postfilter":
...
if header :contains "X-Spam-Flag" "YES" {
fileinto "Junk";
}
...
Hi Christianbur, Thank's for your reply. I gonna try the suggested settings. However i see you use Mailcow filters instead of Sogo filters : is there any reason prefering Mailcow vs SOGO filtering ? Thank's again, Phil
I do not use Sogo webmail. However, I would always prefer sieve as a filter rule, as this is more powerful, standadized and executed at the level of Dovecot.
I am a little bit lost between Mailcow filters, and I don't know how to use sieve filters as suggested. I found "Global sieve prefilter • Prefilter • User scripts • Postfilter • Global sieve postfilter" in Mailcow admin, but i recorded with Sogo filters and i found them back in Mailcow User access :
require ["fileinto"]; if allof (not header :contains "X-me-spamlevel" "not-spam") { fileinto "Junk"; }
All seems to works fine ! Thank's a lot
Hi,
I followed the instructions in the install.txt in order to getmail from INBOX + Junk.
It works fine on the provider side : imap_move_folder: INBOX/getmail-SPAM and imap_sync_folder: INBOX/QUARANTAINE are OK. However, i receive all mails in the same lmtp_recipient: test@gmx.de (i.e. INBOX) Is it possible to receive only Junk mails in a different lmtp_recipient like test@gmx.de/Junk ?
Thanks for your help, Phil