Skip to main content

How to get a complete email list

Comments

5 comments

  • cPanelMichael
    Hello, I don't believe it's possible to list those entries via an API command, but you can find them listed in the following file:
    /etc/valiases/$domain.tld
    Thank you.
    0
  • Sarabanda
    indeed it's not possible, hoping to have this possibility in API3 :(;)
    0
  • cPanelMichael
    I encourage you to open a feature request if you'd like to see an additional API function added: Submit A Feature Request Thank you.
    0
  • SactoBob
    Was searching for similar solution as well as I need to populate all my emails for a specific domain to an ldap server in order to outsource spam filtering. If you have shell/server access this works: uapi --user=account_name Email list_pops | grep email | sed 's/email://' uapi --user=account_name Email list_forwarders | grep dest | sed '/html/d' | sed '/uri/d' | sed 's/dest://' | grep '@' Replace "account_name" with the cPanel account you need to collect email addresses from. Those two commands will produce a list of all valid email accounts for the domain. The one exception is the email for the "Main Account" which is basically the account_name gets listed too (last one in the list_pops command), but it's listed without an "@" so the last "grep '@'" removes that too. This produces a list of all email and forwarders for an account that can then be further processed as needed. For mailman stuff, doesn't it basically use all the same email formats for a particular list? If you can get a list of lists, you can from that infer the email aliases it creates. You can get your lists using: uapi --user=account_name Email list_lists | grep 'list:' | sed 's/list://' Again, assuming you have shell access.
    0
  • sawbuck
    @SactoBob - Nice work. Thank you.
    0

Please sign in to leave a comment.