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 forward your main user mails to /dev/null ?

Discussion in 'E-mail Discussions' started by billau, Jul 31, 2004.

Thread Status:
Not open for further replies.
  1. billau

    billau Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brisbane, Australia
    cd /home/username/mail
    rm inbox # empties out their inbox
    ln -s /dev/null inbox
    chown username:mail inbox
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I'm getting tired of this. Do you know the implications of some of your "suggestions"?

    If you do this, then run /scripts/mailperm or WHM > "Rebuild/Fix Mail Dbs/Boxes" you will break the permissions on /dev/null :rolleyes:

    Please make sure you know what you're talking about before making such suggestions and the last (crontab) one!
     
  3. Curious Too

    Curious Too Well-Known Member

    Joined:
    Aug 31, 2001
    Messages:
    427
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator

    Why not just change the default email address to :blackhole: ?
     
  4. easyhoster1

    easyhoster1 Well-Known Member

    Joined:
    Sep 25, 2003
    Messages:
    659
    Likes Received:
    0
    Trophy Points:
    16
    Or, upload a file called .forward with

    /dev/null

    And FTP into the default user shell

    /home/username
     
  5. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Cause that gets rid of mail addressed to non-existant mailboxes, but doesn't get rid of mail addressed to the default account, that many people don't use.
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    The solution that easyhoster suggests would get my vote for ditching the main accounst email.
     
  7. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    What would the permissions for .forward be?
     
  8. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    644 works. You might get away with 640
     
  9. Curious Too

    Curious Too Well-Known Member

    Joined:
    Aug 31, 2001
    Messages:
    427
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator

    If you change the default email address to :blackhole: then any email addressed to the default user is blackholed, including the default email address. The only email that gets delivered is email addressed to the pop accounts that have been created.
     
  10. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Is that relatively new behaviour in cPanel? I've been using cPanel for about 9 months and have updated a number of times. My server seems to be behaving like that now, but I'm fairly sure it didn't the first couple months I had it?
     
  11. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Actually, that's not quite correct. That is what you would rightly expect to happen, and mostly it does. However, the address of last resort for mail delivery (usually bounces) will often be username@hostname which the :blackhole: filter does not catch (also, some web forms can do this). The only way to prevent mail delivery of that kind is to use the .forward method mentioned above.
     
  12. taotoon

    taotoon Well-Known Member

    Joined:
    Nov 14, 2004
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    I don't use main account's email too.

    and it can't set the options.
     
  13. fuzzywzhe

    fuzzywzhe Registered

    Joined:
    Dec 9, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    For the benefit of anybody else coming to this site.

    His suggestion was perfectly correct. Using a symbolic link to link the default file to /dev/null CANNOT change the permissions on /dev/null unless he's done it as root, rather than the account that owns the file. That's the purpose of having user accounts.

    I have my mail server setup this way.

    You'll never read this, but people who certain they are right, rarely are. It's 9 years later, and I'm certain you're still making some convoluted solution to a simple problem. The reason /dev/null exists is so you can send garbage to the trash automatically. That's precisely the point of the file.
     
Loading...
Thread Status:
Not open for further replies.

Share This Page