Posts: 1
Joined: Wed Jan 09, 2019 11:19 am

Setting up "basic" mail

Wed Jan 09, 2019 11:28 am

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.

Posts: 365
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: Setting up "basic" mail

Wed Jan 09, 2019 3:59 pm

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.

User avatar
Posts: 13098
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Setting up "basic" mail

Wed Jan 09, 2019 4:03 pm

A default Debian installation includes basic local mail delivery, but Raspbian does not, probably because it's not needed for the main target audience.

Posts: 246
Joined: Sat Oct 14, 2017 9:57 pm

Re: Setting up "basic" mail

Sun Jan 13, 2019 3:39 pm


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 gmail-smtp-in.l.google.com (to figure out the mx server for the address "abc @ def.ltd", use "host -t MX def.ltd", or ask their tech support :-) In case of google, smtp.gmail.com should work too).

https://raspberrypi.stackexchange.com/q ... end-emails
https://howtovmlinux.com/articles/rasbe ... rrypi.html


Return to “Networking and servers”