Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 May 2004 10:08:56 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Carla Neves <carla.neves@nereus.pt>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Freebsd - Mail configuration and syntax
Message-ID:  <20040531090856.GA51147@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <200405310832.i4V8WLR03950@www.plutao.lusodigital.net>
References:  <200405310832.i4V8WLR03950@www.plutao.lusodigital.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 31, 2004 at 09:32:21AM +0100, Carla Neves wrote:

> I would like someone to give me some good tips to configure my email=20
> on Freebsd v4.9, to send/receive messages. I would like to use what I=20
> have already installed: sendmail, mailx. I went through the Freebsd=20
> manual but I coulnd't find any tips for the syntax of=20
> sending/receiving emails, just the sendmail configuration. So I would=20
> apreciate your help to give me the good steps for:

Hmmm... the mailx command always used to be a SysV thing -- in fact, a
port of the BSD mail(1) command, which they had to rename because they
already had a mail(1) command which did something completely
different.

Looking at the pkg-descr for the mail/mailx command it actually looks
almost identical to the mail(1) command in the base system. =20
=20
> 1- Configuring sendmail (although is already in the manual)

Could you be more specific about what you want to do with your e-mail
system?  In general, all things are possible (e-mail wise) using
sendmail, but not necessarily easy or obvious.

> 2- Syntax used to send email (with examples would be great).

Well, to use mail(1) to send an e-mail from the command line it's
pretty much:

    % mail -s "Message Subject here" addressee@example.com

Then type in your message ending with a ^D or a '.' on a line by
itself.  There are a number of ~-escapes you can use to do things like
invoke an editor or edit the message headers.

For use in scripting, mail(1) is quite handy -- you can do something
like this:

     mail -s "Automatic Message" recipient@example.com <<E_O_M
     The contents of the message goes here.

     As much as you like, really.

     E_O_M

but it's more efficient to pipe stuff directly into sendmail:

     /usr/sbin/sendmail -t -oi -oem <<E_O_M
     To: recipient@example.com
     Subject: Automatic Message

     The contents of the message goes here.

     As much as you like, really.

     E_O_M

> 3- Syntax to see the received emails.

Just type mail to get a listing of your inbox, then type the message
number to read that message, or 'n' for the next message.
=20
> I went through the man pages of mailx and sendmail, but they seem not=20
> to be very userfriendly for someone who is quite knew configuring=20
> email on Freebsd. So could you please help me?

sendmail is quite hard to deal with.  A very good resource is the file
/usr/share/sendmail/cf/README which summarises all of the options you
can put into a .mc file.  The Sendmail Operations manual in
/usr/share/doc/smm/08.sendmailop/paper.ascii.gz also contains a great
deal of useful stuff.  However, if you really want to get to grips
with it, you should look at the bat book -- Sendmail, 3rd Ed. Costales
and Allman, O'Reilly (http://www.oreilly.com/catalog/sendmail3/)

Personally, I'm not a big fan on the mail(1) command for interactive
use -- mutt(1) is much better.  Lots of people like pine(1) and it's
certainly a lot more friendly towards beginning users.  Then there are
e-mail clients available for emacs, plus a whole range of GUI mail
clients such as Mozilla mail, Thunderbird, Evolution etc.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--GvXjxJ+pjyke8COw
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAuvYoiD657aJF7eIRAr8VAJ9gJwNL7xrdSpipMS2gvxxi4+oETgCfU8Am
eHGZ8vFul8hA1fnKD2M8fEk=
=uNCN
-----END PGP SIGNATURE-----

--GvXjxJ+pjyke8COw--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040531090856.GA51147>