[Dovecot] file descriptor errors
Hi,
I use dovecot 2.2.9 on Gentoo Linux and I get lots of these erors in my log file:
Dec 4 08:53:37 mx dovecot: auth: Error: close failed in file object destructor: Dec 4 08:53:37 mx dovecot: auth: Error: IOError: [Errno 9] Bad file descriptor
What could cause these error messages?
My mailboxes are stored on an ext4 filesystem: /dev/vdb1 on /srv/mail type ext4 (rw,noatime)
doveconf -n: # OS: Linux 3.11.2-hardened x86_64 Gentoo Base System release 2.2 ext4 auth_master_user_separator = * auth_mechanisms = plain login auth_verbose = yes disable_plaintext_auth = no imap_client_workarounds = tb-extra-mailbox-sep tb-lsub-flags lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes mail_access_groups = mail mail_attachment_dir = /srv/mail/copymail/attachments mail_gid = mail mail_location = maildir:/srv/mail/virtual/%d/%n mail_plugins = quota acl zlib mail_log notify mail_privileged_group = mail mail_uid = vmail 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 ihave namespace inbox { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk-E-Mail { auto = subscribe special_use = \Junk } mailbox Junk { special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { auto = subscribe special_use = \Trash } prefix = INBOX. } passdb { args = /usr/local/sbin/ispcp-decrypt.py driver = checkpassword } plugin { acl = vfile acl_shared_dict = file:/srv/mail/virtual/shared-mailboxes.db quota = dict:User quota::file:/srv/mail/virtual/%d/%n/dovecot-quota quota_rule = *:storage=300M:messages=20000 quota_status_nouser = DUNNO quota_status_overquota = 552 5.2.2 Mailbox is full quota_status_success = DUNNO quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=80%% quota-warning 80 %u sieve = ~/.dovecot.sieve sieve_dir = ~/sieve zlib_save = gz zlib_save_level = 6 } postmaster_address = postmaster@deltaweb.de protocols = imap pop3 lmtp sieve service auth-worker { extra_groups = ssl-cert unix_listener auth-worker { mode = 0600 user = vmail } user = vmail } service auth { extra_groups = ssl-cert unix_listener /var/spool/postfix.relay/private/auth { group = postfix mode = 0660 user = postfix } unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0660 user = postfix } unix_listener auth-userdb { mode = 0660 user = vmail } user = vmail } service config { unix_listener config { mode = 0600 user = vmail } } service dict { unix_listener dict { mode = 0600 user = vmail } } service imap-login { inet_listener imaps { port = 993 ssl = yes } } service lmtp { inet_listener lmtp { address = ::1 port = 24 } } service managesieve-login { inet_listener sieve { port = 4190 } inet_listener sieve_deprecated { port = 2000 } } service pop3-login { inet_listener pop3s { port = 995 ssl = yes } } service quota-status { client_limit = 1 executable = quota-status -p postfix inet_listener { port = 12340 } } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = vmail } user = dovecot } ssl_cert = </etc/ssl/certs/mx_deltaweb_de.crt ssl_key = </etc/ssl/private/mx_deltaweb_de.key userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocol lmtp { mail_plugins = quota acl zlib mail_log notify sieve } protocol lda { mail_plugins = quota acl zlib mail_log notify sieve } protocol imap { mail_max_userip_connections = 50 mail_plugins = quota acl zlib mail_log notify imap_quota imap_acl imap_zlib }
Thanks in advance
-Christian Rößner
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
Hi,
just a short question: I had sent exactly this same email with a wrong email address (not the cr@sys4.de) and unfortunately I was to late deleting it in Mailman. Now I get replies to the c@roessner-network-solutions.com address, which will not succeed at the moment, because of DMARC policy. So if you already sent answers, could you please email it again to the cr@sys4.de mail. Thanks a lot in advance
Am 04.12.2013 um 10:50 schrieb Christian Rößner <cr@sys4.de>:
Hi,
I use dovecot 2.2.9 on Gentoo Linux and I get lots of these erors in my log file:
Dec 4 08:53:37 mx dovecot: auth: Error: close failed in file object destructor: Dec 4 08:53:37 mx dovecot: auth: Error: IOError: [Errno 9] Bad file descriptor
What could cause these error messages?
My mailboxes are stored on an ext4 filesystem: /dev/vdb1 on /srv/mail type ext4 (rw,noatime)
doveconf -n: # OS: Linux 3.11.2-hardened x86_64 Gentoo Base System release 2.2 ext4 auth_master_user_separator = * auth_mechanisms = plain login auth_verbose = yes disable_plaintext_auth = no imap_client_workarounds = tb-extra-mailbox-sep tb-lsub-flags lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes mail_access_groups = mail mail_attachment_dir = /srv/mail/copymail/attachments mail_gid = mail mail_location = maildir:/srv/mail/virtual/%d/%n mail_plugins = quota acl zlib mail_log notify mail_privileged_group = mail mail_uid = vmail 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 ihave namespace inbox { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk-E-Mail { auto = subscribe special_use = \Junk } mailbox Junk { special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { auto = subscribe special_use = \Trash } prefix = INBOX. } passdb { args = /usr/local/sbin/ispcp-decrypt.py driver = checkpassword } plugin { acl = vfile acl_shared_dict = file:/srv/mail/virtual/shared-mailboxes.db quota = dict:User quota::file:/srv/mail/virtual/%d/%n/dovecot-quota quota_rule = *:storage=300M:messages=20000 quota_status_nouser = DUNNO quota_status_overquota = 552 5.2.2 Mailbox is full quota_status_success = DUNNO quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=80%% quota-warning 80 %u sieve = ~/.dovecot.sieve sieve_dir = ~/sieve zlib_save = gz zlib_save_level = 6 } postmaster_address = postmaster@deltaweb.de protocols = imap pop3 lmtp sieve service auth-worker { extra_groups = ssl-cert unix_listener auth-worker { mode = 0600 user = vmail } user = vmail } service auth { extra_groups = ssl-cert unix_listener /var/spool/postfix.relay/private/auth { group = postfix mode = 0660 user = postfix } unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0660 user = postfix } unix_listener auth-userdb { mode = 0660 user = vmail } user = vmail } service config { unix_listener config { mode = 0600 user = vmail } } service dict { unix_listener dict { mode = 0600 user = vmail } } service imap-login { inet_listener imaps { port = 993 ssl = yes } } service lmtp { inet_listener lmtp { address = ::1 port = 24 } } service managesieve-login { inet_listener sieve { port = 4190 } inet_listener sieve_deprecated { port = 2000 } } service pop3-login { inet_listener pop3s { port = 995 ssl = yes } } service quota-status { client_limit = 1 executable = quota-status -p postfix inet_listener { port = 12340 } } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = vmail } user = dovecot } ssl_cert = </etc/ssl/certs/mx_deltaweb_de.crt ssl_key = </etc/ssl/private/mx_deltaweb_de.key userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocol lmtp { mail_plugins = quota acl zlib mail_log notify sieve } protocol lda { mail_plugins = quota acl zlib mail_log notify sieve } protocol imap { mail_max_userip_connections = 50 mail_plugins = quota acl zlib mail_log notify imap_quota imap_acl imap_zlib }
Thanks in advance
-Christian Rößner
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
-Christian Rößner
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
Just fyi, you missed no answers... sorry I can't help...
Maybe problem with the filesystem? Have you fsck'd it?
On 2013-12-04 5:00 AM, Christian Rößner <cr@sys4.de> wrote:
Hi,
just a short question: I had sent exactly this same email with a wrong email address (not the cr@sys4.de) and unfortunately I was to late deleting it in Mailman. Now I get replies to the c@roessner-network-solutions.com address, which will not succeed at the moment, because of DMARC policy. So if you already sent answers, could you please email it again to the cr@sys4.de mail. Thanks a lot in advance
Am 04.12.2013 um 10:50 schrieb Christian Rößner <cr@sys4.de>:
Hi,
I use dovecot 2.2.9 on Gentoo Linux and I get lots of these erors in my log file:
Dec 4 08:53:37 mx dovecot: auth: Error: close failed in file object destructor: Dec 4 08:53:37 mx dovecot: auth: Error: IOError: [Errno 9] Bad file descriptor
What could cause these error messages?
My mailboxes are stored on an ext4 filesystem: /dev/vdb1 on /srv/mail type ext4 (rw,noatime)
doveconf -n: # OS: Linux 3.11.2-hardened x86_64 Gentoo Base System release 2.2 ext4 auth_master_user_separator = * auth_mechanisms = plain login auth_verbose = yes disable_plaintext_auth = no imap_client_workarounds = tb-extra-mailbox-sep tb-lsub-flags lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes mail_access_groups = mail mail_attachment_dir = /srv/mail/copymail/attachments mail_gid = mail mail_location = maildir:/srv/mail/virtual/%d/%n mail_plugins = quota acl zlib mail_log notify mail_privileged_group = mail mail_uid = vmail 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 ihave namespace inbox { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk-E-Mail { auto = subscribe special_use = \Junk } mailbox Junk { special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { auto = subscribe special_use = \Trash } prefix = INBOX. } passdb { args = /usr/local/sbin/ispcp-decrypt.py driver = checkpassword } plugin { acl = vfile acl_shared_dict = file:/srv/mail/virtual/shared-mailboxes.db quota = dict:User quota::file:/srv/mail/virtual/%d/%n/dovecot-quota quota_rule = *:storage=300M:messages=20000 quota_status_nouser = DUNNO quota_status_overquota = 552 5.2.2 Mailbox is full quota_status_success = DUNNO quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=80%% quota-warning 80 %u sieve = ~/.dovecot.sieve sieve_dir = ~/sieve zlib_save = gz zlib_save_level = 6 } postmaster_address = postmaster@deltaweb.de protocols = imap pop3 lmtp sieve service auth-worker { extra_groups = ssl-cert unix_listener auth-worker { mode = 0600 user = vmail } user = vmail } service auth { extra_groups = ssl-cert unix_listener /var/spool/postfix.relay/private/auth { group = postfix mode = 0660 user = postfix } unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0660 user = postfix } unix_listener auth-userdb { mode = 0660 user = vmail } user = vmail } service config { unix_listener config { mode = 0600 user = vmail } } service dict { unix_listener dict { mode = 0600 user = vmail } } service imap-login { inet_listener imaps { port = 993 ssl = yes } } service lmtp { inet_listener lmtp { address = ::1 port = 24 } } service managesieve-login { inet_listener sieve { port = 4190 } inet_listener sieve_deprecated { port = 2000 } } service pop3-login { inet_listener pop3s { port = 995 ssl = yes } } service quota-status { client_limit = 1 executable = quota-status -p postfix inet_listener { port = 12340 } } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = vmail } user = dovecot } ssl_cert = </etc/ssl/certs/mx_deltaweb_de.crt ssl_key = </etc/ssl/private/mx_deltaweb_de.key userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocol lmtp { mail_plugins = quota acl zlib mail_log notify sieve } protocol lda { mail_plugins = quota acl zlib mail_log notify sieve } protocol imap { mail_max_userip_connections = 50 mail_plugins = quota acl zlib mail_log notify imap_quota imap_acl imap_zlib }
Thanks in advance
-Christian Rößner
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
-Christian Rößner
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
--
Best regards,
*/Charles Marcus/* I.T. Director Media Brokers International, Inc. *678.514.6224 | 678.514.6299 fax*
Hi,
Am 04.12.2013 um 10:50 schrieb Christian Rößner <cr@sys4.de>:
Hi,
I use dovecot 2.2.9 on Gentoo Linux and I get lots of these erors in my log file:
Dec 4 08:53:37 mx dovecot: auth: Error: close failed in file object destructor: Dec 4 08:53:37 mx dovecot: auth: Error: IOError: [Errno 9] Bad file descriptor
I found the problem, but do not know, if my solution is okay. It is the checkpassword script that I wrote in python:
… # Return data to Dovecot try: fd = os.fdopen(dovecot_out, "w") except: sl.syslog(sl.LOG_ERR, "Can not write to FD 4") sys.exit(1) os.write(fd.fileno(), "\tuserdb_uid=%i" "\tuserdb_gid=%i" % (uid, gid)) #os.close(fd.fileno())
try:
os.putenv('USER', username)
os.putenv('HOME', local_part_dir)
except:
sl.syslog(sl.LOG_WARN,
"Can not set environment variables“)
…
When it comes to the os.close(fd.fileno()) call dovecot throws an error. So for now, I leave the file descriptor open and wait for the script to terminate. I thought, I would have to close the descriptor after using it, do I?
-Christian Rößner
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
On 4.12.2013, at 13.47, Christian Rößner <cr@sys4.de> wrote:
Dec 4 08:53:37 mx dovecot: auth: Error: close failed in file object destructor: Dec 4 08:53:37 mx dovecot: auth: Error: IOError: [Errno 9] Bad file descriptor
I found the problem, but do not know, if my solution is okay. It is the checkpassword script that I wrote in python:
… # Return data to Dovecot try: fd = os.fdopen(dovecot_out, "w") except: sl.syslog(sl.LOG_ERR, "Can not write to FD 4") sys.exit(1) os.write(fd.fileno(), "\tuserdb_uid=%i" "\tuserdb_gid=%i" % (uid, gid)) #os.close(fd.fileno())
try: os.putenv('USER', username) os.putenv('HOME', local_part_dir) except: sl.syslog(sl.LOG_WARN, "Can not set environment variables“) …
When it comes to the os.close(fd.fileno()) call dovecot throws an error.
Dovecot doesn’t throw error, Python does. Dovecot just logs it. If os.write() succeeds for the fd, but os.close() immediately afterwards fails, I have no idea why it would be doing that.
So for now, I leave the file descriptor open and wait for the script to terminate. I thought, I would have to close the descriptor after using it, do I?
Doesn’t really matter. The process dies immediately anyway.
participants (3)
-
Charles Marcus
-
Christian Rößner
-
Timo Sirainen