Tuesday, September 18, 2007

Sendmail Relay

How do you get root's mail to my inbox on a different PC?

1. Edit your sendmail.mc file to include "define(`SMART_HOST', `a.b.c.d')", where a.b.c.d is the ip of a mail server you are allowed to relay through.
2. Generate a new sendmail.cf file using the m4 utility
cd /etc/mail
m4 sendmail.mc > sendmail.cf
3. Restart sendmail
service sendmail restart
4. Edit /etc/aliases to point root's mail to your mail
root: user@domain.com
5. Run the newaliases command
6. It is always a good idea to insure that sendmail is only running on the localhost, this can be verified by checking the sendmail.mc file for

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Note: You can always edit the submit.cf file to change the relay host from the localhost to the actual mail relay server. This will allow you to get mail from cronjobs that have you specified in the mailto=... syntax. You would do this if sendmail was not running.

There may be better ways but I have not found them.

Matthew

Wednesday, September 05, 2007

Oracle Stuff

Ok, I am back to posting things I need to remember. Been a bit overwhelmed lately and didn't have the time to even think about stuff I needed to remember. Ridculous if you ask me.

To reboot a server running Oracle 10g:

1. Login as the oracle user.
2. shutdb rev53p1
3. reboot
4. Login as the oracle user.
5. startdb rev53p1

Replace "rev53p1" with whatever database name you are working on. Apparently the one I work on is named rev53p1.