1

I send emails from the terminal with mutt -s "This is Subject" -a a.txt -- [email protected] < test.txt. The a.txt attachments can be large, how can I avoid filling up the mail server?

I would like the attachments to not be saved on the server or to be deleted immediately after sending. Maybe there is a way to send one copy of the email (with attachments) and save the other (without attachments). Or you can delete the email after sending (you need to make sure that the email was sent) and then save a copy of the email in the sent folder, but without sending it to the recipient again. It is not necessary to do this with mutt, maybe there is something more suitable.

My .muttrc file is:

# =======================  IMAP  =========================
set imap_user = [email protected]
set imap_pass = mypassword
set spoolfile = imaps://mail.company.com/INBOX
set folder = imaps://mail.company.com/
set record = "=SENDED"
set postponed = "=DRAFTS"
set mbox = "=INBOX"
#set header_cache = "~/.mutt/cache/headers"
#set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"
# =======================  SMTP  =========================
set smtp_url = "smtp://[email protected]@mail.company.com:123/"
set smtp_pass = $imap_pass
set ssl_force_tls = yes
# =======================  Composition  ==================
set editor = "nano"
set edit_headers = yes
set charset = UTF8
unset use_domain
set realname = "My Name"
set from = "[email protected]"
set use_from = yes
8
  • This question is similar to: Sending emails from the Linux terminal while preserving the fact of sending. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Jul 11 at 1:35
  • Not a directly answering this but you can upload the attachment elsewhere, then just include the link when sending the mail. Commented Jul 11 at 2:34
  • @ChanganAuto That question only answered about sending emails. Here I'm asking about attachment and space. Commented Jul 11 at 3:15
  • @annahri This doesn't always work that way. Some people don't want to click on external links because of security risks. Commented Jul 11 at 3:17
  • Some people don't want to click on external links because of security risks... as opposed to opening an email attachment directly? Joke of the week. Commented Jul 11 at 17:13

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.