The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

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

  1. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    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:
    481
    Likes Received:
    0
    Trophy Points:
    16
    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???)
     
  4. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Ha! Got around the issue by creating dummy .contactemail file :)
     
Loading...

Share This Page