Comments (8)
Ah yeah, for the imap
portion I have this in my config:
# this is all custom, and may not work for you -- this
# is how I filter certain Junk/Trash paths from my mail
FILTER_PARTS: Set[str] = {".notmuch", "Trash", "Spam", "Junk"}
def filter_mail_path(p: Path) -> bool:
pset = set(p.parts[1:])
if any(f in pset for f in FILTER_PARTS):
return False
return True
class mail:
# locally synced IMAP mailboxes using mbsync
class imap:
# path[s]/glob to the the mailboxes/IMAP files
# you could also just do something like:
# mailboxes = "~/Documents/mail/*@*"
# to match any files in that directory with '@' in them
#
# to confirm this is matching your files, can do:
# hpi query my.mail.imap.files -s
mailboxes = MAILDIR
# filter function which filters the input paths
filter_path: Optional[Callable[[Path], bool]] = filter_mail_path
but since the mbox
just loads the one huge file, you cant exclude extensions or paths as far as I understand.
Could exclude the trash in the export in the first place (though not sure exactly how to do that)
Will do an export and try to debug to see if the path is accessible in some way, so trash can be filtered
from hpi.
Hmm, trying to reproduce what you might run into, do you remember how you setup the export?
I selected my inbox like this in Thunderbird:
And then followed what I described here in the mail doc:
Tools > ImportExportToolsNg > Export all messages in the Folder > Plain Text Format
Edit: Or just right clicking and hitting Export remote folder
, which includes all ~10000 messages in my account, not just the 2000 local cache.
That way is just my inbox and not trash/spam that are getting included. Are you doing something else, possibly because of the scheduling?
from hpi.
Hmm, trying to reproduce what you might run into, do you remember how you setup the export?
I selected my inbox like this in Thunderbird:
And then followed what I described here in the mail doc:
Tools > ImportExportToolsNg > Export all messages in the Folder > Plain Text Format
Edit: Or just right clicking and hitting
Export remote folder
, which includes all ~10000 messages in my account, not just the 2000 local cache.That way is just my inbox and not trash/spam that are getting included. Are you doing something else, possibly because of the scheduling?
Sorry for the late reply, I'm using the automatic scheduling feature from the addon. And thus I cannot see how to exclude certain folders. I'll try and see if your filter works !
from hpi.
Hum, it is still indexing the deleted, trash, etc folders. Though I'm using mbox
instead of IMAP
from hpi.
Filtering is only a thing for imap
because i have the files laid out in my filesystem, its not all in a single giant mbox
file
As far as I remember, the thunderbird addon exports the whole account into mbox
, and last time I debugged I couldnt find anything like a 'folder' or 'path' in the metadata that described where the email was from. Will try doing an automatic export with thunderbird to see if I can find anything like that
from hpi.
Just leaving this here incase I want to try and reproduce this later, setup daily backups and going to leave thunderbird open so it'll do a backup sometimes in the next day (could trigger manually but want to make sure I'm not doing something custom there)
Edit: In accordance with the instructions I left here, I switched to just mail files
for now, let me know if youre doing something different
from hpi.
Yeah I was already using the just mail files
though I don't see any option for the scheduling to exclude Trahs/Deleted folders
from hpi.
sorry this takes a while, I can only really do a test once per day since I don't want to do something custom and I want it to run with scheduling. I had it exporting to msf files before, I changed this option to export to mbox (I think? will test tomorrow):
The MSF files do include trash/junk etc., so maybe I could see about parsing those? It seems like a waste though, mbox is a standard while msf is very specific to thunderbird
from hpi.
Related Issues (20)
- unhandled google takeout files
- add albums
- restructure job dirs so that its easier to dispatch on OS type
- How to use IMAP function 📧 HOT 15
- make google_takeout more configurable HOT 1
- merge into HPI? HOT 2
- modularize my.location and remove tz.time.via_location HOT 3
- split personal files into HPI overlay repo HOT 1
- add linkedin data export HOT 1
- google pixel now playing history HOT 1
- piazza scraper module
- add my.mail.mbox module: to parse mbox files HOT 14
- add module for flight data/history HOT 2
- my.ipython fails on newest version HOT 2
- my.discord: add reactions/app name functions
- warn in ipython if historyaccessor fails
- integrate with scramble history HOT 1
- parse aw-window-watcher JSON dump HOT 1
- How to update HPI and HPI-sean HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hpi.