Koozali.org: home of the SME Server

Delete User/Mailbox - Hard-disk space not correct?

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #15 on: June 02, 2016, 11:46:13 AM »
well, you should not have all that files there..
on a quite used mail server of mine I read:

Code: [Select]
[root@fileserver spool]$ du -s -m * | sort -nr
35      spamd
2       qpsmtpd
1       vbox
1       squid
1       samba
1       pnp4nagios
1       plymouth
1       nagios
1       mail
1       lpd
1       exim
1       cron
1       clamav
1       at
1       anacron

something is wrong with your server..

Offline dbuechel

  • ***
  • 99
  • +0/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #16 on: June 02, 2016, 11:59:25 AM »
Quote
something is wrong with your server..

I install only SME-Server then all updates and then fetchmail - nothing more.

How can that happen?

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #17 on: June 02, 2016, 12:01:38 PM »
Code: [Select]
cd /var/spool/qpsmtpd
ls

what do you see?

Offline dbuechel

  • ***
  • 99
  • +0/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #18 on: June 02, 2016, 12:06:13 PM »
Quote
msg-1464695222-2667-9582   msg-1464770443-3672-6146   tnef-2667-161.doc
msg-1464695222-2667-9583   msg-1464770443-3672-6147   tnef-2667-162.doc
msg-1464695222-2667-9584   msg-1464770443-3672-6148   tnef-2667-163.doc
msg-1464695222-2667-9585   msg-1464770443-3672-6149   tnef-2667-164.doc
msg-1464695222-2667-9586   msg-1464770444-3672-6150   tnef-2667-165.doc
msg-1464695225-2667-9587   msg-1464770444-3672-6151   tnef-2667-166.doc
msg-1464695229-2667-9588   msg-1464770444-3672-6152   tnef-2667-167.doc
msg-1464695231-2667-9589   msg-1464770444-3672-6153   tnef-2667-168.doc
msg-1464695236-2667-9590   msg-1464770444-3672-6154   tnef-2667-169.doc
msg-1464695236-2667-9591   msg-1464770444-3672-6155   tnef-2667-170.doc
msg-1464695236-2667-9592   msg-1464770445-3672-6156   tnef-2667-171.doc
msg-1464695236-2667-9593   msg-1464770445-3672-6157   tnef-2667-172.doc
msg-1464695237-2667-9594   msg-1464770445-3672-6158   tnef-2667-173.doc
msg-1464695237-2667-9595   msg-1464770445-3672-6159   tnef-2667-174.doc
msg-1464695238-2667-9596   msg-1464770445-3672-6160   tnef-2667-175.doc
msg-1464695238-2667-9597   msg-1464770446-3672-6161   tnef-2667-176.doc
msg-1464695238-2667-9598   msg-1464770446-3672-6162   tnef-2667-177.doc
msg-1464695241-2667-9599   msg-1464770446-3672-6163   tnef-2667-178.doc
msg-1464695245-2667-9600   msg-1464770446-3672-6164   tnef-2667-179.doc
msg-1464695245-2667-9601   msg-1464770446-3672-6165   tnef-2667-180.doc
msg-1464695245-2667-9602   msg-1464770446-3672-6166   tnef-2667-181.doc
msg-1464695246-2667-9603   msg-1464770446-3672-6167   tnef-2667-182.doc
msg-1464695246-2667-9604   msg-1464770446-3672-6168   tnef-2667-183.doc
msg-1464695246-2667-9605   msg-1464770447-3672-6169   tnef-2667-184.doc
msg-1464695247-2667-9606   msg-1464770447-3672-6170   tnef-2667-185.doc

and many many more !

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #19 on: June 02, 2016, 12:17:19 PM »
they should have
Code: [Select]
-rw-r--r--  1 qpsmtpd clamav

perms and ownership..

I think you can safely delete them but if I were in your shoes, I'd like to know why are there so many files there..
wait for some other guys to comment

Offline dbuechel

  • ***
  • 99
  • +0/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #20 on: June 02, 2016, 12:19:54 PM »
I wait ;)

Offline dbuechel

  • ***
  • 99
  • +0/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #21 on: June 02, 2016, 12:38:12 PM »
Question:

Is it a time problem?

We have email´s with 20MB and more. With many files inside!


Offline dbuechel

  • ***
  • 99
  • +0/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #22 on: June 02, 2016, 01:03:58 PM »
About

Code: [Select]
-rw-r--r--  1 qpsmtpd clamav
-bash:-rw-r--r--: command not found.

^^

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #23 on: June 02, 2016, 01:34:58 PM »
try

Code: [Select]
ls -la

when you are in /var/spool/qpsmtpd ;-)

NOTE: be aware that if you don't know what you're doing, playing with CLI could be very dangerous.. I didn't tell you to try that "command".. if you're not familiar with CLI, before doing anything, ask for clarification ;-)

Offline dbuechel

  • ***
  • 99
  • +0/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #24 on: June 02, 2016, 01:37:03 PM »
Code: [Select]
-rw-r--r--     1 qpsmtpd clamav    3299  1. Jun 09:48 tnef-3672-73.doc
-rw-r--r--     1 qpsmtpd clamav     400  1. Jun 09:48 tnef-3672-74.doc
-rw-r--r--     1 qpsmtpd clamav       4  1. Jun 09:52 tnef-3672-75.doc
-rw-r--r--     1 qpsmtpd clamav       8  1. Jun 09:52 tnef-3672-76.doc
-rw-r--r--     1 qpsmtpd clamav      33  1. Jun 09:52 tnef-3672-77.doc
-rw-r--r--     1 qpsmtpd clamav       2  1. Jun 09:52 tnef-3672-78.doc
-rw-r--r--     1 qpsmtpd clamav      14  1. Jun 09:52 tnef-3672-79.doc
-rw-r--r--     1 qpsmtpd clamav      14  1. Jun 09:52 tnef-3672-80.doc
-rw-r--r--     1 qpsmtpd clamav      24  1. Jun 09:52 tnef-3672-81.doc
-rw-r--r--     1 qpsmtpd clamav      22  1. Jun 09:52 tnef-3672-82.doc
-rw-r--r--     1 qpsmtpd clamav       4  1. Jun 09:52 tnef-3672-83.doc
-rw-r--r--     1 qpsmtpd clamav       2  1. Jun 09:52 tnef-3672-84.doc
-rw-r--r--     1 qpsmtpd clamav   24952  1. Jun 09:52 tnef-3672-85.doc
-rw-r--r--     1 qpsmtpd clamav      14  1. Jun 09:52 tnef-3672-86.doc
-rw-r--r--     1 qpsmtpd clamav      13  1. Jun 09:52 tnef-3672-87.doc
-rw-r--r--     1 qpsmtpd clamav      14  1. Jun 09:52 tnef-3672-88.doc
-rw-r--r--     1 qpsmtpd clamav      14  1. Jun 09:52 tnef-3672-89.doc
-rw-r--r--     1 qpsmtpd clamav    3542  1. Jun 09:52 tnef-3672-90.doc
-rw-r--r--     1 qpsmtpd clamav     396  1. Jun 09:52 tnef-3672-91.doc
-rw-r--r--     1 qpsmtpd clamav      14  1. Jun 09:52 tnef-3672-92.doc
-rw-r--r--     1 qpsmtpd clamav      13  1. Jun 09:52 tnef-3672-93.doc
-rw-r--r--     1 qpsmtpd clamav      14  1. Jun 09:52 tnef-3672-94.doc
-rw-r--r--     1 qpsmtpd clamav      14  1. Jun 09:52 tnef-3672-95.doc
-rw-r--r--     1 qpsmtpd clamav    7661  1. Jun 09:52 tnef-3672-96.doc
-rw-r--r--     1 qpsmtpd clamav     400  1. Jun 09:52 tnef-3672-97.doc
-rw-r--r--     1 qpsmtpd clamav      14  1. Jun 09:52 tnef-3672-98.doc
-rw-r--r--     1 qpsmtpd clamav      13  1. Jun 09:52 tnef-3672-99.doc

Quote
NOTE: be aware that if you don't know what you're doing, playing with CLI could be very dangerous.. I didn't tell you to try that "command".. if you're not familiar with CLI, before doing anything, ask for clarification ;-)

No Problem ;)

clamav - time problem?

Offline JohnG

  • ***
  • 88
  • +0/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #25 on: June 02, 2016, 03:28:32 PM »
is this helpful?

Mail left in /var/spool/qpsmtpd https://forums.contribs.org/index.php/topic,36588.msg162763.html#msg162763


Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #26 on: June 02, 2016, 03:45:29 PM »
dbuechel should check /var/log/qpsmtpd/current /var/log/maillog and /var/log/clamd/current which might contain relevant information. A bug should be opened
C'est la fin du monde !!! :lol:

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #27 on: June 02, 2016, 04:24:57 PM »
In my experience deleting files in Linux does not always free the space instantly, I guess the garbage collection is run as a background task.

There's no garbage collection running as a background task.

There are two cases where space won't be freed when you delete a file. One is where there are multiple links to a file (i.e. where there are two or more directory entries, but only one file), and the other is when there is a process running which has an open file descriptor to the file - in which case the file becomes an anonymous file (i.e occupies space, but has no directory entries). When the last process which has an open file descriptor closes the descriptor, or exits, then the space will be freed.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #28 on: June 02, 2016, 04:32:58 PM »
is this helpful?

Mail left in /var/spool/qpsmtpd

This is a good case where qpsmtpd/clamd should be using anonymous files, so that it doesn't accidentally leave temporary files around (for example, if it crashes). An anonymous file is one which is opened, then deleted immediately while an open file descriptor is kept, so that data can be written to and read from the file.

« Last Edit: June 02, 2016, 04:43:07 PM by CharlieBrady »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Delete User/Mailbox - Hard-disk space not correct?
« Reply #29 on: June 02, 2016, 04:44:55 PM »
I think you can safely delete them but if I were in your shoes, I'd like to know why are there so many files there..
wait for some other guys to comment

Definitely a bug.