1

Topic: not deleted mails from /var/spool/amavisd/tmp

==== Required information ====
- iRedMail version:  0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP-AD
- Linux/BSD distribution name and version: RH 6.5
- Related log if you're reporting an issue:
====
Hello,
I've noticed that there are some old messages in /var/spool/amavisd/tmp which aren't deleted

there are directories which name is like:

amavis-20140717T170345-00617-Qvxmin_F
amavis-20140717T170616-29011-FBq7Joto
amavis-20140717T170634-03194-H40e3Zba
amavis-20140717T170646-32058-Zf_LO_Qa
amavis-20140717T170717-25292-xnmhqBwj
amavis-20140717T170751-32058-dZTxugmB
amavis-20140717T181539-20621-q_OX4m1w
amavis-20140717T181550-20638-iPGXDqbk
amavis-20140717T181558-20825-CV_lWYEP
amavis-20140717T181601-20819-AkV6ZeSl
amavis-20140717T181623-21124-baOBNb8p
amavis-20140717T181915-21233-vKygkQ6l
amavis-20140717T181931-22901-rJZCgGMW
amavis-20140717T181931-22908-U9n5ToNE
amavis-20140717T181954-22790-pd2Mx33W
amavis-20140717T182004-23163-Sp8m0CxI
amavis-20140717T182006-23151-c1rezGoY
amavis-20140717T182008-23246-G4nN36eh
amavis-20140717T182041-23594-vvnznvDy
amavis-20140721T084229-32317-9ICQP9ak
amavis-20140721T084405-02115-KfF5Sfc8
amavis-20140721T084503-03546-_etOC3vA
amavis-20140721T135902-10907-4wuU7N9j
amavis-20140721T140053-13894-abeaJIqs

I have following dirs set in amavis:

$MYHOME = '/var/spool/amavisd';   # a convenient default for other settings, -H
$TEMPBASE = "$MYHOME/tmp";   # working directory, needs to exist, -T
$ENV{TMPDIR} = $TEMPBASE;    # environment variable TMPDIR, used by SA, etc.
$QUARANTINEDIR = "/var/spool/amavisd/quarantine";

Why any messages are stored there?
I use quite little amount of storage for /tmp and it gets full quickly.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: not deleted mails from /var/spool/amavisd/tmp

Amavisd will extract emails to /var/spool/amavisd/tmp first, then invoke SpamAssassin/ClamAV to scan them. And i believe Amavisd will cleanup this directory.

3

Re: not deleted mails from /var/spool/amavisd/tmp

ZhangHuangbin wrote:

Amavisd will extract emails to /var/spool/amavisd/tmp first, then invoke SpamAssassin/ClamAV to scan them. And i believe Amavisd will cleanup this directory.

So why there are some messages stored so long.
Please find my date, ls from dir and queue length

[root@store01-ldap tmp]# date
wto, 22 lip 2014, 11:08:33 CEST
[root@store01-ldap tmp]# ls -la
total 8
drwxrwxrwt. 33 root   root    660 07-22 11:08 .
drwxr-x---+  8 amavis amavis 4096 07-14 16:41 ..
drwxr-x---.  3 amavis amavis   80 07-21 15:45 amavis-20140721T154513-17564-cwQo5byi
drwxr-x---.  3 amavis amavis   80 07-21 15:45 amavis-20140721T154532-18360-KezGSQOQ
drwxr-x---.  3 amavis amavis   80 07-22 09:29 amavis-20140722T092947-03082-Epf9pahK
drwxr-x---.  3 amavis amavis   80 07-22 09:33 amavis-20140722T093352-10050-ewuH9sgY
drwxr-x---.  3 amavis amavis   80 07-22 09:34 amavis-20140722T093437-10398-XcaHnbuE
drwxr-x---.  3 amavis amavis   80 07-22 09:35 amavis-20140722T093516-11412-83XxZqMQ
drwxr-x---.  3 amavis amavis   80 07-22 09:36 amavis-20140722T093612-13609-NDBEJHmR
drwxr-x---.  3 amavis amavis   80 07-22 09:36 amavis-20140722T093616-12845-TM9cP5lk
drwxr-x---.  3 amavis amavis   80 07-22 09:36 amavis-20140722T093621-14208-BOiKnWnd
drwxr-x---.  3 amavis amavis   80 07-22 09:36 amavis-20140722T093626-14440-c3pUfcXd
drwxr-x---.  3 amavis amavis   80 07-22 09:36 amavis-20140722T093638-14821-pS0PJefh
drwxr-x---.  3 amavis amavis   80 07-22 09:36 amavis-20140722T093643-14972-eHm6Nc7D
drwxr-x---.  3 amavis amavis   80 07-22 09:36 amavis-20140722T093652-15221-YEOXZysz
drwxr-x---.  3 amavis amavis   80 07-22 09:36 amavis-20140722T093654-15310-a_VXlsh8
drwxr-x---.  3 amavis amavis   80 07-22 09:36 amavis-20140722T093654-15311-akiwp_qx
drwxr-x---.  3 amavis amavis   80 07-22 09:37 amavis-20140722T093752-16873-Te2k_b0Y
drwxr-x---.  3 amavis amavis   80 07-22 11:01 amavis-20140722T110142-07951-IsSAAEm7
drwxr-x---.  3 amavis amavis   80 07-22 11:02 amavis-20140722T110252-09289-yjehDeVf
drwxr-x---.  3 amavis amavis   80 07-22 11:02 amavis-20140722T110253-09990-R2k8iKBm
drwxr-x---.  3 amavis amavis   80 07-22 11:03 amavis-20140722T110303-10254-LB77LI8L
drwxr-x---.  3 amavis amavis   80 07-22 11:03 amavis-20140722T110319-10559-2mIky_4L
drwxr-x---.  3 amavis amavis   80 07-22 11:04 amavis-20140722T110406-10806-ltnTsj4Q
drwxr-x---.  3 amavis amavis   80 07-22 11:04 amavis-20140722T110407-11809-E93kNuWo
drwxr-x---.  3 amavis amavis   80 07-22 11:04 amavis-20140722T110453-12106-tcCSLNPx
drwxr-x---.  3 amavis amavis   80 07-22 11:05 amavis-20140722T110502-12295-Ns8Y3FUA
drwxr-x---.  3 amavis amavis   80 07-22 11:05 amavis-20140722T110544-14661-hZzhO3hr
drwxr-x---.  3 amavis amavis   80 07-22 11:06 amavis-20140722T110606-14993-GEjTiUOS
drwxr-x---.  3 amavis amavis   80 07-22 11:08 amavis-20140722T110800-18868-50sKG0Gd
drwxr-x---.  3 amavis amavis   80 07-22 11:08 amavis-20140722T110800-18870-Sy4ZrIq3
drwxr-x---.  3 amavis amavis   80 07-22 11:08 amavis-20140722T110800-18872-jtIlXvax
drwxr-x---.  3 amavis amavis   80 07-22 11:08 amavis-20140722T110807-19042-F8sc4KPp
[root@store01-ldap tmp]# mailq|wc -l
1

4

Re: not deleted mails from /var/spool/amavisd/tmp

Each Amavisd-new child process ($max_servers smile starts one of these in the tmp directory, once the child has done its max requests ($max_requests smile it should clean up and die and then respawn a new process.

if Amavisd-new process doesn't cleanup them correctly, i'm afraid you have to cleanup them manually with cron job. For example:

1 3     * * *     root     find /var/spool/amavisd/tmp/ -mtime +30 -exec rm -r {} \;

I suggest you wait for some more days to see whether or not Amavisd will cleanup these files.

5

Re: not deleted mails from /var/spool/amavisd/tmp

ZhangHuangbin wrote:

Each Amavisd-new child process ($max_servers smile starts one of these in the tmp directory, once the child has done its max requests ($max_requests smile it should clean up and die and then respawn a new process.

if Amavisd-new process doesn't cleanup them correctly, i'm afraid you have to cleanup them manually with cron job. For example:

1 3     * * *     root     find /var/spool/amavisd/tmp/ -mtime +30 -exec rm -r {} \;

I suggest you wait for some more days to see whether or not Amavisd will cleanup these files.

Thanks,
I've increased /var/spool/amavisd/tmp/ from 512M to 2048M. We'll see if it's sufficient.

To speed up amavis I'm using /dev/shm

/dev/shm              2,0G  1,2M  2,0G   1% /var/spool/amavisd/tmp

Access is much faster than to disk and overall load average is lower.

I think you can cosider such config in your default installation configuration :-)

6

Re: not deleted mails from /var/spool/amavisd/tmp

misieq wrote:

I think you can cosider such config in your default installation configuration :-)

Some users have only 1GB memory on server, it's not a good idea to do this.
Considering it as a performance tuning tip.