Operating System - HP-UX
1827078 Members
1534 Online
109713 Solutions
New Discussion

mailx HP-UX vs AIX (differences ?)

 
SOLVED
Go to solution
Gilbert Standen_1
Frequent Advisor

mailx HP-UX vs AIX (differences ?)

Hi, I have a line of code in my shell script which sends mail (works on HP-UX):

mailx -m -s "$subject" $PAGER1 < optdisk_error

However, this code does not work on AIX box. Any suggestions ?

Also, I tried just using the command line "mail" utility, and composed a short test message, and apparently sent it, but it never arrived at destination. Can the sending of mail to external networks be "blocked" somehow ? Do I need to reconfigure something on my AIX box so that email can be sent?
Regards
Gil

If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
21 REPLIES 21
Fred Ruffet
Honored Contributor
Solution

Re: mailx HP-UX vs AIX (differences ?)

Is sendmail configured ? You should find sendmail.cf in /etc or /etc/mail. Just setting your DS line in this file and sending a kill -1 to sendmail process should be enough.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
twang
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

Take a look at this for reference:
http://www.freelab.net/unix/hp-ux/chap13_mail.html
Mark Greene_1
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

You can use mailq -v -d to view the sendmail config and see what, if anything is stuck in the queue. You can use sendmail -v -d8.20 -q to force-flush the mail queue.

mark
the future will be a lot like now, only later
Ralph Grothe
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

One silly question,
is $PAGER1 set?
You didn't simply mean $PAGER?

On the AIX box I have access to I didn't find a reference to the -m option in the manpage (unlike on HP-UX)
Madness, thy name is system administration
Gilbert Standen_1
Frequent Advisor

Re: mailx HP-UX vs AIX (differences ?)

Hi Fred,
What is the DS line ? How do I set it in sendmail ?

In reply to others, found no messages in the queue using the referenced command provided and yes, $PAGER1 is set. Even if I just test at the command line with a literally specified email address, I still get the following error message:
If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
Gilbert Standen_1
Frequent Advisor

Re: mailx HP-UX vs AIX (differences ?)

Another example and the message that I get:

ykktase: / # mailx -s "Subject" -c gjohnson@hotmail.com < smit.log

and then I get the message:

"The flags you gave make no sense since you're not sending mail."

oracle @ykktasf.ge.org [/m02/oracle/scripts]
#mailx -s -c "test" gilstanden@hotmail.com
oracle @ykktasf.ge.org [/m02/oracle/scripts]
#test... User unknown
/m02/oracle/dead.letter... Saved message in /m02/oracle/dead.letter
mailx -s "test" -c gilstanden@hotmail.com The flags you gave make no sense since you're not sending mail.

oracle @ykktasf.ge.org [/m02/oracle/scripts]
#mailx -c "gilstanden@hotmail.com" -s "Test" The flags you gave make no sense since you're not sending mail.

...so almost no matter what I try, I get the "flags make no sense..." error!

If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
Fred Ruffet
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

as said, it is to be set in sendmail.cf file (generaly in /etc/mail). You'll have a line begining with DS. Add your SMTP server to this line (no space between DS and SMTP server). Then restart sendmail (or just kill -1)

Something strange : Why do you use -c option ? What does it mean for you ? try withour this option.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Gilbert Standen_1
Frequent Advisor

Re: mailx HP-UX vs AIX (differences ?)

The line beginning with "DS" is there and is just that, DS with nothing following it. However, is there a way I can find out what is our SMTP server ? I don't have this information currently!
If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
Mark Greene_1
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

"However, is there a way I can find out what is our SMTP server ? I don't have this information currently! "

Short of asking your network admin, you can try nslookup on the domain looking for the mx record, assuming that is your in-house mail server:

nslookup

>set type=mx
>your.domain.com (or .org or whatever)

You'll get a line back " mail addr =" and some e-mail address, usually "root@hostname"; you can try putting that hostname in the DS entry in the sendmail.cf file. If that box isn't setup for relaying internally, you'll get a bounce when you send a test mail that will say so. If it is and procedurally that's frowned upon, you'll get a network admin saying so. :-)

But, he also should be able to tell you the correct server to use.

mark
the future will be a lot like now, only later
Gilbert Standen_1
Frequent Advisor

Re: mailx HP-UX vs AIX (differences ?)

tried this, but nslookup never comes back, it just hangs, as follows:
ykktasf: /etc/mail # nslookup
Default Server:

> set type=mx
> montenca.org
Server:

If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
Geoff Wild
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

What is in /etc/resolv.conf?

Should have something like:

domain yourdomain.com
nameserver XXX.XXX.XXX.XXX
nameserver YYY.YYY.YYY.YYY
nameserver ZZZ.ZZZ.ZZZ.ZZZ
retrans 2500
retry 2


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Gilbert Standen_1
Frequent Advisor

Re: mailx HP-UX vs AIX (differences ?)

Geoff, On this AIX box, there is no /etc/resolv.conf file! What is the next step ? Should I create one ? Do you have a template I could use ?
If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
Geoff Wild
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

Yes - you need one - here's mine from an AIX box:

# cat /etc/resolv.conf
domain mydomain.com
nameserver XXX.XXX.XXX.XXX
nameserver YYY.YYY.YYY.YYY
nameserver ZZZ.ZZZ.ZZZ.ZZZ

Rgds...Geoff


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Gilbert Standen_1
Frequent Advisor

Re: mailx HP-UX vs AIX (differences ?)

I set up /etc/resolv.conf but still no mail is being sent. I verified my nameservers through whois and also using DNSstuff.com
If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
Geoff Wild
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

Okay - now that resovler is setup, do a nslookup again:

nslookup

set type=MX
yourrdomain.com

What do you get?

Now configure sendmail - in the sendmail.cf file:

DMyourdomain.com

DSmailserver.yourdomain.com

Restart sendmail

Then try your mailx command.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Gilbert Standen_1
Frequent Advisor

Re: mailx HP-UX vs AIX (differences ?)

ykktasf: / # nslookup
Default Server: ns2.srv.hcvlny.cv.net
Address: 167.206.1.103

> set type=MX
> montefiore.org
Server: ns2.srv.hcvlny.cv.net
Address: 167.206.1.103

*** ns2.srv.hcvlny.cv.net can't find montefiore.org:Server failed

In sendmail.cf I put the following entries:
DMmontefiore.org
DSns2.srv.hcvlny.cv.net

still doesn't work, so I guess I did something wrong or misunderstood a step ?
Gil


If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
Geoff Wild
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

Strange...I can find the MX records - but the server ns2.srv.hcvlny.cv.net can't...

# nslookup
Default Server: arrakis
Address: 192.168.2.100

> set type=MX
> montefiore.org
Server: arrakis
Address: 192.168.2.100

Non-authoritative answer:
montefiore.org MX preference = 500, mail exchanger = mis-vp2.montefiore.org
montefiore.org MX preference = 1, mail exchanger = mis-vp1.montefiore.org

montefiore.org nameserver = front-fw01.montefiore.org
montefiore.org nameserver = front-fw02.montefiore.org
mis-vp1.montefiore.org internet address = 216.255.101.30
mis-vp2.montefiore.org internet address = 216.255.101.31

Second thing is, the DS has to be the Mail server - not the DNS server...
should be:

DSmis-vp1.montefiore.org

Next thing though - is your AIX box internal or external? If internal, then you need to point your resolver to your Internal DNS server and DS to your internal mail server...

You could try and set
front-fw01.montefiore.org
as the first server in your resolv.conf file...

Rgds....Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Gilbert Standen_1
Frequent Advisor

Re: mailx HP-UX vs AIX (differences ?)

Well, another strange thing is that "nslookup" hangs on the AIX boxes. For example, if I'm on the ykktasg.montefiore.org server, and I use nslookup as follows:
oracle @ykktasg.montefiore.org [/m01/oracle]
#nslookup ykktasg.montefiore.org
Server:


Nothing ever comes back, it just remains at "Server:" endlessly. If you have any more ideas on how to get mail working on these AIX boxes, please let me know.
Gil
If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
Olivier Decorse
Respected Contributor

Re: mailx HP-UX vs AIX (differences ?)

Hi Gilbert,

just an idea : the "-c" flag is only used to make a copy of your mail !!
So 2 possibilities :
1) want to make a copy to toto and tata : mailx -s "test" titi -c "toto tata" < smit.log
2) don't want any copy : mailx -s "test" titi < smit.log

Olivier.
They say "install windows 2k, xp or better", so i install unix !
Gilbert Standen_1
Frequent Advisor

Re: mailx HP-UX vs AIX (differences ?)

What do you think the following output from nslookup is saying ?
ykktasf: /etc # nslookup
Default Server: ns2.srv.hcvlny.cv.net
Address: 167.206.1.103

> set type=MX
> cvnet.com
Server: ns2.srv.hcvlny.cv.net
Address: 167.206.1.103

cvnet.com preference = 5, mail exchanger = ns.cv.net
cvnet.com nameserver = ns.cvnet.com
cvnet.com nameserver = ns.cv.net
ns.cv.net internet address = 167.206.1.30
ns.cvnet.com internet address = 167.206.1.103
> montefiore.org
Server: ns2.srv.hcvlny.cv.net
Address: 167.206.1.103

*** ns2.srv.hcvlny.cv.net can't find montefiore.org:Server failed

There are several things that don't make sense to me here. The "Default servers" is given as ns2.srv.hcvlny.cv.net
But when I do a check on "whois.net" the nameservers come back as "ns.cvnet.com" and "ns.cv.com" and as you can see, ns.cvnet.com and ns2.srv.hcvlny.cv.net have the same ip address. So if that's the case, when I give it "montefiore.org" how come ns2.srv.hcvlny.cv.net "can't find" montefiore.org ?
If I could take one thing with me into the next world it would be my valid login to HP ITRC Forums
Geoff Wild
Honored Contributor

Re: mailx HP-UX vs AIX (differences ?)

"when I give it "montefiore.org" how come ns2.srv.hcvlny.cv.net "can't find" montefiore.org ?"

Because it contains no information about that zone - nor does it have forwarding set up....

dig montefiore.org MX

; <<>> DiG 9.2.1 <<>> montefiore.org MX
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25347
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;montefiore.org. IN MX

;; ANSWER SECTION:
montefiore.org. 38400 IN MX 500 mis-vp2.montefiore.org.
montefiore.org. 38400 IN MX 1 mis-vp1.montefiore.org.

;; AUTHORITY SECTION:
montefiore.org. 38400 IN NS front-fw02.montefiore.org.
montefiore.org. 38400 IN NS front-fw01.montefiore.org.

;; ADDITIONAL SECTION:
mis-vp1.montefiore.org. 38400 IN A 216.255.101.30
mis-vp2.montefiore.org. 38400 IN A 216.255.101.31

;; Query time: 575 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Nov 13 08:05:32 2004
;; MSG SIZE rcvd: 162

That's where the MX records are...

dig @ns2.srv.hcvlny.cv.net montefiore.org MX

; <<>> DiG 9.2.1 <<>> @ns2.srv.hcvlny.cv.net montefiore.org MX
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 13476
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;montefiore.org. IN MX

;; Query time: 77 msec
;; SERVER: 167.206.1.103#53(ns2.srv.hcvlny.cv.net)
;; WHEN: Sat Nov 13 08:06:47 2004
;; MSG SIZE rcvd: 32

That tells it all - ns2.srv.hcvlny.cv.net has no idea who montefiore.org is - it doesn't forward unknown queries, it does not have a copy of the zone files...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.