Solved

mail alias? problem

Posted on 2002-06-11
25
450 Views
Last Modified: 2008-02-01
I'm using a machine running AIX 4.1.5 on an RS/6000, and I logged on as root, and found that when I
send mail like this:
    echo | mail -v -s "Test 1" root
I get verbose output which ends in this:
    rsteam@nz1.ibm.com... Sent
I assume rsteam is the RS/6000 team at IBM.

I can't see any reference to rstream when I do this:
    grep rsteam /etc/*
and I especially checked /etc/sendmail.cf and /etc/aliases, but nothing.  I commented all lines from
/etc/aliases, typed:
    newaliases
to rebuild the aliases DB, and did another test, but same problem!  I know aliases is working at least
partially, because some changes I made seem to work.

Any ideas how it's sending to rsteam@nz1.ibm.com?
0
Comment
Question by:tel2
  • 9
  • 7
  • 7
  • +2
25 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7069998
what does following tell you:
  which echo
  which mail
  alias mail

which mail server is running on your mashine?

does following behave the same:

   \echo test mail | \mail -v -s subject root
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7070040
Are you using NIS or NIS+? If you are using them, there might be an aliase in your mail_aliases table, otherwise, just the the alaise for sendmail and the aliase for the root user.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7070543
oops, forgot NIS
so also tell us what following retrns:
   ypwhich
   upcat aliases|grep -i root
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7071643
For NIS+, use:

   niscat mail_aliases | grep -i root


0
 
LVL 11

Author Comment

by:tel2
ID: 7071680
ahoffmann,

Answers:

# which echo
/usr/bin/echo
# which mail
/usr/bin/mail
# alias mail
mail: ksh alias not found.
# ps -ef|grep -v grep|grep mail
    root 12422  5252   0   Nov 20      -  0:00 /usr/lib/sendmail -bd -q30m

# \echo test mail | \mail -v -s subject root
Yes - still sends to rstream@nz1.ibm.com

# ypwhich
ksh: ypwhich:  not found.
# upcat aliases|grep -i root
ksh: upcat:  not found.


yuzh,

Sorry - I don't even know what NIS & NIS+ is.  What do I have to do to find out if it's running?

# niscat mail_aliases | grep -i root
ksh: niscat:  not found.

Regarding the alias for sendmail and root user, are you talking about the /etc/aliases file which I mentioned in my question?  If not, please specify how I can check these aliases.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7071835
to find out if you have NIS or NIS+ running on your systems
use:

   ps -ef | grep nis

   You should see soemthing like:
       root   131     1  0   May 23 ?        4:50 /usr/sbin/nis_cachemgr
    root   136     1 64   May 23 ?       17511:14 /usr/sbin/rpc.nisd

   If no output for the above command, you are not using NIS/NIS+.

  Have a look at the aliases file under your home dir (I mean from the account you send the mail to root).

  type in:
  cd user-home-dir
  find . -name aliases -print

  and also have a look at /etc/mail/aliases for the "include" file, and then check all the files you have
included in your aliases file.

 

 


0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7072140
> to find out if you have NIS or NIS+ running on your systems use:

     ps -ef | egrep -i 'nis|yp'

> upcat aliases|grep -i root
oops, this is a typo, please use:

     ypcat aliases|grep -i root

> niscat mail_aliases | grep -i root
who said that the map is named map_aliases?
Some systems support

     nicknames

or simply have a file /var/yp/nicknames.
Also why using niscat? the common name still is  ypcat  (for historical reason).

Sorry for being pedantic ;-)
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7072247
Hi ahoffmann,

   I use NIS+, I get used to niscat, nisls etc. It will works find for NIS+
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7072523
> .. used to niscat,
which OS?
(This is a UNIX ta, so it might be any flaviour 'til tel2 tells us)
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7072868
I use niscat with Solaris (5/7/8 Sparc + Intel)
0
 
LVL 11

Author Comment

by:tel2
ID: 7073915
ahoffmann,
> (This is a UNIX ta, so it might be any flaviour 'til tel2 tells us)
My UNIX flavour and version is listed in the first line of my question.

I'll get back to you both on the other issues.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7074374
Hi ahoffmann,

   NIS+ was design to replace NIS. the commands for NIS+ are
nisxxxx, for NIS are ypxxx.

   This apply to all UNIX flavour.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 51

Expert Comment

by:ahoffmann
ID: 7075119
I agree for NIS+ (but you comment was "NIS or NIS+" :)

tel2, have seen that you posted OS etc., my comment was for yuzh. Sorry for confusion.
There was no offence to both of you. hope the air is clean now, lets get back to th equestion.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7075431
Let me it clear, use ypxxx for NIS, nisxxx for NIS+
0
 
LVL 11

Author Comment

by:tel2
ID: 7077137
yuzh,

# ps -ef | grep nis
    root 63034 49928   1 15:15:58  pts/8  0:00 grep nis

I'm signed on as root, so from the / directory...
# find . -name "alias*" -ls
73736    4 -rw-rw----  1 root     system        910 Jul 28  1994 ./usr/lpp/bos.n
et/inst_root/etc/aliases
96464    4 -r-xr-xr-x 15 bin      bin          1042 Aug 11  1995 ./usr/bin/alias
  588    4 -rw-rw----  1 root     system        946 Jun 12 00:27 ./etc/aliases
 1009    0 -rw-rw----  1 root     system          0 Jun 14 13:38 ./etc/aliasesDB
l
 4496    4 drwxrwx---  2 root     system        512 Jun 12 00:28 ./etc/aliasesDB

None of these contain any reference to "rsteam" or "include".

Note that /etc/mail is does not exist on this system.


ahoffmann,

# ps -ef | egrep -i 'nis|yp'
    root 63064 49928   0 15:30:28  pts/8  0:00 egrep -i nis|yp

# ypcat aliases|grep -i root
ksh: ypcat:  not found.

# nicknames
ksh: nicknames:  not found.

# ls -l /var/yp/nicknames
ls: 0653-341 The file /var/yp/nicknames does not exist.


Hope this helps.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7077632
ok, you are not using NIS/NIS+, and your sendmail configuration files are under /etc, not /etc/sendmail, have a look at you /etc/sendmail.cf file and search for
aliases to see if you have aliase file defined as other file name rather than aliases
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7077824
I agree with yuzh: need to look into sendmail.cf
for example:

   grep ^DS sendmail.cf
   grep -i rsteam sendmail.cf
0
 
LVL 11

Author Comment

by:tel2
ID: 7079730
yuzh & ahoffmann,

Here are the results, plus some extras, all done via the root signon (the only signon I use/know):

# cd /etc
# ls -l send*
-rw-rw----   1 root     system     46932 Jun 11 14:50 sendmail.cf
-rw-rw----   1 root     system     46914 Jun 08 1998  sendmail.cf.old1
-rw-rw----   1 root     system     46914 Jun 08 1998  sendmail.cf.pre_ix52535
-rw-rw----   1 root     system      4877 Jun 11 14:52 sendmail.cfDB
-rw-rw----   1 root     system         0 Jun 15 11:12 sendmail.cfDBl
-rw-rw----   1 root     system      2463 Jan 10 1997  sendmail.nl
-rw-rw----   1 root     system         6 Nov 20 2001  sendmail.pid

# grep -inE "^DS|^.DS|^.OA|alias|rsteam" sendmail.cf
80:# you have an alias of "mailserv.austin.ibm.com", you have another network
92:# and classes.  In addition, it also adds to the w class any aliases
98:#Cw $w $?D$w.$D$. YourHostAliases
147:#DSRelayHostName
230:# location of alias file
231:#OA
232:OA/etc/aliases
316:# map name for NIS aliases
317:#Opmail.aliases

# strings sendmail.cfDB|grep -inE "DS|OA|alias|rsteam"
11:OA/etc/aliases
120:DS17

# l alias*
-rw-rw----   1 root     system       946 Jun 12 00:27 aliases
-rw-rw----   1 root     system         0 Jun 15 11:12 aliasesDBl
aliasesDB:
total 8
-rw-rw----   1 root     system         0 Jun 14 15:34 DB.dir
-rw-rw----   1 root     system      1024 Jun 14 15:34 DB.pag

# strings aliasesDB/DB.pag
 /dev/null
nobody
root
postmaster
root
root
mailer-daemon

# echo|mail -v -s "Test 1" root
root... setsender: uid/gid = 0/0
rsteam@nz1.ibm.com... Connecting to xxx.xxx.xx.xxx.tcp...
rsteam@nz1.ibm.com... Connecting to xxx.xxx.xx.xxx (tcp)...
220 yyyyyyyy.yyyyyyyyy.co.nz ESMTP Postfix
>>> HELO zzzzzz
250 yyyyyyyy.yyyyyyyyy.co.nz
>>> MAIL From:<root@zzzzzz>
250 Ok
>>> RCPT To:<rsteam@nz1.ibm.com>
250 Ok
>>> DATA
354 End data with <CR><LF>.<CR><LF>
>>> .
250 Ok: queued as 5F51A2FBB2
>>> QUIT
221 Bye
rsteam@nz1.ibm.com... Sent

NOTE: I've replaced security info with x's, y's & z's.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 60 total points
ID: 7079754
strange, very strange ...
please post result, if any, of:

   \strings /usr/bin/mail|grep -i rsteam
   \file /usr/bin/mail
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7082708
Could you please READ (Don't just use "grep", you might missing something)through the sendmail.cf and /etc/aliases file to find out if there is any aliases defined in a file(not named as aliases). eg, I named some of my aliase file call: vlsi, vip for my mailing list
0
 
LVL 11

Author Comment

by:tel2
ID: 7082753
yuzh & ahoffmann,

I've just done a "grep" on the "strings" of all files under /usr, and found that /usr/share/lib/Mail.rc had the aliases!  I editted the file, and commented the aliases out, and it worked!

I don't know who I should be allocating points to, but how about I give them to whoever can answer the following question:

Now, when I send mail to root:

# echo|mail -v root
I get this output:

root... setsender: uid/gid = 0/0
root... Connecting to .local...
root... Connecting to  (local)...
root... openmailer: The default user number is 1; the default group number is 1.
root... openmailer: Setting the ctladdr user number to 0 and group number to 0
root... execve: The user number is 0; the group number is 0.
root... Sent

On most of my AIX systems, I would just get:
root... Connecting to local...
root... Sent

Any ideas why I get all this other stuff about user & group numbers?

NOTE: Points will be allocated to yuzh or ahoffmann only.
0
 
LVL 20

Expert Comment

by:tfewster
ID: 7921336
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Point split ahoffmann and yuzh

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer
0
 
LVL 11

Author Comment

by:tel2
ID: 7922570
Thanks for your help, ahoffmann.
0
 
LVL 11

Author Comment

by:tel2
ID: 7922831
Thanks, tfewster,

I've posted a question:
  www.experts-exchange.com/Community_Support/Q_20508524.html
to get the points split evenly, as I don't know if I can do this myself.
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7925231
Taking care of the 'split':

yuzh

I posted a question for you at http://www.experts-exchange.com/Operating_Systems/Unix/Q_20509047.html

** Mindphaser - Community Support Moderator **
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now