[Solved] How to receive local mails at /var/mail/<user>

Kernels & Hardware, configuring network, installing services

[Solved] How to receive local mails at /var/mail/<user>

Postby AntonioGa » 2020-04-02 18:41

Hi,

I don't know where to start. Everything was alright a couple of days ago.

I had installed a basic Debian (Jessy) from a minimal image (netinst) in order to install a LAMP stack. Everything was working as expected: with Debsecan, Fail2ban or Munin sending emails to /var/mail/<user>.

Then, I installed mSMTP and I started receiving Fail2ban mails in my Gmail default mSMTP account instead of /var/mail/<user>. Since Google sets a limit to smtp mails (100 per day), I didn't want those emails to affect that limit. To fix that problem I did many things. So many that I lost track of them. Now, I don't receive any kind of mail in /var/mail/<user>. At least I used to collect there mails from Fail2ban and Debsecan (and maybe Munin). So, the problem is not only with Fail2ban configuration, because I don't receive mails from Desecan, either.

So, my question is how can I restart to receive local mails at /var/mail/<user> again?

Thanks
Last edited by AntonioGa on 2020-04-06 11:59, edited 1 time in total.
AntonioGa
 
Posts: 2
Joined: 2020-04-02 17:40

Re: How to receive local mails at /var/mail/<user>

Postby CwF » 2020-04-05 14:01

good question. Somewhere in exim4 stuff. Look at /etc/exim4/exim4.conf.template.

### transport/30_exim4-config_mail_spool

# This transport is used for local delivery to user mailboxes in traditional
# BSD mailbox format.
#
mail_spool:
debug_print = "T: appendfile for $local_part@$domain"
driver = appendfile
file = /var/mail/$local_part
delivery_date_add
envelope_to_add
return_path_add
group = mail
mode = 0660
mode_fail_narrower = false
CwF
 
Posts: 800
Joined: 2018-06-20 15:16

Re: How to receive local mails at /var/mail/<user>

Postby AntonioGa » 2020-04-06 11:55

Hi and sorry for the delay.

Thanks you, CwF, for your reply.

The file you mentioned, /etc/exim4/exim4.conf.template, was OK, but you led me to look into "exim4 stuff".

The problem was that /usr/sbin/exim4 didn't exist. I don't think it was uninstalled, but just deleted in a fit of madness.
I installed it again:

Code: Select all
~$ sudo apt install exim4

And since msmtp was linked to sendmail, I linked sendmail to exim4 again:

Code: Select all
~$ sudo ln -s /usr/sbin/exim /usr/sbin/sendmail

Now, at least I've received the "Debian security status" once.
I'll have to figure out how to do the same for Fail2ban or Munin. But it'll be easier knowing that local mails can be delivered.

Thanks again, CwF for answering a question so blurred.

I consider the question solved.
AntonioGa
 
Posts: 2
Joined: 2020-04-02 17:40


Return to System configuration

Who is online

Users browsing this forum: No registered users and 18 guests

fashionable