Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Need list of contact emails - but they don't appear in 'Fetch CSV' list?

Discussion in 'E-mail Discussion' started by spaceman, Jan 25, 2005.

  1. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    497
    Likes Received:
    3
    Trophy Points:
    318
    Hi All,

    I need to get all the hosting account contact email addresses out of WHM and into another package (12All newslettter subscriber list).

    I was hoping to use:

    WHM > List Accounts > Fetch CSV

    ... but, despite the fact that 'List Accounts' shows the contact email address, 'Fetch CSV' omits the email addresses.

    Does anyone know why the Fetch CSV list excludes email addresses? An oversight that needs fixing or is this intentional?

    Any other way of extracting contact email addresses?

    Thanks for your help.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,366
    Likes Received:
    6
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    Don't remember who gets credit for this one. Just remove the txt extension and do "sh extract".
    HTH
     

    Attached Files:

  3. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    497
    Likes Received:
    3
    Trophy Points:
    318
    Sweet. Thanks sawbuck (you can get the credit as far as I'm concerned) :)

    Here's the text in that file you attached:

    for i in `awk -F: '/home/ {print $1};' /etc/passwd`
    do
    email=`cat /home/$i/.contactemail`
    if test -n "$email"; then
    echo $email >> list.txt
    fi
    done

    I ran it, and it wrote a bunch of addresses out, but then choked when it found a directory in home that did not have a .contactemail file:

    cat: /home/merchant/.contactemail: No such file or directory

    ('merchant' is some e-commerce payment gateway software that we run that does not have an associated hosting account - not sure why we stuck it in /home but there you go!)

    At the risk of straining the friendship :), how can I update the syntax to ignore when there is no .contactemail file? Apologies for my ignorance - my techy employee is not in today!

    Thanks again.

    ('Course, all this wouldn't be necessary if the 'fetch csv' had the email address in the first place as expected! Does anyone know why it doesn't???)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    497
    Likes Received:
    3
    Trophy Points:
    318
    Ha! Got around the issue by creating dummy .contactemail file :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice