1

Topic: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: FreeBSD
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes 3.0.0
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Why do I get this error and how do I fix it?

Dec 29 18:01:18 mx postfix/pipe[67136]: 03F93D68FB: to=<xx@xxx.dk>, relay=dovecot, delay=0.82, delays=0.11/0.01/0/0.69, dsn=2.0.0, status=sent (delivered via dovecot service (lda(xx@xxx.dk,)Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission deni))

----

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

2

Re: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

Try to restart Dovecot service. it should fix this issue.

3

Re: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

ZhangHuangbin wrote:

Try to restart Dovecot service. it should fix this issue.

Didn't help. Is it an error in dovecot.conf - or where do I look?

Jan  1 13:24:12 mx postfix/pipe[8962]: BBB4DDEBEA: to=<xxx@xxx.dk>, relay=dovecot, delay=0.76, delays=0.08/0/0/0.68, dsn=2.0.0, status=sent (delivered via dovecot service (lda(xxx@xxx.dk,)Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission denie))

4

Re: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

- Which version of Dovecot are you running?
- Please show us output of command "doveconf -n".

5

Re: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

ZhangHuangbin wrote:

- Which version of Dovecot are you running?
- Please show us output of command "doveconf -n".

# 2.3.4 (0ecbaf23d): /usr/local/etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.4 (60b0f48d)
# OS: FreeBSD 12.0-RELEASE amd64
# Hostname: mx.upnavigator.dk
auth_master_user_separator = *
auth_mechanisms = PLAIN LOGIN
deliver_log_format = from=%{from}, envelope_sender=%{from_envelope}, subject=%{subject}, msgid=%m, size=%{size}, %$
dict {
  acl = mysql:/usr/local/etc/dovecot/dovecot-share-folder.conf
  quotadict = mysql:/usr/local/etc/dovecot/dovecot-used-quota.conf
}
first_valid_uid = 2000
last_valid_uid = 2000
listen = * [::]
mail_gid = 2000
mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/
mail_plugins = quota mailbox_alias acl mail_log notify old_stats
mail_uid = 2000
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext
namespace {
  inbox = yes
  location =
  mailbox Archive {
    auto = no
    special_use = \Archive
  }
  mailbox Archives {
    auto = no
    special_use = \Archive
  }
  mailbox "Deleted Messages" {
    auto = no
    special_use = \Trash
  }
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox "Junk E-mail" {
    auto = no
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox "Sent Items" {
    auto = no
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    auto = no
    special_use = \Sent
  }
  mailbox Spam {
    auto = no
    special_use = \Junk
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  prefix =
  separator = /
  type = private
}
namespace {
  list = children
  location = maildir:%%Lh/Maildir/:INDEX=%%Lh/Maildir/Shared/%%Ld/%%Ln
  prefix = Shared/%%u/
  separator = /
  subscriptions = yes
  type = shared
}
passdb {
  args = /usr/local/etc/dovecot/dovecot-mysql.conf
  driver = sql
}
passdb {
  args = /usr/local/etc/dovecot/dovecot-master-users
  driver = passwd-file
  master = yes
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  mail_log_events = delete undelete expunge mailbox_delete mailbox_rename
  mail_log_fields = uid box msgid size from subject
  mailbox_alias_new = Sent Messages
  mailbox_alias_new2 = Sent Items
  mailbox_alias_old = Sent
  mailbox_alias_old2 = Sent
  old_stats_refresh = 30 secs
  old_stats_track_cmds = yes
  quota = dict:user::proxy::quotadict
  quota_grace = 10%%
  quota_warning = storage=100%% quota-warning 100 %u
  quota_warning2 = storage=95%% quota-warning 95 %u
  quota_warning3 = storage=90%% quota-warning 90 %u
  quota_warning4 = storage=85%% quota-warning 85 %u
  sieve = %Lh/sieve/dovecot.sieve
  sieve_before = /var/vmail/sieve/dovecot.sieve
  sieve_dir = %Lh/sieve
  sieve_global_dir = /var/vmail/sieve
  sieve_max_redirects = 30
}
protocols = pop3 imap sieve lmtp
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    group = vmail
    mode = 0666
    user = vmail
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service imap-login {
  process_limit = 500
  service_count = 1
}
service lmtp {
  executable = lmtp -L
  inet_listener lmtp {
    address = 127.0.0.1
    port = 24
  }
  process_min_avail = 5
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
  user = vmail
}
service managesieve-login {
  inet_listener sieve {
    address = 127.0.0.1
    port = 4190
  }
}
service old-stats {
  fifo_listener old-stats-mail {
    mode = 0644
    user = vmail
  }
  inet_listener {
    address = 127.0.0.1
    port = 24242
  }
}
service pop3-login {
  service_count = 1
}
service quota-warning {
  executable = script /usr/local/bin/dovecot-quota-warning.sh
  unix_listener quota-warning {
    group = vmail
    mode = 0660
    user = vmail
  }
}
ssl = required
ssl_ca = </etc/pki/tls/certs/fullchain.pem
ssl_cert = </etc/pki/tls/certs/cert.pem
ssl_cipher_list = ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
ssl_prefer_server_ciphers = yes
syslog_facility = local5
userdb {
  args = /usr/local/etc/dovecot/dovecot-mysql.conf
  driver = sql
}
protocol lda {
  lda_mailbox_autocreate = yes
  lda_mailbox_autosubscribe = yes
  mail_plugins = quota mailbox_alias acl mail_log notify old_stats sieve
}
protocol lmtp {
  lmtp_save_to_detail_mailbox = yes
  mail_plugins = quota sieve
  recipient_delimiter = +
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_max_userip_connections = 30
  mail_plugins = quota mailbox_alias acl mail_log notify old_stats imap_quota imap_acl imap_old_stats
}
protocol pop3 {
  mail_max_userip_connections = 30
  mail_plugins = quota mailbox_alias acl mail_log notify old_stats
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %08Xu%08Xv
}

6

Re: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

Could you please show me output of command below:

ls -l /var/run/dovecot/*stat*

7

Re: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

# ls -l /var/run/dovecot/*stat*
srw-------  1 root   wheel    0 Jan  1 22:00 /var/run/dovecot/old-stats
prw-r--r--  1 vmail  wheel    0 Jan  1 22:00 /var/run/dovecot/old-stats-mail
prw-------  1 root   wheel    0 Jan  1 22:00 /var/run/dovecot/old-stats-user
srw-------  1 root   wheel    0 Jan  1 22:00 /var/run/dovecot/stats-reader
srw-rw----  1 root   dovecot  0 Jan  1 22:00 /var/run/dovecot/stats-writer

8

Re: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

Hi

I am gettting same error.

System: FreeBSD 11.2
Dovecot: 2.3.4_3

Best regards.

Hasan Alp iNAN

9

Re: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

Try this: Append new settings below in /etc/dovecot/dovecot.conf, then restart dovecot service and try again.

service stats {
    unix_listener stats-reader {
        user = vmail
        group = vmail
        mode = 0660
    }

    unix_listener stats-writer {
        user = vmail
        group = vmail
        mode = 0660
    }
}

10

Re: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed

ZhangHuangbin wrote:

Try this: Append new settings below in /etc/dovecot/dovecot.conf, then restart dovecot service and try again.

service stats {
    unix_listener stats-reader {
        user = vmail
        group = vmail
        mode = 0660
    }

    unix_listener stats-writer {
        user = vmail
        group = vmail
        mode = 0660
    }
}

YES! Thank you!
That did the trick!