1

Topic: Amavis: Can't create temporary directory ERROR

============ Required information ====
- iRedMail version (check /etc/iredmail-release): v0.9.5-1
- Linux/BSD distribution name and version: CentOS Linux 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? v2.4.1 (MySQL)
- Related log if you're reporting an issue:
====

Hi!

We are getting the following error message in the maillog:

/var/spool/amavisd/tmp/amavis-20170207T061329-24752-bsQ5glz8/parts/p002: Can't create temporary directory ERROR

What is it? We don't have a clue and we didn't find anything in the web.

Regards
J.

----

Get fast and professional support from iRedMail developers:

2

Re: Amavis: Can't create temporary directory ERROR

Please show us the log context (log lines before and after this line), not just one line.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3 (edited by BigJens 2017-02-09 22:42:46)

Re: Amavis: Can't create temporary directory ERROR

Here we go:

Feb  9 15:21:42 pepper postfix/postscreen[1986]: CONNECT from [51.255.135.39]:53625 to [87.98.243.247]:25
Feb  9 15:21:42 pepper postfix/dnsblog[1993]: warning: dnsblog_query: lookup error for DNS query 39.135.255.51.list.dnswl.org: Host or domain name not found. Name service error for name=39.135.255.51.list.dnswl.org type=A: Host not found, try again
Feb  9 15:21:48 pepper postfix/postscreen[1986]: PASS OLD [51.255.135.39]:53625
Feb  9 15:21:48 pepper postfix/smtpd[2088]: connect from smtp.sender-domain.de[51.255.135.39]
Feb  9 15:21:48 pepper postfix/smtpd[2088]: C597811C0057: client=smtp.sender-domain.de[51.255.135.39]
Feb  9 15:21:48 pepper postfix/cleanup[2124]: C597811C0057: message-id=<20170209142142.3471C154A046@smtp.sender-domain.de>
Feb  9 15:21:48 pepper postfix/qmgr[32280]: C597811C0057: from=<root@smtp.sender-domain.de>, size=666, nrcpt=1 (queue active)
Feb  9 15:21:48 pepper postfix/smtpd[2088]: disconnect from smtp.sender-domain.de[51.255.135.39]
Feb  9 15:21:48 pepper clamd[119]: /var/spool/amavisd/tmp/amavis-20170209T145825-31021-MiiROGc_/parts/p002: Can't create temporary directory ERROR
Feb  9 15:21:48 pepper postfix/smtpd[2135]: connect from pepper.mailknecht.net[127.0.0.1]
Feb  9 15:21:48 pepper postfix/smtpd[2135]: E6D8C11C0170: client=pepper.mailknecht.net[127.0.0.1]
Feb  9 15:21:48 pepper postfix/cleanup[2124]: E6D8C11C0170: message-id=<20170209142142.3471C154A046@smtp.sender-domain.de>
Feb  9 15:21:49 pepper postfix/qmgr[32280]: E6D8C11C0170: from=<root@smtp.sender-domain.de>, size=1324, nrcpt=1 (queue active)
Feb  9 15:21:49 pepper postfix/smtpd[2135]: disconnect from pepper.mailknecht.net[127.0.0.1]
Feb  9 15:21:49 pepper amavis[31021]: (31021-09) Passed CLEAN {RelayedInbound}, [51.255.135.39]:53625 [51.255.135.39] <root@smtp.sender-domain.de> -> <mailuser@my-domain.de>, Queue-ID: C597811C0057, Message-ID: <20170209142142.3471C154A046@smtp.sender-domain.de>, mail_id: Ln67TkfX46jz, Hits: -, size: 666, queued_as: E6D8C11C0170, 155 ms
Feb  9 15:21:49 pepper postfix/smtp[2132]: C597811C0057: to=<mailuser@my-domain.de>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.25, delays=0.07/0/0/0.17, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as E6D8C11C0170)
Feb  9 15:21:49 pepper postfix/qmgr[32280]: C597811C0057: removed
Feb  9 15:21:49 pepper postfix/pipe[2136]: E6D8C11C0170: to=<mailuser@my-domain.de>, relay=dovecot, delay=0.26, delays=0.07/0/0/0.19, dsn=2.0.0, status=sent (delivered via dovecot service)
Feb  9 15:21:49 pepper postfix/qmgr[32280]: E6D8C11C0170: removed

real sender and recipient were removed, because it's customer data.

4

Re: Amavis: Can't create temporary directory ERROR

BigJens wrote:

Feb  9 15:21:42 pepper postfix/dnsblog[1993]: warning: dnsblog_query: lookup error for DNS query 39.135.255.51.list.dnswl.org: Host or domain name not found. Name service error for name=39.135.255.51.list.dnswl.org type=A: Host not found, try again

You should fix this error too.

BigJens wrote:

Feb  9 15:21:48 pepper clamd[119]: /var/spool/amavisd/tmp/amavis-20170209T145825-31021-MiiROGc_/parts/p002: Can't create temporary directory ERROR

Did you get this error for ALL emails or just this one?
If you get for all emails, you should check whether Amavisd and ClamAV are running as same user, or directory /var/spool/amavisd/tmp has correct permission for them.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

5

Re: Amavis: Can't create temporary directory ERROR

ZhangHuangbin wrote:

Did you get this error for ALL emails or just this one?
If you get for all emails, you should check whether Amavisd and ClamAV are running as same user, or directory /var/spool/amavisd/tmp has correct permission for them.

Not all but quite often.

How can I check the user of Amavisd and ClamAV ?

6

Re: Amavis: Can't create temporary directory ERROR

Can you help me here please?

How can I check the user of Amavisd and ClamAV ?

Thanks!

7

Re: Amavis: Can't create temporary directory ERROR

BigJens wrote:

How can I check the user of Amavisd and ClamAV ?

I suppose not that hard by checking/searching in their config files? smile

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

8

Re: Amavis: Can't create temporary directory ERROR

Obviously it is :-(  I can't find a config file for ClamAV . I think I lost it and I'm copletely wrong.

9

Re: Amavis: Can't create temporary directory ERROR

ZhangHuangbin wrote:
BigJens wrote:

How can I check the user of Amavisd and ClamAV ?

I suppose not that hard by checking/searching in their config files? smile

Can you give me a hint?

10

Re: Amavis: Can't create temporary directory ERROR

In Amavisd config file:

$daemon_user  = 'amavis';

In ClamAV config file:

User clam

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

11

Re: Amavis: Can't create temporary directory ERROR

The Problem still exists, unfortunately. As you can see in 1) I think this occurs if the mail has an attachment and it needs to be unpacked.

As you can see in 2) our users is amavis, so I assume this is correct. Right?

In 3) and 4) you can see files and directories and permissions under var/spool/amavisd/tmp/...  It looks like the problem lies here. The file can't be unpacked without the permission to write in this directory.

Any help is appreciated. Thanks!
J.


1)

-bash-4.2# mlt |grep -i error


Feb 20 16:54:33 pepper postfix/dnsblog[15399]: warning: dnsblog_query: lookup error for DNS query 63.0.47.104.list.dnswl.org: Host or domain name not found. Name service error for name=63.0.47.104.list.dnswl.org type=A: Host not found, try again
Feb 20 16:54:40 pepper clamd[119]: /var/spool/amavisd/tmp/amavis-20170220T161117-09479-zEEhp8tR/parts/p006: Can't create temporary directory ERROR
Feb 20 16:54:40 pepper clamd[119]: /var/spool/amavisd/tmp/amavis-20170220T161117-09479-zEEhp8tR/parts/p002: Can't create temporary directory ERROR
^C
2)

-bash-4.2# ps aux |grep clamd
amavis 119 0.1 18.1 1120436 759488 ? Ssl 2016 356:52 /usr/sbin/clamd -c /etc/clamd.d/amavisd.conf --foreground=yes
3)

-bash-4.2# ls /var/spool/amavisd/tmp/ -la
insgesamt 16
drwxr-x--- 4 amavis amavis 4096 20. Feb 16:56 .
drwxr-x--- 7 amavis amavis 4096 20. Feb 16:49 ..
drwxr-x--- 3 amavis amavis 4096 20. Feb 16:11 amavis-20170220T161117-09479-zEEhp8tR
drwxr-x--- 3 amavis amavis 4096 20. Feb 16:11 amavis-20170220T161157-09482-46CE_rZp
-bash-4.2#
-bash-4.2#
-bash-4.2# ls /var/spool/amavisd/ -la
insgesamt 32
drwxr-x--- 7 amavis amavis 4096 20. Feb 16:49 .
drwxr-xr-x 10 root root 4096 7. Feb 05:29 ..
-rw------- 1 amavis amavis 97 20. Feb 16:49 .bash_history
drwxr-x--- 2 amavis amavis 4096 20. Feb 05:40 db
drwxr-x--- 2 amavis amavis 4096 20. Feb 05:01 quarantine
drwxr-x--- 2 amavis amavis 4096 20. Feb 05:53 .razor
drwx--x--- 2 amavis amavis 4096 6. Feb 17:27 .spamassassin
drwxr-x--- 4 amavis amavis 4096 20. Feb 16:56 tmp
4)

-bash-4.2# ls /var/spool/amavisd/tmp/amavis-20170220T161117-09479-zEEhp8tR -la
insgesamt 24
drwxr-x--- 3 amavis amavis 4096 20. Feb 16:11 .
drwxr-x--- 4 amavis amavis 4096 20. Feb 16:56 ..
-rw-r----- 1 amavis amavis 8294 20. Feb 16:56 email.txt
drwxr-x--- 2 amavis amavis 4096 20. Feb 16:56 parts

12

Re: Amavis: Can't create temporary directory ERROR

Any help here?