A
A
Alex May2011-03-18 03:28:53
gmail
Alex May, 2011-03-18 03:28:53

Downloading mail from the command line (windows/linux - doesn't matter)

Good afternoon

Can someone tell me how to download mail from gmail using a utility that works on the command line, preferably in windows or cygwin? (required for the script)
The task is to go to the pop3 gmail box, download mail according to the principle 1 letter - 1 file. I don't want to contact the local mail delivery agent at all. It seems that fetchmail can, but I don’t remember the full command line parameters

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
sigmatik, 2011-03-18
@sigmatik

Mail receiving options
-a, --all (Switch: fetchall) Receive both old (read) and new messages from the server. By default, only unread messages are accepted. In POP3, this option, among other things, issues a RETR command instead of TOP. When using POP2, reception is handled as if the --all option is always on. This option does not work with ETRN or ODMR.
-k, --keep
(Switch: keep) Store received messages on the remote mail server. Typically, messages are deleted from the server after they are received. The keep option keeps received messages in your mailbox on the mail server. This option does not work with ETRN or ODMR.
-K, --nokeep
(Keyword: nokeep) Deletes received messages from the remote mail server. It can be useful if you have specified the default keep option in the .fetchmailrc file. This option is forced to be enabled when using ETRN or ODMR.
-F, --flush
POP3/IMAP only. Deletes old (previously read) messages from the mail server before starting to receive new messages. This option does not work with ETRN or ODMR. Warning: If your MTA hangs and fetchmail crashes, the next time you run fetchmail it will delete mail that was never delivered to you. It's best to leave the default settings: if you don't specify the '-k' option, fetchmail will automatically delete messages after they've been successfully received.
linux.yaroslavl.ru/docs/serv/fetchmail/fetchmail-man.html#2

M
madhat, 2011-03-18
@madhat

getmail in Maildir?

C
Corwin_en, 2011-03-18
@Corwin_en

I'm not entirely sure (simply because I haven't personally tried it myself), but maybe this will help you.

M
mitry, 2011-03-19
@mitry

There is mpop - should work with GMail, because. there is TLS/SSL support. Both under Unix and under Windows.

I
impass, 2011-09-22
@impass

Google for "IMAP backup", solutions in bulk. At one time, the Python script of the same name
helped me a lot . True, judging by the changelog, it is no longer being developed. Saves each folder from the server into a separate mbox archive. You can also take any modern mail client (Mozilla Thunderbird, The Bat), put it in your mail account and download all the contents of the mailbox, including folders. Then export messages to a single mbox archive or separate files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question