PDA

View Full Version : How to setup mailbox on a Linux Debian home PC using "mutt"?



Fli
07-14-2024, 07:20 AM
Having Linux Debian PC, I have been wondering about how to receive email from erroneous cronjobs, other apps like ZFS ZED (https://pieterbakker.com/monitoring-zfs-with-zed/) and how to send mail to the internet.
I think that the Linux "mutt" is good since it allows sending also attachments.

Install: sudo apt install mutt

Read mail: mutt
Visual interface can be controlled using keys (some tips are in the header of the mutt UI):
arrows
enter to view selected mail
"d" to mark mail for deletion (you can confirm it using $ or let mutt ask about deletion when you quit it)
"q" to quit or go back (or Ctrl+C)
"m" send new mail/message
"?" for help/other shortcuts

Send mail from a CLI (not from UI using "m" key): echo -e "Hello,\nHow are you?"|mutt -s "Subject" -a "/path/to/attachment.pdf" recipientusername

In order to send to an internet server, I guess user need to have a system hostname in a FQDN (Fully qualified domain name) format, meaning "something.domain.name". This domain does not need to be registered, yet without it (along with absence of a SPF, DKIM, DMARC), recipient mail server may mark the incoming mail as junk/spam. Anyway to setup a FQDN hostname, at least in a Debian Linux, i can run:

hostnamectl # to view current hostname
hostnamectl set-hostname workstation.mydomain.tld # to set a new hostname

Do You have tips to using mutt better way, for example simple SPF setup etc.?