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!

how to remove / deleted all email forwarders from particular domain ??

Discussion in 'E-mail Discussion' started by crazyaboutlinux, Feb 4, 2011.

  1. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    941
    Likes Received:
    0
    Trophy Points:
    66
    we have a domain which has 2000 numbers of email forwarders created & which want to remove them.

    how to remove / deleted all email forwarders from particular domain at one go ?
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    5
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    Hello,

    You can delete the forwarders of a particular domain from the file /etc/valiases/${domain} .
    Cheers !
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    941
    Likes Received:
    0
    Trophy Points:
    66
    do i just need to enter only /etc/valiases/${domain} (replace with actual domain) from SSH ??
     
  4. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    458
    Likes Received:
    6
    Trophy Points:
    68
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Yes. Rather than deleting the file, you could move the file into the user's home folder as it would have been a quite an effort to add so many forwarders. ;)

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #4 JawadArshad, Feb 4, 2011
    Last edited: Feb 4, 2011
  5. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    941
    Likes Received:
    0
    Trophy Points:
    66
    I have tried but it gives an error
    Code:
    root@server [~]# /etc/valiases/$example.net
    -bash: /etc/valiases/example.net: No such file or directory
    root@server [~]# cd /etc/valiases/
    root@server [/etc/valiases]# /etc/valiases/$example.net
    -bash: /etc/valiasesexample.net: No such file or directory
    root@server [/etc/valiases]# /etc/valiases/${example.net}
    -bash: /etc/valiases/${example.net}: bad substitution
    root@server [/etc/valiases]#
    
     
  6. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    5
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    Hello,

    root@server [/etc/valiases]# vi domain.com

    You will be able to see the forwarders of the domain.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,609
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello Nilesh,

    You cannot directly enter the file name without a corresponding command before it. If you want to move the file, you can do:

    Code:
    cd /etc/valiases
    mv domain.com /home/user/domain.com
    Here you are changing directory (cd) to /etc/valiases, then moving (mv) the domain's forwarder file to the user's home location. Replace domain.com with the domain in question and replace user with the cPanel account's username.

    I did want to mention that vi isn't necessary to see the contents of a file also. You can use cat:

    Code:
    cat /etc/valiases/domain.com
    Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    I would install ConfigServer Mail Manage and do it from there, it will show the forwarders in a text file you can cut and past save it before you delete them ConfigServer Mail Manage
     
    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