List all email accounts on Linux server

Dear Experts,

How I can list out all email account that had been set on my Linux server ?
all  email account address are saved in one file, where ?
(Note: I had used Cpanel before , now I created email account  with root access
in this year)

I check at /etc/aliases that I could not understand which one is email account or
not. Please help to explain the file in detail ?

Please help and advise that I 'm appreciated

Duncan

aliases file at /etc
=================
#
#  Aliases in this file will NOT be expanded in the header from
#  Mail, but WILL be visible over networks or from /bin/mail.
#
#       >>>>>>>>>>      The program "newaliases" must be run after
#       >> NOTE >>      this file is updated for any changes to
#       >>>>>>>>>>      show through to sendmail.
#

# Basic system aliases -- these MUST be present.
mailer-daemon:  postmaster
postmaster:     root

# General redirections for pseudo accounts.
bin:            root
daemon:         root
adm:            root
lp:             root
sync:           root
shutdown:       root
halt:           root
mail:           root
news:           root
uucp:           root
operator:       root
games:          root
gopher:         root
ftp:            root
nobody:         root
radiusd:        root
nut:            root
dbus:           root
vcsa:           root
canna:          root
wnn:            root
rpm:            root
nscd:           root
pcap:           root
apache:         root
webalizer:      root
dovecot:        root
fax:            root
quagga:         root
radvd:          root
pvm:            root
amanda:         root
privoxy:        root
ident:          root
named:          root
xfs:            root
gdm:            root
mailnull:       root
postgres:       root
sshd:           root
smmsp:          root
postfix:        root
netdump:        root
ldap:           root
squid:          root
ntp:            root
mysql:          root
desktop:        root
rpcuser:        root
rpc:            root
nfsnobody:      root

ingres:         root
system:         root
toor:           root
manager:        root
dumper:         root


newsadm:        news
newsadmin:      news
usenet:         news
ftpadm:         ftp
ftpadmin:       ftp
ftp-adm:        ftp
ftp-admin:      ftp
www:            webmaster
webmaster:      root
noc:            root
security:       root
hostmaster:     root
info:           postmaster
marketing:      postmaster
sales:          postmaster
support:        postmaster


# trap decode to catch security attacks
decode:         root

# Person who should get root's mail
#root:          marc

Open in new window

LVL 13
duncanb7Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
xtermConnect With a Mentor Commented:
If you are using standard Unix accounts which you are adding with the useradd (or adduser) command, then all of them will be in /etc/passwd.

If you are using something different, then let me know how you add users and what mail server software you have, and I'll tell you where to look.
0
 
LuxanaConnect With a Mentor Commented:
Have you tried to look into spool directory. That should give you a hint on how many email accounts you might have on your system. Usually the spool directory is located under:

/var/spool/mail/

so simply do :

# ls /var/spool/mail/
0
 
duncanb7Author Commented:
yes I can less /etc/passwd to see all of my account but it doesn't
show some hidden email account that is why I am asking this thread
and use sendmail -bv mylogin@mysite.com is showing "fail to verify:
no such user) but the mylogin is shown by "less /etc/passwd"

(Suppose email address before @sign is exactly same as user account
by adduser, Right ?)

I am using SquirrelMail now and I see there is mailman stuff in my cpanel
3rdpatry directory that I had no longer to use it in cpanel since it's expired

Duncan
0
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

 
xtermCommented:
SquirrelMail is just the web-based interface to view mails that have already come in - it's not your MTA (message transfer agent, AKA actual mail server software)

You are probably using Exim by default with cPanel.

Please run these 3 commands and let me know what they return:

ps ax | grep exim
ps ax | grep postfix
ps ax | grep sendmail
0
 
duncanb7Author Commented:
I also try /var/spool/mail/, it just show account created by  adduser
and some is not shown that might be caused it was created by cpanel before
DO you think so ?

What is aliases file for ?

Why those account shown /var/spool/mail can NOT be verified
by sendmail -bv mylogin@mysite.com ? it always reports
"fail to verify : no such users"
0
 
duncanb7Author Commented:
ps ax |grep exim
  684 ?        Ss     0:00 /usr/sbin/exim -bd -q1h
12343 pts/3    D+     0:00 grep exim

 ps ax |grep postfix
12347 pts/3    S+     0:00 grep postfix

 ps -aux |grep sendmail
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
mylogin 12349  0.0  0.0   6300   192 pts/3    R+   05:18   0:00 grep sendmail


there is NO postfix, and i can run sendmail.  Could you brief the different between them ?

Be reminded : I had no longer to use Cpanel more than 2 years
0
 
xtermConnect With a Mentor Commented:
Exim is your mail server.  Postfix and sendmail are just two other different types of mail servers - they're all fine, but cPanel usually sets up Exim by default, and did in this case.

Your email accounts can be found here:

/home/<username that you set up for your domain>/mail/<your domain name>
0
 
duncanb7Author Commented:
yes, it is email account I created in Cpanel

Now

1-Some is at /home/mycpanel-email-account/mail/

2-Some is at /var/spool/main (this is unix adduser account)

 Item 1 can be verified by sendmail but item-2 can not be verified

How Exim can use for normal unix adduser account not just by Cpanel ?
0
 
xtermCommented:
See my reply in your other thread.  cPanel will probably have to be uninstalled completely and the system reverted back to how it was.  You might have to Google that one and see how other people got rid of theirs.

Personally, I would do a fresh installation of CentOS and start over.
0
 
duncanb7Author Commented:
xterm, last question

what is /etc/aliases for or  related to Mail  ?
0
 
xtermConnect With a Mentor Commented:
/etc/aliases is part of sendmail - Exim doesn't use it.

It allows you to direct mail for certain names that don't actually have accounts on the system to different places.

So if your name was John Doe, you could create your account jdoe in Unix, and then put the following in /etc/aliases:

johndoe:  jdoe
johnd:      jdoe
doe:         jdoe

Then all the mail that gets sent to those incorrect addresses will still get delivered to the main jdoe account.
0
 
duncanb7Author Commented:
I will continue this with new thread and new question

Thanks for all of your reply

have a nice working day

Duncan
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.