datts
v0.2.0
__ __ __
____/ /___ _/ /_/ /______
/ __ / __ `/ __/ __/ ___/
/ /_/ / /_/ / /_/ /_(__ )
__,_/__,_/__/__/____/
從IMAP服務器下載並保存附件
這個簡單的工具可讓您從電子郵件中下載並保存附件。它應該與支持IMAP協議的任何郵件服務提供商一起使用,包括免費的gmail.com,outlook.com,yahoo.com等。它支持同時連接,您可以通過按CTRL+C來中斷下載過程,它將優雅地退出。
git clone https://github.com/krzysztof-nowakowski/datts.git
或點擊下載按鈕
./datts.py --help
Usage: ./datts.py --login --mbox --dir --server [--n] [--c] [--delete] [--dump] [--noinline] [--help]
Option Argument Description
-------------------------------------------
--help show this help
--login string login to your account
--server string server name
--mbox string remote folder with attachments
--dir string local folder for storing attachments
--n number how many messages to download ? Default is all of them.
--c number how many connections to start ? Default is 1, max is 10.
--delete should we delete message after download ? Default is to NOT delete.
--dump print provided options and exit
--noinline skip attachments embedded in message body text
./datts.py --login name --server imap.gmail.com --mbox fun_stuff --dir backup/
./datts.py --login name --server outlook.office365.com --mbox inbox --dir backup/ --n 100 --delete
./datts.py --login name --server imap.gmail.com --mbox fun_stuff --dir backup/ --c 5
答:從您的郵件服務提供商那裡,還可以檢查您的帳戶設置,或者在其中一個網站上進行檢查:
答:默認值是將它們留在郵箱中,除非您指定--delete
選項。請記住,這是永久刪除,您不會在垃圾/bin文件夾中找到已刪除的電子郵件。
答:如果您不在第一次運行時下載所有附件並再次運行datts,則下次將下載相同的消息,並將其寫入磁盤,並以略有更改的名稱。這是為了避免數據覆蓋,因為您可能具有多個名為同名的附件。
--noinline
選項有什麼作用?答:當您為EG創建電子郵件並插入時。文本中的圖像將成為“內聯依戀”。有時,您不想經常下載這種類型的文件,它們是徽標,橫幅或類似垃圾。
SERVER_PORT = 993
更改為所需的任何內容。