0

How can a linux box be set up to send service emails from ' "service name" @ "machine id" ' to a non-root email account?

Example1:

to: manager@mail.com  
from: cron@machine**1**.com

Example2:

to: manager@mail.com  
from: mdadm@machine**2**.com

Services set up email notices with idiomatic syntax. Checking just

grep -Eir "(MAILADDR|MAILTO|-m)(\ )*(=)?(\ )*root" /etc/*

turns up Recipients:

/etc/anacrontab:MAILTO=root  
/etc/cron.d/0hourly:MAILTO=root  
/etc/crontab:MAILTO=root  
/etc/mdadm.conf:MAILADDR root  
/etc/smartmontools/smartd.conf:DEFAULT -a -n standby,7,q -S on -m root -M exec   /usr/libexec/smartmontools/smartdnotify -n standby,10,q  
/etc/sysconfig/smartmontools:# smartd_conf_opts="-H -m root"

(There probably are other ways - in addition to MAILADDR, MAILTO & -m - that packages name the notification recipient.)

Sender
root?

Is finding/changing those files the way to get them to mail to manager@mail.com? An account alias maybe?
Is it possible to set the sender to service@machineId?
Is creating a user and/or local mailbox required for "send only"s?

Related:
how to redirect all email to a single external address?
Redirect specific e-mail address sent to a user, to other email-recipients (procmail)

Platform:
Centos 7
postfix

0

Edit the file
/etc/aliases

Under # Person who should get root's mail set the recipient with an entry similar to:
root: email@il0veb00b5.xxx

Then run:
newaliases

I think no need to restart postfix...

  • If I understood correctly the question... – BiG_NoBoDy May 19 '18 at 19:51
  • The # Person who should get root's mail #root: marc in /etc/aliases followed by newaliases looks like the answer to me @BiG_NoBoDy When I try it out, & it works, I'll credit you and close the q. – iletras May 19 '18 at 19:59
  • Cool, happy if it helps – BiG_NoBoDy May 19 '18 at 20:16

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.