Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nestoru/d619bb48cc770e07b0ad to your computer and use it in GitHub Desktop.
Save nestoru/d619bb48cc770e07b0ad to your computer and use it in GitHub Desktop.
How to forward all Solaris user emails to an external email account
smarthost=mail.sample.com
user=me
[email protected]
/opt/csw/bin/gsed -i "s/^DS[\s]*.*/DS $smarthost/g" /etc/mail/submit.cf
/opt/csw/bin/gsed -i "s/^DS[\s]*.*/DS $smarthost/g" /etc/mail/sendmail.cf
/opt/csw/bin/gsed -i "/$user:/d" /etc/mail/aliases
echo "$user:$alertlist" >> /etc/mail/aliases
/opt/csw/bin/gsed -i "/root:/d" /etc/mail/aliases
echo "root:$alertlist" >> /etc/mail/aliases
newaliases
svcadm restart sendmail
echo "So that we never miss again an important communication from servers" | mailx -s "`hostname` As a sysadmin I want to receive my user mail notifications in my personal email address" me
echo "So that we never miss again an important communication from servers" | mailx -s "`hostname` As a sysadmin I want to receive root mail notifications in my personal email address" root
@rathorevs
Copy link

Hi ..i need to configure mail server on solaris 11 to receive email from outside my network..can you please help ( [email protected])

@nestoru
Copy link
Author

nestoru commented Oct 12, 2019

I suggest asking that question in stackoverflow. This gist is about forwarding system emails to the outside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment