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.

  • What is in /etc/aliases? – fkraiem Jan 24 '19 at 14:30
0

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

Just insert/replace in /etc/aliases

root: email@yourcompany.com
  • IMHO it is better to keep local copy too. root: email@yourcompany.com, local_account_name – AnFi Jan 25 '19 at 7:24
  • My /etc/aliases is like root: my_local_account,my_company_account@mycompany.com (new line) my_local_account: my_local_account,my_company_account@mycompany.com, 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. – Jyunhao Shih Jan 28 '19 at 0:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.