lcmail-wizard - procmail rules and auto trash script
|
1 year ago | |
---|---|---|
.forward | 4 years ago | |
.gitignore | 4 years ago | |
.procmailrc | 4 years ago | |
Makefile | 3 years ago | |
README.md | 3 years ago | |
filter-rules.def.rc | 3 years ago | |
lcmail-wizard.def.cron | 3 years ago | |
lcmail-wizard.def.yml | 3 years ago | |
lcmail-wizard.py | 4 years ago |
The aim of these repo is try to facilitate new admins or 150hs to be procmail users using only LCM services to handle mails
Are you an admin or staff member of LCM?
If yes, sooner or later your LCM user will be added to some or (in the worst case) all mailing lists of LCM
If no, why are you visiting this site? Get out of here!
What does it mean?
It means you will be flooded with mails every date! And yes, you can't follow the strategy INBOX for all, beacuse part of your work is to pay attention to these mails: check, reply, or even archive them
So what is the strategy that is usually recommended?
For now (pre zimbra deploy), there are 2 possibilities, depending on the content of your ~/.forward
you can decide to be:
a spam forwarder + G-slave, forwarding all your LCM mail traffic (spam included) to an external mail account (that usually permit you to make filter rules easily using webUI, e.g. Gmail)
$ cat ~/.forward
nomeutentelcm
nomeutentelcm@gmail.com
Pros:
More space for mails
Against:
~/.maildir
, that can increase significantly (LCM home quota is 1G max)a procmail user, so use procmail to filter out during the delivery to local ~/.maildir
the mails
$ cat ~/.forward
"|IFS=' '&&exec /usr/bin/procmail -f-||exit 75"
Pros:
Against:
make
First setup:
Automatic setup
$ make install
Manual setup
$ make init
Little explanation of config files:
filter-rules.rc
Copy of my procmail filter rules (filter-rules.def.rc
), the file is already commented, the key idea is to filter using mail headers (^From:
, ^To:
, ^Subject:
) and delivery to custom folder. The ~/.maildir/.
folder structure must be something like that:
.maildir/
├── cur -> INBOX - read mails
├── new -> INBOX - unread mails
├── tmp
├── .Admins
│ ├── cur
│ ├── new
│ └── tmp
├── .Archive
│ ├── cur
│ ├── new
│ └── tmp
|
.
.
.
|
└── .Trash
├── cur
├── new
└── tmp
You don't have to worry about replicating it manually, because lcmail-wizard.py --create do it for you parsing dirs from lcmail-wizard.yml
lcmail-wizard.yml
YAML configuration file, divided in two list mail an log (procmail and lcmail-wizard.py log)
For mail the meaning of the integers are the number of days to wait from the reading date before trash a mail (so number of days to wait after mail is moved inside *./cur to trash it). So no mails are trashed if not read! And no mail are completly delete (removed from trash) without your interaction
There is an exception, the 0 has special meaning, it means no expiration, don't throw any mail, even if read
For log the same thing, but simply on creation date (no meaning here read or not read)
lcmail-wizard.cron
Simple cron file, to schedule lcmail-wizard.py script
Free to add new custom rules inside filter-rules.rc, correct workflow:
After that:
$ make config # backup and copy config
$ make schedule # schedule python script
For future, free to add new custom rules inside filter-rules.rc, correct workflow:
~/.maildir
, if do it, delete them also inside lcmail-wizard.ymlmake reconfig
For auto trashing feat: if you decide to modify the lcmail-wizard.yml expiration date integers you are ok always (don't be afraid to reconfigure)
Take home messages:
don't be a spam-forwarder, be procmail user
my personal workflow is IMAP to fetch mails and get notification on mobile, and if I need to write or answer a mail I use the LCM webmail on laptop. The configuration of webmail is very simple:
login > Gear symbol (below) > Manage folders > Enable folders you want > Happy filtering :stuck_out_tongue_winking_eye:
Last advice in webmail, enable "Empty trash on logout"
login > Settings (above) > Preferences > Server settings > Clear Trash on logout > Save