Topic: After hard Ubuntu CD Upgrade
======== Required information ====
- iRedMail version: 0.6.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Ubuntu 12.04 LTS
- Related log if you're reporting an issue:
====
Hi. My client has updated his server from OLD Ubuntu OS to NEW Ubuntu OS by CD Disc. After reboot obviously nothing work.
Sure it's strong mistake, but now my client ask me to help him, because old system administrator has disappeared.
In this case it's my first experience with iRedMail and please believe me - before I start to write this message I spend a lot of time in Google and documentation for it. I think after hard upgrade OS some libs and configs was rewrited or removed, also new software versions have new syntax.
I fixed many errors in config files etc and now I just have one problem.
I can't get new mail. I just can see old mail in Roundcube before upgrade. Fetchmail works fine and in prove of it I attached log.
For example I compose new message from my Gmail to client e-mail. Well, let's look fetchmail log file
Jul 31 01:16:44 example fetchmail[2561]: 6.3.21 querying pop3.timeweb.ru (protocol POP3) at Wed Jul 31 01:16:44 2013: poll started
Jul 31 01:16:44 example fetchmail[2561]: Trying to connect to 92.53.98.109/110...connected.
Jul 31 01:16:44 example fetchmail[2561]: POP3< +OK POP3 ready
Jul 31 01:16:44 example fetchmail[2561]: POP3> CAPA
Jul 31 01:16:45 example fetchmail[2561]: POP3< +OK Capability list follows
Jul 31 01:16:45 example fetchmail[2561]: POP3< TOP
Jul 31 01:16:45 example fetchmail[2561]: POP3< USER
Jul 31 01:16:45 example fetchmail[2561]: POP3< SASL LOGIN PLAIN
Jul 31 01:16:45 example fetchmail[2561]: POP3< STLS
Jul 31 01:16:45 example fetchmail[2561]: POP3< .
Jul 31 01:16:45 example fetchmail[2561]: POP3> STLS
Jul 31 01:16:45 example fetchmail[2561]: POP3< +OK
Jul 31 01:16:45 example fetchmail[2561]: Server certificate:
Jul 31 01:16:45 example fetchmail[2561]: Issuer Organization: Thawte, Inc.
Jul 31 01:16:45 example fetchmail[2561]: Issuer CommonName: Thawte SSL CA
Jul 31 01:16:45 example fetchmail[2561]: Subject CommonName: *.timeweb.ru
Jul 31 01:16:45 example fetchmail[2561]: Subject Alternative Name: *.timeweb.ru
Jul 31 01:16:45 example fetchmail[2561]: pop3.timeweb.ru key fingerprint: E3:FD:C9:D5:B9:FD:73:41:6B:A7:5D:A1:0E:A5:3E:4E
Jul 31 01:16:45 example fetchmail[2561]: POP3> CAPA
Jul 31 01:16:45 example fetchmail[2561]: POP3< +OK Capability list follows
Jul 31 01:16:45 example fetchmail[2561]: POP3< TOP
Jul 31 01:16:45 example fetchmail[2561]: POP3< USER
Jul 31 01:16:45 example fetchmail[2561]: POP3< SASL LOGIN PLAIN
Jul 31 01:16:45 example fetchmail[2561]: POP3< .
Jul 31 01:16:45 example fetchmail[2561]: pop3.timeweb.ru: upgrade to TLS succeeded.
Jul 31 01:16:45 example fetchmail[2561]: POP3> USER rinat@example.com
Jul 31 01:16:46 example fetchmail[2561]: POP3< +OK
Jul 31 01:16:46 example fetchmail[2561]: POP3> PASS *
Jul 31 01:16:46 example fetchmail[2561]: POP3< +OK logged in.
Jul 31 01:16:46 example fetchmail[2561]: POP3> STAT
Jul 31 01:16:46 example fetchmail[2561]: POP3< +OK 1 2362
Jul 31 01:16:46 example fetchmail[2561]: POP3> LAST
Jul 31 01:16:46 example fetchmail[2561]: POP3< -ERR Invalid command.
Jul 31 01:16:46 example fetchmail[2561]: Invalid command.
Jul 31 01:16:46 example fetchmail[2561]: POP3> UIDL
Jul 31 01:16:47 example fetchmail[2561]: POP3< +OK
Jul 31 01:16:47 example fetchmail[2561]: POP3< 1 UID5646-1256027415
Jul 31 01:16:47 example fetchmail[2561]: POP3< .
Jul 31 01:16:47 example fetchmail[2561]: 1 message for rinat@example.com at pop3.timeweb.ru (2362 octets).
Jul 31 01:16:47 example fetchmail[2561]: POP3> LIST 1
Jul 31 01:16:47 example fetchmail[2561]: POP3< +OK 1 2362
Jul 31 01:16:47 example fetchmail[2561]: POP3> TOP 1 99999999
Jul 31 01:16:47 example fetchmail[2561]: POP3< +OK headers follow.
Jul 31 01:16:47 example fetchmail[2561]: reading message rinat@example.com@imap.timeweb.ru:1 of 1 (2362 octets)Trying to connect to 127.0.0.1/25...connected.
Jul 31 01:16:48 example postfix/smtpd[10615]: connect from localhost.localdomain[127.0.0.1]
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 220 example.com ESMTP iRedMail (Ubuntu)
Jul 31 01:16:48 example fetchmail[2561]: SMTP> EHLO example.com
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250-example.com
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250-PIPELINING
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250-SIZE 51200000
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250-ETRN
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250-STARTTLS
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250-AUTH PLAIN
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250-AUTH=PLAIN
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250-ENHANCEDSTATUSCODES
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250-8BITMIME
Jul 31 01:16:48 example fetchmail[2561]: SMTP< 250 DSN
Jul 31 01:16:48 example fetchmail[2561]: SMTP> MAIL FROM:<theiosx@gmail.com> SIZE=2362
Jul 31 01:16:49 example fetchmail[2561]: SMTP< 250 2.1.0 Ok
Jul 31 01:16:49 example fetchmail[2561]: SMTP> RCPT TO:<rinat@example.com>
Jul 31 01:16:49 example postfix/trivial-rewrite[10620]: warning: do not list domain example.com in BOTH mydestination and virtual_mailbox_domains
Jul 31 01:16:49 example postfix/smtpd[10615]: C4F393E02E8: client=localhost.localdomain[127.0.0.1]
Jul 31 01:16:49 example fetchmail[2561]: SMTP< 250 2.1.5 Ok
Jul 31 01:16:49 example fetchmail[2561]: SMTP> DATA
Jul 31 01:16:49 example fetchmail[2561]: SMTP< 354 End data with <CR><LF>.<CR><LF>
Jul 31 01:16:49 example fetchmail[2561]: SMTP>. (EOM)
Jul 31 01:16:50 example postfix/cleanup[10621]: C4F393E02E8: message-id=<CA+8xZY-2zy1hkqeDN3Ch7VJ1UOkHcvpj-=zNnuXZC_zEdL98gA@mail.gmail.com>
Jul 31 01:16:50 example fetchmail[2561]: SMTP< 250 2.0.0 Ok: queued as C4F393E02E8
Jul 31 01:16:50 example fetchmail[2561]: flushed
Jul 31 01:16:50 example fetchmail[2561]: POP3> DELE 1
Jul 31 01:16:50 example postfix/qmgr[10251]: C4F393E02E8: from=<theiosx@gmail.com>, size=2710, nrcpt=1 (queue active)
Jul 31 01:16:50 example fetchmail[2561]: POP3< +OK Deleted.
Jul 31 01:16:50 example fetchmail[2561]: POP3> QUIT
Jul 31 01:16:50 example fetchmail[2561]: POP3< +OK Bye-bye.
Jul 31 01:16:50 example fetchmail[2561]: SMTP> QUIT
Jul 31 01:16:50 example postfix/smtpd[10615]: disconnect from localhost.localdomain[127.0.0.1]
Jul 31 01:16:50 example fetchmail[2561]: SMTP< 221 2.0.0 Bye
Jul 31 01:16:50 example fetchmail[2561]: 6.3.21 querying pop3.timeweb.ru (protocol POP3) at Wed Jul 31 01:16:50 2013: poll completed
Jul 31 01:16:50 example fetchmail[2561]: sleeping at Wed Jul 31 01:16:50 2013 for 300 seconds
Jul 31 01:16:51 example postfix/pipe[10622]: C4F393E02E8: to=<rinat@example.com>, relay=autoresponder, delay=2, delays=1.4/0.12/0/0.52, dsn=2.0.0, status=sent (delivered via autoresponder service)
Jul 31 01:16:51 example postfix/qmgr[10251]: C4F393E02E8: removed
Jul 31 01:16:51 example postfix/pickup[10252]: 2EF3A3E02E9: uid=1006 from=<theiosx@gmail.com>
Jul 31 01:16:51 example postfix/cleanup[10621]: 2EF3A3E02E9: message-id=<CA+8xZY-2zy1hkqeDN3Ch7VJ1UOkHcvpj-=zNnuXZC_zEdL98gA@mail.gmail.com>
Jul 31 01:16:51 example postfix/qmgr[10251]: 2EF3A3E02E9: from=<theiosx@gmail.com>, size=2820, nrcpt=1 (queue active)
Jul 31 01:16:51 example postfix/trivial-rewrite[10620]: warning: do not list domain example.com in BOTH mydestination and virtual_mailbox_domains
Jul 31 01:16:51 example postfix/pipe[10631]: 2EF3A3E02E9: to=<rinat@example.com>, relay=dovecot, delay=0.63, delays=0.33/0.01/0/0.29, dsn=5.1.1, status=bounced (user unknown)
Jul 31 01:16:51 example postfix/cleanup[10621]: 8D1033E02E8: message-id=<20130730191651.8D1033E02E8@example.com>
Jul 31 01:16:51 example postfix/qmgr[10251]: 8D1033E02E8: from=<>, size=4451, nrcpt=1 (queue active)
Jul 31 01:16:51 example postfix/bounce[10633]: 2EF3A3E02E9: sender non-delivery notification: 8D1033E02E8
Jul 31 01:16:51 example postfix/qmgr[10251]: 2EF3A3E02E9: removed
Jul 31 01:16:52 example postfix/smtp[10635]: 8D1033E02E8: to=<theiosx@gmail.com>, relay=smtp.timeweb.ru[92.53.117.15]:25, delay=1.4, delays=0.06/0.16/0.96/0.2, dsn=5.0.0, status=bounced (host smtp.timeweb.ru[92.53.117.15] said: 550 Disabled (in reply to RCPT TO command))
Jul 31 01:16:53 example postfix/qmgr[10251]: 8D1033E02E8: removed
In this case I see that rinat@example.com has got the new message and fetchmail download him and forward to postfix. But postfix can't deliver it to dovecot.
Now we're going to look dovecot.log
Jul 31 01:16:48 auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Jul 31 01:16:48 auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libauthdb_ldap.so
Jul 31 01:16:48 auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so
Jul 31 01:16:48 auth: Debug: auth client connected (pid=10615)
Jul 31 01:16:51 auth: Debug: master in: USER 1 rinat@example.com service=lda
Jul 31 01:16:51 auth: Debug: ldap(rinat@example.com): user search: base=o=domains,dc=example,dc=com scope=subtree filter=(&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=lda)(|(mail=rinat@example.com)(&(enabledService=shadowaddress)(shadowAddress=rinat@example.com)))) fields=homeDirectory,mailMessageStore,mailQuota
Jul 31 01:16:51 auth: Info: ldap(rinat@example.com): unknown user
Jul 31 01:16:51 auth: Debug: master out: NOTFOUND 1
I think something wrong in /etc/dovecot/dovecot-ldap.conf
And even suppose something wrong with user_filter
hosts = 127.0.0.1:389
ldap_version = 3
auth_bind = yes
dn = cn=vmail,dc=example,dc=com
dnpass = vmail
base = o=domains,dc=example,dc=com
scope = subtree
deref = never
# Below two are required by command 'doveadm mailbox ...'
iterate_attrs = mail=user
iterate_filter = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail))
user_filter = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))
pass_filter = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))
pass_attrs = userPassword=password
default_pass_scheme = CRYPT
user_attrs = homeDirectory=home,mailMessageStore=mail=maildir:/var/vmail/%$/Maildir/,mailQuota=quota_rule=*:bytes=%$
Weird.
# doveadm mailbox list -u rinat@example.com
Drafts
Archives
Archives.2013
Deleted Messages
Sent
Junk
Sent Messages
Notes
Trash
INBOX
INBOX.Trash
# ldapsearch -v -h 127.0.0.1 -x -W -D "cn=vmail,dc=example,dc=com" -b dc=example,dc=com '(&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=lda)(|(mail=rinat@example.com)(&(enabledService=shadowaddress)(shadowAddress=rinat@example.com))))'
ldap_initialize( ldap://127.0.0.1 )
Enter LDAP Password:
filter: (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=lda)(|(mail=rinat@example.com)(&(enabledService=shadowaddress)(shadowAddress=rinat@example.com))))
requesting: All userApplication attributes
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope subtree
# filter: (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=lda)(|(mail=rinat@example.com)(&(enabledService=shadowaddress)(shadowAddress=rinat@example.com))))
# requesting: ALL
#
# search result
search: 2
result: 0 Success
# numResponses: 1
My configs :
root@example:~# doveconf -n
# 2.0.19: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-23-generic i686 Ubuntu 12.04 LTS
auth_debug = yes
auth_debug_passwords = yes
auth_verbose = yes
dict {
expire = db:/var/lib/dovecot/expire/expire.db
}
disable_plaintext_auth = no
listen = *
log_path = /var/log/dovecot.log
login_greeting = POP3/IMAP server ready.
mail_debug = yes
mail_gid = 1002
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
mail_uid = 1002
passdb {
args = /etc/dovecot/dovecot-ldap.conf
driver = ldap
}
plugin {
auth_default_realm = example.com
auth_socket_path = /var/run/dovecot/auth-master
autocreate = INBOX
autocreate2 = Sent
autocreate3 = Trash
autocreate4 = Drafts
autocreate5 = Junk
autosubscribe = INBOX
autosubscribe2 = Sent
autosubscribe3 = Trash
autosubscribe4 = Drafts
autosubscribe5 = Junk
expire = Trash 7 Trash/* 7 Junk 30
expire_dict = proxy::expire
login_process_per_connection = yes
quota = maildir
quota_rule = *:storage=100M
quota_warning = storage=85%% /usr/local/bin/dovecot-quota-warning.sh 85
quota_warning2 = storage=90%% /usr/local/bin/dovecot-quota-warning.sh 90
quota_warning3 = storage=95%% /usr/local/bin/dovecot-quota-warning.sh 95
sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
sieve_dir = /var/vmail/sieve/%Ld/%Ln/
}
protocols = pop3 imap
service auth {
unix_listener /var/spool/postfix/dovecot-auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-master {
group = vmail
mode = 0666
user = vmail
}
unix_listener auth-userdb {
group = vmail
mode = 0660
user = vmail
}
user = vmail
}
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_key = </etc/ssl/private/dovecot.pem
userdb {
args = /etc/dovecot/dovecot-ldap.conf
driver = ldap
}
protocol imap {
imap_client_workarounds = tb-extra-mailbox-sep
mail_plugins = quota imap_quota zlib
}
protocol pop3 {
mail_plugins = quota zlib
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
log_path = /var/log/sieve.log
mail_plugins = sieve quota autocreate
postmaster_address = root
}
root@example:~# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
append_dot_mydomain = no
autoresponder_destination_recipient_limit = 1
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
delay_warning_time = 0h
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
enable_original_recipient = no
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
local_recipient_maps =
mail_name = iRedMail
mail_version = 0.6.1
mailbox_command = /usr/lib/dovecot/deliver
mailbox_size_limit = 15728640
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
message_size_limit = 51200000
minimal_backoff_time = 300s
mydomain = example.com
myhostname = example.com
mynetworks = 127.0.0.0/8,192.168.10.0/24
mynetworks_style = subnet
myorigin = example.com
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions
queue_directory = /var/spool/postfix
queue_run_delay = 300s
readme_directory = no
recipient_bcc_maps = proxy:ldap:/etc/postfix/ldap_recipient_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap_recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:ldap:/etc/postfix/ldap_relay_domains.cf
relayhost = smtp.timeweb.ru
sender_bcc_maps = proxy:ldap:/etc/postfix/ldap_sender_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap_sender_bcc_maps_user.cf
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/time_passwd
smtp_sasl_security_options =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:7777
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ldap_sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = proxy:ldap:/etc/postfix/ldap_transport_maps_user.cf, proxy:ldap:/etc/postfix/ldap_transport_maps_domain.cf
virtual_alias_maps = proxy:ldap:/etc/postfix/ldap_virtual_alias_maps.cf, proxy:ldap:/etc/postfix/ldap_virtual_group_maps.cf, proxy:ldap:/etc/postfix/ldap_sender_login_maps.cf, proxy:ldap:/etc/postfix/ldap_catch_all_maps.cf hash:/etc/postfix/aliases
virtual_gid_maps = static:1002
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap_virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf
virtual_minimum_uid = 1002
virtual_transport = dovecot
virtual_uid_maps = static:1002
Any idea ?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.