Mail

From Colettapedia
Jump to navigation Jump to search

General

Steps to RECEIVE mail

  1. Your mail server's IP must be known to your buddy's email client
  2. MAIL TRANSFER AGENT: Your mailserver listens on a particular port, accept connection from the other persons. Your mailserver will decide which mailbox the email will be delivered to, manage email queue, etc
  3. IMAP/POP3 SERVER: Client will connect to either imap or pop3 server in order to READ the mail
  4. WEBMAIL SERVER: Website-based (clientless) access to email inbox
  5. Look into using mailcow via docker.

Steps to SEND mail

  • MTA can be relay-only ("send only")
    • Send-only MTA forwards my emails to another server, typically the SMTP server of your ISP.
    • E.g., nullmailer, msmtp, and sSMPT
  • Full-fledged MTA, a.k.a., mailhub
    • E.g., postfix, sendmail, exim
  • SMTP = Simple Mail Transfer Protocol
  • mnemonic: Sending Mail To People
  • SMTP is like a mailman
  • A set of commands that authenticates and directs the transfer of email
  1. Email client sends your message to the SMTP server, e.g., smtp.gmail.com
  2. My SMTP server will send my mail to the recipient's email server. There my email will stay until the recipient logs into their email server and downloads my message via IMAP or POP3, or view the email on the server by using webmail.
  • SMTP uses the TCP protocol. TCP guarantees email delivery, assuming the email address exists and is correct, otherwise you get a mail delivery error.

Using Postfix's sendmail command

  • Available on CentOS7

Using linux mail

  • echo “This will go into the body of the mail.” | mail -s “Hello world” you@youremailid.com
  • mail -s “Hello world” you@youremailid.com < /home/calvin/application.log
    • echo “Welcome to the world of Calvin n Hobbes” | mail -s “Hello world” calvin@cnh.com -c hobbes@cnh.com -b susie.derkins@cnh.com
  • echo "Here is the dump file. Only 1.6 megs." | mutt -a iicbu.dmp -s "iicbu svn dmp file" lhotskyb@grc.nia.nih.gov christopher.coletta@nih.gov

Mailtrap.io