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.

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

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

  1. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    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:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    You can delete the forwarders of a particular domain from the file /etc/valiases/${domain} .
    Cheers !
     
  3. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    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:
    447
    Likes Received:
    4
    Trophy Points:
    18
    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. ;)

     
    #4 JawadArshad, Feb 4, 2011
    Last edited: Feb 4, 2011
  5. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    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:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

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

    You will be able to see the forwarders of the domain.
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    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.
     
  8. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    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
     
Loading...

Share This Page