On Sun, June 13, 2010 2:11 pm, David Walker wrote:
> Hiya.
>
> I have a few noob questions about mail on OpenBSD.
> I'm not sure where to start so I'll blurt them out.
>
> What is "mail"?
> In the past I have used:
> dmesg | mail -s "dmesg" my.acco...@gmail
> This get's me a copy of dmesg on gmail and allows me to forward it to
> the boffins.
> That's all fine. However, if I disable Sendmail (sendmail_flags=NO)
> the mail command does not work.
> Is mail a front end to sendmail?
> What is the connection between them?
> I considered that "mail" might be a shortcut to Sendmail but it
> doesn't appear to be from my understanding of mailer.conf. Further
> there are two separate man pages.
> Is it similar to the way syslogd (Sendmail) is different from logger
> (mail)?

Sendmail is an SMTP daemon.  It sends mail to other SMTP daemons, or to
local delivery agents as appropriate.  It receives mail via SMTP.  (There
are other ways to use it, but let's not worry about them at the moment.)

mail is a local user mail program.  It reads, displays, and deals with
local mail folders in the standard 'Unix' format, and it can send mail to
the local SMTP daemon.  (Again, this is simplifying a bit...)

You can use many different SMTP daemons, and you can use many different
mail user agents.  These two just happen to be standard.  ('mail' is also
about the simplest mail user agent that would actually be useful.)

You do not need one to use the other: Mail just requires a SMTP daemon it
can talk to to send mail.  (Sendmail does not care if you have a mail
agent anywhere.)  As it is extremely simple, it doesn't even know how to
send mail to another machine: It just hands mail to the local mailserver
(another name for a SMTP daemon), and lets it work out how to get it where
it needs to go.

> There are other types of mail program as well I think.
> Software that fetches mail from an external server.
> Software that acts as a client to Sendmail.
> Is that correct?

Mail can be fetched from an external server via either POP or IMAP, and
yes, there are many different programs that can operate on either end of
that.

I'm not sure what you mean by 'a client to Sendmail'...  Sendmail talks to
other SMTP daemons, and to local delivery agents.  That's it.  (Well,
there are milters, which modify a mail message in transit.)  Sendmail will
never hold a message for reading, or do anything other than receive and
forward email.  (It might hold it if it can't immediately forward it, in
order to try again, but that's the only reason it'd hold on to a message.)

> As I understand it OpenSMTPD is a possible non-production replacement
> for Sendmail.
> Does OpenSMTPD require mail?
> An overview of how mail works on OpenBSD might help me with this.

I don't know anything about OpenSMTPD, but I doubt it requires mail.  Mail
might require it (or Sendmail, or Postfix, or Exim, or...), though.

> I want to understand the underlying concepts but to be more specific I
> want to understand how "messages" (e.g. system logging - daily
> insecurity output, etcetera) gets to my mailbox.
> Also what do I need to be able to send an occasional message out.
> So if explaining everything is difficult, how it affects those
> circumstances would be great.

Electronic mail in general is made up of several parts.  First, there is
the User Agent (UA): mail, Thunderbird, kMail, Outlook, are all examples
of UA's.

Second the are Mail Transfer Agents (MTA's).  Usually (and nearly always
in the Unix world) these are SMTP daemons: Sendmail, Postfix, OpenSMTPD,
Exchange, are all examples here.

Thirdly, there are Mail Delivery Agents (MDA), also called local delivery
agents.  Most common here are: maildrop, procmail.  (In some cases, MTA's
incorporate some MDA functionality.)

The normal processing order is: User creates mail using UA, which passes
it to a MTA.  This will pass it on to one or more further MTA's (on other
servers), before it gets to it's final destination, where it will be
handed to an MDA, who delivers it into a repository (often a file, or
folders of files) where the recipient's UA can access it.

(If POP/IMAP are being used, the MDA will deliver the message into a
repository where the POP/IMAP daemon will be able to access it, and the UA
will then talk to the POP/IMAP daemon to retrieve the email.)

Hope this crash-course helps.  ;)  (Note that I am _greatly_ simplifying
in some places, but for most everyday use that should not matter.)

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------

_______________________________________________
Openbsd-newbies mailing list
[email protected]
http://mailman.theapt.org/listinfo/openbsd-newbies

Reply via email to