Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending mail from aix to an external email address

Status
Not open for further replies.

maxcrook

Programmer
Jan 25, 2001
210
GB
I have set up a script that checks for a few conditions within in a file when run, however I want to now specify my email address so that when a certain condition is met/not met it will mail me at work.

How will I do this - I am not worried about setting the conditions up as I have already done this but mail to a .com or co.uk account is beyond me.
 
set up an alias in /etc/aliases - remember to reload the aliases file - alias = whatever, within /etc/aliases whatever = youremailaddress@firm.co.uk.... this is all based on sendmail being setup and configured.
 
How can I check that sendmail is configured ?
Can I test it without having to amend the /etc/aliases file then ?
 
Yep - something like #sendmail > file.txt root or #sendmail root > file.txt, try and do something like this and it should send file.txt to the root account ( not sure of the switches though ) HOWEVER, this dosen't always mean that sendmail has got mail gateway setup. best thing to do is have a look at sendmail.conf if it's out of the box unchanged you've got no hope ( I haven't got a clue how to set it up ) if not then all systems go ( no one configures sendmail for a laugh ).... don't worry about the aliases file you really can't do that much damage ( famous last words ).
 
Hi max,

If your sendmail configuration is pretty standard you will probably have little trouble doing this.

Take a copy of /etc/sendmail.cf and put it somewhere safe. Don't skip this step.

Edit sendmail.cf and look for the entry to specify the mail forwarding host. This is the mail host on your network that understands how to get to the internet. If you have a pop3 server then that is probably the host name you want to specify here.

Go careful -- the sendmail.cf file has made stronger men than you or I sob their hearts out.

You'll notice that I've been deliberately vague. I haven't said 'look for the line contain "kjshdj" and change it to "oisdu"'; that's because sendmail.cf files can be very different and UNIX vendors have varying ideas of what a standard .cf file should look like.

Read the comments in the .cf file, they are sometimes very helpful.

Recompile the .cf file, run 'man sendmail | pg' for instructions on how to do that on your machine.

Restart the sendmail service or reboot the machine.

Test your configuration:

First with local mail.
[tt]mailx -s'Local Test' root <<!
Just a test of root mail.
!
[/tt]

Then with remote mail.
[tt]mailx -s'Remote Test' michael.j.lacey@ntlworld.com <<!
Just a test of remote mail.
!
[/tt]


If it all goes wrong -- remember that you can restore the saved copy of the .cf file (remember I said not to skip that bit?), recompile the .cf file and restart mail.

Regards,

Mike
Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Mike - Cheers again ! I am now mailing from my Rs! Excellent.

Just a quick one - is it now possible to put a line in a user profile to mail someone if vi is used on the .sh_history file ?

Max
 
You must to setup accountig to watch for specific actions on specific files.
 
Does anyone know how to alias the &quot;FROM&quot; when sending email? I am trying to send an email from HP-UX, and I get undeliverable return receipts from Microsoft Exchange servers. I don't have a problem when hitting pop3.

I have changed the sendmail.cf file to a hotmail.com (ugh!) address, so pop3 servers work okay with the qualified domain name....but Exchange servers are not allowing the email.

Any suggestions? Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top