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.

Force Default Mail Address for all accounts?

Discussion in 'E-mail Discussions' started by Arun, Jun 15, 2010.

  1. Arun

    Arun Active Member

    Joined:
    Jan 28, 2006
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Is there any way to mass change the "Default Mail Address" for all domains (existing accounts) in the server to use ":fail: No such person at this address" with "Discard with error to sender (at SMTP time)"?
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    Here's a sexy one-liner:

    Code:
    sed "s/^\*:.*/\*: :fail: No such person at this address/g" -i /etc/valiases/*
    Back up your valiases folder first.
     
    #2 vanessa, Jun 15, 2010
    Last edited: Jun 16, 2010
  3. Arun

    Arun Active Member

    Joined:
    Jan 28, 2006
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    ^^ Thank you!
     
Loading...

Share This Page