0

I have a standalone 18.04 server just for running a simple LAMP website. Sometimes when I log in to the server I get notified that I have mail (like cron/at job outputs), and then I read them using mutt. The problem is that I get to know their existence only when I log in. Is there a configuration somewhere to automatically forward these local mails to my company email address so that I really get active notifications?

p.s. Sendmail is also installed but the only configuration I made to it is define(`SMART_HOST', `smtp.mycompany.com')dnl in /etc/mail/sendmail.mc, so that my PHP application can send emails through SMTP server with just a few lines of codes.

1
  • What is in /etc/aliases?
    – fkraiem
    Commented Jan 24, 2019 at 14:30

1 Answer 1

0

If you'r Sendmail/Postfix is configured and running.

Just insert/replace in /etc/aliases

root: [email protected]
2
  • IMHO it is better to keep local copy too. root: [email protected], local_account_name Commented Jan 25, 2019 at 7:24
  • My /etc/aliases is like root: my_local_account,[email protected] (new line) my_local_account: my_local_account,[email protected], and I ran sudo newaliases after editing this file. However none of the mails get sent to my company mailbox, though mails for root do get sent to my_local_account. Just now I tested my PHP application, which sends mail to users as usual, so it seems that the SMART_HOST setting in sendmail.mc as mentioned in my original post does work. Commented Jan 28, 2019 at 0:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .