mail snippets

Delete messages containing a keyword in mutt

Tagged mutt, mail, bulk, delete  Languages bash

Bulk operations in mutt, a console based email client, are easy. Here's how to delete messages containing the keyword 'Newsletter'.


T - asks which messages you want to tag and you reply with 'Newsletter'.

; - asks which action you want to run on the tagged messages.

d - tells that the action you want is delete.

$ - synchronizes the view with the underlying persistence layer.

How to send emails from the command line in Linux

Tagged mail, postfix, smtp  Languages 

Use the mail command...

Specify the sender with the -r switch

mail -s "Yer subject" -- -r ""

Use echo to send your emails

echo -e "TEST\n.\n" | mail -s "subject" -- -r ""

Note that we use the -e switch to preserve new lines.

Use a file as the contents of your email

mail -s "subject" -- -r "" < /tmp/email