Junk emails frequently flood my hosting disk space

Discussion in 'Site & Server Administration' started by postcd, Aug 14, 2010.

  1. #1
    Hello,

    i have cPanel linus webhosting without root SSH access. What happens is that some emails, probably spam still arriving to my hosting and it stays in folder /mail/new those emails canot be seen anywhere in email accounts.

    Im not alone who facing this problem with this folder.
    Some people recommended adding a :blackhole: rule into spam filter, or something like /dev/null

    one complication is that i have 53 domains in my cpanel and i dont want o manually create rules on all of them and im not sure if it can be solved doing this.

    ---

    FTP root with /mail/ folder:
    [​IMG]

    And /mail/new folder getting size of thousands of megabytes within around 7 days. 600 MB after 7 days.

    What i need is setting up Cron maybe or im not sure what to do..

    P.
     
    postcd, Aug 14, 2010 IP
  2. MirVB

    MirVB Peon

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can set up a cron job to remove the mail.

    Try the following
    rm -rf /home/yourusername/mail/new/*
     
    MirVB, Aug 14, 2010 IP
  3. postcd

    postcd Well-Known Member

    Messages:
    1,043
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #3
    I have added it. And my username also into this url, but files are not removed.

    mail folder has 770 permissions
    and new folder has 700 permissions
     
    postcd, Aug 15, 2010 IP
  4. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #4
    another method to keep spam OUT of mailboxes on server level is the enforce mail protocol and standards in your postfix main.cf
    I have done so in 2 steps during the past several years and have no single case of good email being blocked -. but the bast majority of spam being rejected before entering the mailboxes.
    for a transitional period you may add for each new reject rule in main.cf the "warn_if_reject" preceding each new rule to monitor which future mail would be rejected.

    postfix configuration allows a huge number of mail protocol enforcement options. my past several years experience and monitoring has shown that MOST spam violates even very common sense basic configuration rules and thus is easily kept for good away from your server and mailboxes.

    as long as your mail server or individual email addresses accept email
    those email addresses remain in the spam mail lists that circulate on the "market"
    if your server and/or mail addresses reject all (spam)emails - you have a chance that your email addresses slowly may disappear or at least no longer expand on the market.
     
    hans, Aug 15, 2010 IP
  5. postcd

    postcd Well-Known Member

    Messages:
    1,043
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #5
    My hosting provider said that i need to contact any programmer and he write script which will delete these files.
     
    postcd, Aug 15, 2010 IP
  6. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #6
    1.
    your primary problem may be a very basic problem = permissions and ownership
    your script probably is run as user in each user-mail folder
    however the mail folders may have different (virtual?) user OTHER than user
    may be postfix, dovecot,vmail or any OTHER
    hence you may first of all have to check ownership of mail folders

    2.
    the next step is
    if your overall traffic and spam is reaching such levels
    then it maybe time to upgrade your own qualifications and get a dedicated root server
    for such as above scripts and operations you may need permissions to chown files/scripts to match the need of your system
    I assumed that you have your own dedicated server because the postfix solution a.m. of course requires root access to your system

    to ask each time your hosting company is no solution, it may exceed the tiny amount you pay each months for hosting
    if you have lots of traffic and along with it lots of problems to solve, then you need a dedicated server to do whatever needed instantly on your own server. hence you need to know what to do, need to have offline the very same OS as online and be thus able to test all before doing on production server

    the cost of high quality dedicated root server is small - may be 60-70 us$/m, the additional time to invest and liability of course is proportional to the traffic and possible arising problems and may require 100 or more additional hrs per month for direct monitoring your system and solving problems. at least the first years until all properly configured and secured.
     
    hans, Aug 15, 2010 IP
  7. postcd

    postcd Well-Known Member

    Messages:
    1,043
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #7
    Thank you,

    this was a Cronjob problem, error reports on every cronjob has been always sent to internal account (name of the account without any rollmop). So everything was saved just on HDD. Just my fault, so its solved, im sorry.
     
    postcd, Aug 17, 2010 IP