LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-30-2013, 12:24 PM   #1
Sebi94
Member
 
Registered: Jun 2012
Posts: 34

Rep: Reputation: Disabled
Question IMAP server dovecot isn't reachable


Hello community!

I've set up an whole eMail server.

Used software: postfix dovecot-imapd dovecot-pop3d policyd-weight

I can send an eMail from my smartphone with a email address of this eMail server, but I can't receive eMails over my IMAP server. I'm always getting the error, that I can't reach the IMAP server.

Can somebody tell me, what've done wrong?

I want to be able to send eMails to every possible eMail address and receive from every possible eMail address (but no spam!).

Following my /etc/postfix/main.cfg:
Quote:
# all information mail goes to postmaster
soft_bounce = no

# tell the postmaster about mail problems
# notify_classes = resource, software, bounce, policy
notify_classes = resource, software, policy

# zum Testen Code 450 (sp?ter erneut versuchen) einstellen
# wenn alles getestet, dann umstellen auf Code 550 (ablehnen)
# unknown_local_recipient_reject_code = 550
unknown_local_recipient_reject_code = 450

# Queue directory and chroot
queue_directory = /var/spool/postfix

# Location of the post* commands
command_directory = /usr/sbin

# Privileges
mail_owner = postfix

# FQDN of the mailserver
myhostname=kraetzig.org

# Domain to serve
mydomain=kraetzig.org

# Aliases für die Systembenutzer
alias_maps = hash:/etc/aliases

# Domain to masquerade as
myorigin = /etc/mailname

# ip addresses to listen on
inet_interfaces = all

# Names to receive email for
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

# ip addresses to relay emails for
mynetworks = 127.0.0.0/8

# show mailserver name for all
smtpd_banner = $myhostname ESMTP Mailserver

# tell the postmaster about mail problems
notify_classes = resource, software, policy

# IF a relayhost is used for the connection
# to the internet
# relayhost=[$mail.myprovider]

# how to restrict the delivery of the email
smtpd_recipient_restrictions = permit_mynetworks, reject_unknown_recipient_domain, permit_sasl_authenticated, reject_unauth_destination, check_policy_service inet:127.0.0.1:12525
smtpd_sender_restrictions = reject_unknown_address
strict_rfc821_envelopes = yes
home_mailbox = mails/

# TLS (Zertifikat)
smtpd_tls_cert_file = /etc/postfix/mail.cert
smtpd_tls_key_file = /etc/postfix/mail.key
smtpd_use_tls = yes
smtpd_tls_auth_only = yes

# SASL (Authentifizierung)
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
smtp_sasl_auth_enable = no
broken_sasl_auth_clients = yes

# Virtual Domains (Mehrere Domains hosten)
virtual_alias_domains = mk-trockenbau.biz
virtual_alias_maps = hash:/etc/postfix/virtual_domains
virtual_mailbox_limit = 0

# Mailbox Size Limit: Unbegrenzt = 0
mailbox_size_limit = 0
message_size_limit = 0
And my /etc/dovecot/dovecot.conf:
Quote:
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-0.bpo.4-686-pae i686 Debian 6.0.7

# Verfuegbare Protokolle
protocols = imap imaps pop3s

# Datumsformat im Logfile
log_timestamp = "%Y-%m-%d %H:%M:%S "

# Gruppe fuer Mail-User
mail_privileged_group = postfix

# Speicher und Resourcen beim Kopieren sparen
maildir_copy_with_hardlinks = yes

# POP3 Settings
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
}

# IMAP Settings
protocol imap {
}

# Auth Settings
auth default {
mechanisms = plain
userdb passwd {
}
passdb pam {
}
user = root
}


# Zertifikate
ssl_cert = /etc/ssl/certs/dovecot.pem
ssl_key = /etc/ssl/private/dovecot.pem

# Nur verschlüsselte Verbindung
disable_plaintext_auth = yes

# Mail-Location: Home-Directory/mails
mail_location = maildir:%h/mails
I've one MX10 Record: mail.kraetzig.org mx 10 60 s DNS-Trace sueffig.kraetzig.org

Client settings for IMAP
Hostname sueffig.kraetzig.org
SSL activated
Authentification via Password
Port 993

My SMTP server does work fine:
Hostname sueffig.kraetzig.org
SSL activated
Authentification via Password
Port 25

I hope, somebody can help me. Thanks forwarding!

Last edited by Sebi94; 05-30-2013 at 12:25 PM.
 
Old 05-31-2013, 12:28 AM   #2
Leo-G
Member
 
Registered: May 2013
Distribution: Cent OS 6
Posts: 32

Rep: Reputation: Disabled
Can you post telnet results from your phone to your server on port 143?

From your coonection error it seems to be a network issue?

Can you check if any logs are generated when you connect to the server? If no dovecot logs means the connection is not made n there could be sme network issue in which case check firewall else post the logs here
 
Old 05-31-2013, 03:20 AM   #3
Sebi94
Member
 
Registered: Jun 2012
Posts: 34

Original Poster
Rep: Reputation: Disabled
Hello Leo-G!
Quote:
Originally Posted by Leo-G View Post
Can you post telnet results from your phone to your server on port 143?
No, I can't. How should that go?

But I logged me on a Linux machine from my work (other location and ip address) in and entered following:
Quote:
$ telnet sueffig.kraetzig.org 143
Trying 87.149.18.110...
Connected to sueffig.kraetzig.org.
Escape character is '^]'.
Connection closed by foreign host.

$ telnet kraetzig.org 143
Trying 87.149.18.110...
Connected to kraetzig.org.
Escape character is '^]'.
Connection closed by foreign host.

$ telnet mail.kraetzig.org 143
telnet: could not resolve mail.kraetzig.org/143: No address associated with hostname
Quote:
Originally Posted by Leo-G View Post
From your coonection error it seems to be a network issue?

Can you check if any logs are generated when you connect to the server? If no dovecot logs means the connection is not made n there could be sme network issue in which case check firewall else post the logs here
I can't find any logfile for dovecot or postfix. I've a port forwarding rule from the router to the server. A real "firewall" isn't available.

Following you can see, that the ports are open:
Quote:
$ sudo netstat -tulpen | grep LISTEN
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 0 1320297 20694/master
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 104 1177994 28702/mysqld
tcp 0 0 127.0.0.1:12525 0.0.0.0:* LISTEN 0 1197792 2160/policyd-weight
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 0 1349087 24950/dovecot
tcp 0 0 0.0.0.0:2223 0.0.0.0:* LISTEN 0 1346013 23984/sshd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 4879 1032/portmap
tcp 0 0 0.0.0.0:30033 0.0.0.0:* LISTEN 1002 1073096 12775/ts3server_lin
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 107 1050515 9790/proftpd: (acce
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 0 1339007 1466/cupsd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 0 1320200 20694/master
tcp 0 0 0.0.0.0:10011 0.0.0.0:* LISTEN 1002 1073441 12775/ts3server_lin
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 0 1349089 24950/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 0 1349065 24950/dovecot
tcp6 0 0 :::139 :::* LISTEN 0 5345 1521/smbd
tcp6 0 0 :::143 :::* LISTEN 0 1349088 24950/dovecot
tcp6 0 0 :::2223 :::* LISTEN 0 1346015 23984/sshd
tcp6 0 0 :::80 :::* LISTEN 0 1259331 12136/apache2
tcp6 0 0 ::1:631 :::* LISTEN 0 1339006 1466/cupsd
tcp6 0 0 :::25 :::* LISTEN 0 1320202 20694/master
tcp6 0 0 :::443 :::* LISTEN 0 1259335 12136/apache2
tcp6 0 0 :::25565 :::* LISTEN 1001 446763 18558/java
tcp6 0 0 :::445 :::* LISTEN 0 5343 1521/smbd
tcp6 0 0 :::993 :::* LISTEN 0 1349090 24950/dovecot
tcp6 0 0 :::995 :::* LISTEN 0 1349066 24950/dovecot

Last edited by Sebi94; 05-31-2013 at 03:22 AM.
 
Old 05-31-2013, 12:37 PM   #4
Leo-G
Member
 
Registered: May 2013
Distribution: Cent OS 6
Posts: 32

Rep: Reputation: Disabled
Don't tell me that you are using mail.kraetzig.org 143 as your server name in your phone?

If you are using android there is an APP called fing.
 
Old 05-31-2013, 01:36 PM   #5
Sebi94
Member
 
Registered: Jun 2012
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Leo-G View Post
Don't tell me that you are using mail.kraetzig.org 143 as your server name in your phone?

If you are using android there is an APP called fing.
Currently, I've set "sueffig.kraetzig.org" as IMAP-Server on Port 993 (with SSL).

No, I'm using a Apple iPhone 4S.

What's the problem now?

I can't understand it...
 
Old 05-31-2013, 02:41 PM   #6
Leo-G
Member
 
Registered: May 2013
Distribution: Cent OS 6
Posts: 32

Rep: Reputation: Disabled
Use Mocha Telnet Lite and post your telnet results on port 993 to sueffig.kraetzig.org from your iphone?

Have you tried with SSL disabled on port 143?

Configure an email client on your local machine and check whether you are able to connect on port 143 as well as 993

How can you not have log files?

Read the below wiki n post your logs

http://wiki2.dovecot.org/Logging

Also if I have a test id/pass to check it would be better, you can pm me the details
 
Old 05-31-2013, 04:56 PM   #7
Sebi94
Member
 
Registered: Jun 2012
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Leo-G View Post
Use Mocha Telnet Lite and post your telnet results on port 993 to sueffig.kraetzig.org from your iphone?
"Connection closed by host."

Quote:
Originally Posted by Leo-G View Post
Have you tried with SSL disabled on port 143?

Configure an email client on your local machine and check whether you are able to connect on port 143 as well as 993
Same result... Server isn't reachable.

Quote:
Originally Posted by Leo-G View Post
How can you not have log files?

Read the below wiki n post your logs

http://wiki2.dovecot.org/Logging
I've configured the /etc/dovecot/conf.d/10-loggin.conf, but it doesn't work. I've reloaded and restartet dovecot...
Quote:
$ doveadm log find
Looking for log files from /var/log
Debug: Not found
Info: Not found
Warning: Not found
Error: Not found
Fatal: Not found
Code:
$ cat 10-logging.conf
##
## Log destination.
##

# Log file to use for error messages. "syslog" logs to syslog,
# /dev/stderr logs to stderr.
log_path = /var/log/dovecot.log

# Log file to use for informational messages. Defaults to log_path.
info_log_path = /var/log/dovecot-info.log
# Log file to use for debug messages. Defaults to info_log_path.
debug_log_path = /var/log/dovecot-debug.log

# Syslog facility to use if you're logging to syslog. Usually if you don't
# want to use "mail", you'll use local0..local7. Also other standard
# facilities are supported.
#syslog_facility = mail

##
## Logging verbosity and debugging.
##

# Log unsuccessful authentication attempts and the reasons why they failed.
#auth_verbose = no

# In case of password mismatches, log the attempted password. Valid values are
# no, plain and sha1. sha1 can be useful for detecting brute force password
# attempts vs. user simply trying the same password over and over again.
#auth_verbose_passwords = no

# Even more verbose logging for debugging purposes. Shows for example SQL
# queries.
#auth_debug = no

# In case of password mismatches, log the passwords and used scheme so the
# problem can be debugged. Enabling this also enables auth_debug.
#auth_debug_passwords = no

# Enable mail process debugging. This can help you figure out why Dovecot
# isn't finding your mails.
#mail_debug = no

# Show protocol level SSL errors.
#verbose_ssl = no

# mail_log plugin provides more event logging for mail processes.
plugin {
  # Events to log. Also available: flag_change append
  #mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
  # Available fields: uid, box, msgid, from, subject, size, vsize, flags
  # size and vsize are available only for expunge and copy events.
  #mail_log_fields = uid box msgid size
}

##
## Log formatting.
##

# Prefix for each line written to log file. % codes are in strftime(3)
# format.
#log_timestamp = "%b %d %H:%M:%S "

# Space-separated list of elements we want to log. The elements which have
# a non-empty variable value are joined together to form a comma-separated
# string.
#login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c

# Login log format. %$ contains login_log_format_elements string, %s contains
# the data we want to log.
#login_log_format = %$: %s

# Log prefix for mail processes. See doc/wiki/Variables.txt for list of
# possible variables you can use.
#mail_log_prefix = "%s(%u): "

# Format to use for logging mail deliveries. You can use variables:
#  %$ - Delivery status message (e.g. "saved to INBOX")
#  %m - Message-ID
#  %s - Subject
#  %f - From address
#  %p - Physical size
#  %w - Virtual size
#deliver_log_format = msgid=%m: %$
I've resetted my dovecot.conf with the command "dovecot -n > dovecot-new.conf". I've taken the default configuration file.

After testing the openssl, I've found an new error. Maybe it's the only error? I just need an solution for it.
Quote:
$ openssl s_client -prexit -state -debug -connect sueffig.kraetzig.org:imaps
CONNECTED(00000003)
SSL_connect:before/connect initialization
write to 0x8b81470 [0x8b81f30] (121 bytes => 121 (0x79))
0000 - 80 77 01 03 01 00 4e 00-00 00 20 00 00 39 00 00 .w....N... ..9..
0010 - 38 00 00 35 00 00 16 00-00 13 00 00 0a 07 00 c0 8..5............
0020 - 00 00 33 00 00 32 00 00-2f 03 00 80 00 00 05 00 ..3..2../.......
0030 - 00 04 01 00 80 00 00 15-00 00 12 00 00 09 06 00 ................
0040 - 40 00 00 14 00 00 11 00-00 08 00 00 06 04 00 80 @...............
0050 - 00 00 03 02 00 80 00 00-ff 68 32 42 ff 26 af a4 .........h2B.&..
0060 - 25 db e1 36 1b b0 aa 8b-41 2d 9f d2 f3 31 44 47 %..6....A-...1DG
0070 - 5b 2f fa 36 84 26 1c 32-f4 [/.6.&.2.
SSL_connect:SSLv2/v3 write client hello A
read from 0x8b81470 [0x8b87490] (7 bytes => -1 (0xFFFFFFFF))
SSL_connect:error in SSLv2/v3 read server hello A
write:errno=104

---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 121 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
 
  


Reply

Tags
dovecot, mailserver, postfix



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dovecot, postfix pop3/imap server issue konduktorn Linux - Server 3 02-19-2010 04:41 PM
Dovecot download pop3/imap from other server(s) alitrix Linux - Software 3 05-23-2008 07:49 PM
dovecot imap server & clamav paul_mat Linux - Networking 0 01-09-2006 09:43 PM
how to configure the dovecot IMAP server happyskyzl Linux - Software 11 11-07-2004 09:24 PM
how to configure the dovecot IMAP server happyskyzl Linux - Networking 2 09-20-2004 02:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration