DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th January 2021
PingPing's Avatar
PingPing PingPing is offline
Real Name: Hammond
Port Guard
 
Join Date: Jan 2015
Location: United Kingdom
Posts: 16
Default /usr/bin/mail tutorial?

I've read mail(1) but it doesn't contain any examples and I could really do with some to help me understand the basics of how to use it.

I've googled but all I get are references to running a mail server with OpenSMTPD.

Does anyone know of a tutorial that helps to explain the basic usage of 'mail'?

Some of the mysteries to me are:
1. how do I show the listing of all my messages once I'm at the '&' prompt?
2. what do I type at the '&' prompt to delete a message?
3. how do I send a message to a mailbox on the internet eg. gmail? Can this be done?
Reply With Quote
  #2   (View Single Post)  
Old 12th January 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,186
Default

Disclaimer: I don't use mail(1). My preference is for the mutt package.

The mail(1) man page refers to the "Mail Reference Manual". Google searching provided a link to it here: https://docs.freebsd.org/44doc/usd/07.mail/paper.pdf
  1. Using the link above, I learned that you can use & f .-$ to list all messages.
  2. The man page states that you can "delete (d) or reply (r) to it."
  3. This is well outside the scope of a Mail User Agent (MUA) such as mail(1). It requires provisioning a Mail Transfer Agent (MTA), commonly called a "mail server." This requires static IP address(es) on the Internet, purchased domain names, provisioning DNS records, a whole lot of knowledge about the protocols SMTP, ESMTP, SPF, and DMARC, managing the reputation(s) of your IP address(es), and most importantly -- avoiding any provisioning errors that allows your server to be attacked and become a spam pump. There is a built-in mail server, smtpd(8), which in its default configuration doesn't accept incoming mail from the network and is used only to manage local mail.

Last edited by jggimi; 12th January 2021 at 01:39 PM. Reason: typo
Reply With Quote
  #3   (View Single Post)  
Old 12th January 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,186
Default

Replying again just to note that some ISPs that offer client email services also offer a "smarthost" service to permit their users to set up outbound mail servers that relay all mail through the ISP, as if the mail was sent through the ISP's email client applications.
Reply With Quote
  #4   (View Single Post)  
Old 12th January 2021
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 256
Default

mail(1) is very old. These is info out there. Look also for tutorials for mailx and heirloom-mail.

I like using mail(1) so as an experiment I wanted to see how much I could do with it for modern mail usage.

As said, mail(1) is just the reader. You need other tools to send messages to other users or to pull messages from externally hosted mailboxes.

With a whole lot of external help, mail(1) could be used but it's biggest limitation is being limited to the mbox format.

If you like the mail(1) interface but want something with modern features, check out the mail/s-nail package.
Reply With Quote
  #5   (View Single Post)  
Old 12th January 2021
PingPing's Avatar
PingPing PingPing is offline
Real Name: Hammond
Port Guard
 
Join Date: Jan 2015
Location: United Kingdom
Posts: 16
Default

Thanks. I've read the "Mail Reference Manual" and I have a better understanding now. My main source of confusion was not knowing the difference between my user's "system" mail box and my (local) "mbox" mail box.

I was hoping to use /usr/bin/mail to send cron job output to my gmail account but, as you've both said, it's not really set up to do that.
Reply With Quote
  #6   (View Single Post)  
Old 12th January 2021
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 256
Default

Wrong tool. Use smtpd and an alias or a .forward file to redirect mail destined for the local user to gmail.

If you don't want to deal with your own mail reputation and all that, you can use smptd to connect to your ISP mail server or to gmail to send for you.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mdoc(7) documentation/ tutorial J65nko News 0 29th August 2011 02:00 AM
Tutorial: Installing XFCE on Gnome 4.8 jcdenton OpenBSD Packages and Ports 3 9th May 2011 04:56 PM
openBSD webserver tutorial werwer OpenBSD Packages and Ports 2 29th May 2010 04:20 PM
good vi(1) tutorial ocicat General software and network 4 8th April 2010 04:12 AM
Java online tutorial 18Googol2 Programming 5 28th August 2008 03:07 AM


All times are GMT. The time now is 09:16 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick