Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Nov 2007
    Posts
    858

    Arrow export email ids list

    Hi

    again i back after my long vacation

    in cPanel/whm server there is one domain named myest.com & it has more than 500 email ids

    now i want to export that email ids or any alternate way to get list of mail ids ?

    please do reply

  2. #2
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Howdy,

    There are a quite a few ways of doing this. To offer you the best method, what are you planning to do with the list?

    Thanks!

  3. #3
    Member
    Join Date
    Nov 2007
    Posts
    858

    Arrow

    Quote Originally Posted by cpanelerice View Post
    Howdy,

    There are a quite a few ways of doing this. To offer you the best method, what are you planning to do with the list?

    Thanks!
    Just want to create mailing list

  4. #4
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Howdy,

    Easy enough:

    Code:
    cd /home(x)/user/mail/; ls -a|grep @|awk '{print $2}' FS="."
    should do most of it. The only thing that might be off is the tld that you're using so in my case I added it to this:
    Code:
     cd /home2/fishmail/mail/; ls -a|grep @|awk '{print $2}' FS="."|replace _net .net
    you'll likely need to do the same for your .tld.

  5. #5
    Member
    Join Date
    Nov 2007
    Posts
    858

    Arrow

    It's very tough to use , however i'll try to do this


    you'll likely need to do the same for your .tld.

    >> i do not understand this

    cd /home(x)/user/mail/; ls -a|grep @|awk '{print $2}' FS="."

    what should replace on (x)

    Is there any easy way to do this ?

  6. #6
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Howdy,

    The reason I put "homeX" is some folks have more than one directory. If you don't it'll just be /home. You can get your home folder path from the cPanel page for that user under "Stats". It should look something like this image attached.
    Attached Thumbnails Attached Thumbnails export email ids list-homedir.png  

  7. #7
    Registered User
    Join Date
    Jul 2009
    Posts
    1

    Default

    Thank you for your discussion. The same problem happened to me. It is very helpful to me.

  8. #8
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    I'm glad it helped. I came back and added tags to make it more search-able.

  9. #9
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Thumbs up

    Just a basic expansion on the code line given earlier in this thread
    so it functions as a simple global mail account listing script:
    Code:
    #!/bin/bash
    IFS="$"
    
    cd /home    #Just a nice starting point
    
    ls /var/cpanel/users | while read MUSER; do
      MHOME=$(grep "${MUSER}:" /etc/passwd | cut -d':' -f6 | head -1)
      cd ${MHOME}/mail/
      ls -a | grep '@' | awk '{print $2}' FS="." | replace '_' '.'
    done
    Basically reads the list of valid usernames and home directories
    of each of the users on the server and then displays all the email
    accounts that have been created for each irregardless of where the
    home folders are actually stored for each account.

    Don't forget that this will only give you a list of email accounts,
    to find out if any additional mail aliases have been setup or alternate
    names for these accounts, you will want to also look at each of
    the files listed under /etc/valiases where you will find a file named
    for each domain on the server and in that file the list of aliases
    that have been setup for that specific domain.
    Last edited by Spiral; 07-07-2009 at 03:50 AM.

  10. #10
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    showoff :P, I mean nice work

Similar Threads & Tags
Similar threads

  1. Need a script to export list of all emails.
    By jetnet in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 04-05-2010, 04:49 PM
  2. export client list and details
    By kimon in forum New User Questions
    Replies: 1
    Last Post: 01-19-2009, 07:00 PM
  3. Need to export subscribers to a mailman list
    By Jeff75 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 12-27-2005, 10:48 PM
  4. Export Mailman list emails
    By gourou76 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-25-2005, 08:52 AM
  5. export list domains in Excel?
    By asmar in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-08-2005, 05:44 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube