Active Oldest Votes. Improve this answer. EchoMike EchoMike 1 1 gold badge 3 3 silver badges 4 4 bronze badges. Yep, thanks, I discovered that yesterday, when I have finished the program will post it here — vinicius de novaes. T-Dawg T-Dawg 71 1 1 silver badge 3 3 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. Improve this answer. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Who is building clouds for the independent developer? Exploding turkeys and how not to thaw your frozen bird: Top turkey questions Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer. Related 3. Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Connect and share knowledge within a single location that is structured and easy to search. I know I can download emails using a client, but is there a way to download emails straight from the terminal? I'm trying to fetch some emails from my gmail to later do some analysis on certain emails. EDIT: Thank you for all the answers.
Right now, I found a way to do it with getmail. But I encountered a small issue. It downloads the emails and attachments, but it prints everything in text. Is there a way to actually retrieve said attachment? Gmail provides an IMAP service through which you can use any client that supports that protocol to fetch your e-mails.
How that client makes them available on the disk can vary. By far the most widely-used command-line IMAP client has to be fetchmail. You can install it easily in Ubuntu, then google for specific configurations to use with gmail. One thing with fetchmail is that it slurps emails from the remote server and then pipes them through your local MTA. So you'd need to have a locally-configured MTA for this setup to work. Another tool that may work is offlineimap. I haven't used it; setup may be easier than with fetchmail.
As for your need to save attachments included in emails, what you need is to install mpack. Then, run the munpack command on the. It will decode and save the attachments in individual files:. The question was about generally accessing email via the terminal, before the question poser specified getmail , but attachments are easily saved in Mutt also: see my note below. You could use the program Mutt , which is available in the repositories.
A MTA is an application responsible for sending and receiving emails from one host to another. Do you have in mind any other methods of sending emails with attachment from the Linux terminal, that are not mentioned in the list above?
Let us know in the comments. TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! If you like what you are reading, please consider buying us a coffee or 2 as a token of appreciation.
0コメント