Page 1 of 1

Setting up "basic" mail

Posted: Wed Jan 09, 2019 11:28 am
by MichaelAM
Hi. I am trying to setup dovecot. As part of the basic directions it suggests sending an email to a user on the PI - to see how the already running mail server delivers mail. However, I do not seem to be able to use the example: 'mail -s "Dovecot test" $User' as I cannot find the program /usr/bin/mail aka command-line mail aka bellmail.

It seems 'simple' is too hard and/or I am not smart enough to find a package with it using apt-file and apt-cache.

Thanks (and best wishes for 2019)

p.s. - as most google hits come up with threads from 2013, 2014 - and one from 2017 - I am starting a new one hoping it will, ultimately, be more relevant to the current software availability and practices.

Re: Setting up "basic" mail

Posted: Wed Jan 09, 2019 3:59 pm
by knute
mail is part of the mailutils package (and I think some other). It delivers mail to a user or to a mail transfer agent.

You need to install the rest of the mail system however, something to collect and deliver the mail. I really like sendmail for that but you will get plenty of other suggestions. I've run dovecot and sendmail for years on linux systems and for a bit on Pis. The "mail" program is part of the mailutils package and can be installed with apt. If you just attempt to install mailutils, apt will also install another mail program at the same time. I can't remember which one at the moment but if you want sendmail install it first or concurrently with mailutils. I can help you configure your sendmail/dovecot and I'm sure there are folks that can help you with postfix, exim or one of the other MTAs.

Re: Setting up "basic" mail

Posted: Wed Jan 09, 2019 4:03 pm
by rpdom
A default Debian installation includes basic local mail delivery, but Raspbian does not, probably because it's not needed for the main target audience.

Re: Setting up "basic" mail

Posted: Sun Jan 13, 2019 3:39 pm
by bzt

If you only want to send emails and do not wish to receive them, then I'd suggest ssmtp package (simple smtp, and indeed it's simple to set up). That will provide you /usr/bin/sendmail, and it is compatible with other MTAs (sendmail, exim, qmail etc.). The only downside is, you won't store mails locally, therefore you'll need an smtp relaying hub (should be provided by your ISP, or you can use the recipient mx server directly).
For example, if you want to send those mails to a gmail account, then you can set up ssmtp to directly send to (to figure out the mx server for the address "abc @", use "host -t MX", or ask their tech support :-) In case of google, should work too).

viewtopic.php?t=191675 ... end-emails ... rrypi.html