email pop3+imap+smtp

10 posts / 0 new
Last post
#1 Tue, 03/22/2016 - 03:17
kiminox

email pop3+imap+smtp

Hi, I recently installed a virtualmin and added some domain names. I would like to use my server as mail server as well. I installed roundcube to send and receive emails from a client mail. I can send emails (roundcube is configured with php mail) but I cannot receive any email. From the virtualmin interface, I can see that the user account has emails and I can read them from virtualmin interface. And from the log, I can see that roundcube is reading regularly emails : tailf /var/log/maillog :

Mar 22 09:01:40 ns380124 postfix/anvil[32639]: statistics: max connection count 1 for (smtp:223.240.72.193) at Mar 22 08:58:58 Mar 22 09:01:40 ns380124 postfix/anvil[32639]: statistics: max cache size 2 at Mar 22 08:59:59 Mar 22 09:02:29 ns380124 dovecot: imap-login: Login: user=<yoong.dragons-artifacts>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=728, secured, session=<1kR/op4uggB/AAAB> Mar 22 09:02:29 ns380124 dovecot: imap(yoong.dragons-artifacts): Disconnected: Logged out in=50 out=469 Mar 22 09:03:29 ns380124 dovecot: imap-login: Login: user=<yoong.dragons-artifacts>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=862, secured, session=<mqUTpp4ugwB/AAAB> Mar 22 09:03:29 ns380124 dovecot: imap(yoong.dragons-artifacts): Disconnected: Logged out in=50 out=469 Mar 22 09:04:29 ns380124 dovecot: imap-login: Login: user=<yoong.dragons-artifacts>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=911, secured, session=</WGmqZ4uhAB/AAAB> Mar 22 09:04:29 ns380124 dovecot: imap(yoong.dragons-artifacts): Disconnected: Logged out in=50 out=469 Mar 22 09:05:29 ns380124 dovecot: imap-login: Login: user=<yoong.dragons-artifacts>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=1034, secured, session=<VDk6rZ4uhQB/AAAB> Mar 22 09:05:29 ns380124 dovecot: imap(yoong.dragons-artifacts): Disconnected: Logged out in=50 out=469

but still no email in the mailbox roundcube...

Some information : [root@ns380124 ~]# host -a mail.dragons-artifacts.com Trying "mail.dragons-artifacts.com" ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30397 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION: ;mail.dragons-artifacts.com. IN ANY

;; ANSWER SECTION: mail.dragons-artifacts.com. 38400 IN AAAA 2001:41d0:e:408::1 mail.dragons-artifacts.com. 38400 IN A 5.196.71.8

;; AUTHORITY SECTION: dragons-artifacts.com. 38400 IN NS ns380124.ip-5-196-71.eu.

Received 125 bytes from 127.0.0.1#53 in 1 ms

But it seems I cannot use telnet, even using localhost : telnet mail.dragons-artifacts.com 25 Trying 2001:41d0:e:408::1... Connected to mail.dragons-artifacts.com. Escape character is '^]'. Connection closed by foreign host.

telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host.

And netstat -tapnl | grep 443 tcp6 0 0 :::443 :::* LISTEN 7428/httpd tcp6 0 0 5.196.71.8:443 195.46.216.198:53053 TIME_WAIT - tcp6 0 0 5.196.71.8:443 123.152.4.62:58753 TIME_WAIT -

[root@ns380124 ~]# netstat -tapnl | grep 25 tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 32200/master tcp6 0 0 :::25 :::* LISTEN 32200/master

Well, I missed something... Can you give me advices? Tx

Tue, 03/22/2016 - 03:18
kiminox

And last thing : openssl s_client -connect mail.dragons-artifacts.com:25 -crlf CONNECTED(00000003)

write:errno=104

no peer certificate available

No client certificate CA names sent

SSL handshake has read 0 bytes and written 247 bytes

New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE

Expansion: NONE

Tue, 03/22/2016 - 03:44
kiminox

and : [root@ns380124 ~]# lsof -i:25 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME master 32200 root 13u IPv4 22237057 0t0 TCP *:smtp (LISTEN) master 32200 root 14u IPv6 22237058 0t0 TCP *:smtp (LISTEN)

the firewall is stopped as well

Tue, 03/22/2016 - 09:23
andreychek

Howdy,

Hmm, what happens if you restart Postfix, and then look in the email logs. Do you see any errors there?

Also, when you try to telnet to port 25, do you see any errors or related messages in the logs at that point?

-Eric

Wed, 03/23/2016 - 04:25
kiminox

Hi Eric,

After restarting postfix, the log is :
service postfix restart
Redirecting to /bin/systemctl restart postfix.service
tail -50 /var/log/maillog
Mar 23 10:15:15 ns380124 postfix/smtpd[31948]: fatal: no SASL authentication mechanisms
Mar 23 10:15:16 ns380124 postfix/master[30799]: warning: process /usr/libexec/postfix/smtpd pid 31948 exit status 1
Mar 23 10:15:16 ns380124 postfix/master[30799]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Mar 23 10:16:17 ns380124 postfix/smtpd[31999]: connect from ns364658.ip-91-121-210.eu[91.121.210.57]
Mar 23 10:16:17 ns380124 postfix/smtpd[31999]: warning: SASL: Connect to private/auth failed: No such file or directory
Mar 23 10:16:17 ns380124 postfix/smtpd[31999]: fatal: no SASL authentication mechanisms
Mar 23 10:16:18 ns380124 postfix/master[30799]: warning: process /usr/libexec/postfix/smtpd pid 31999 exit status 1
Mar 23 10:16:18 ns380124 postfix/master[30799]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Mar 23 10:17:58 ns380124 postfix/anvil[31950]: statistics: max connection rate 1/60s for (smtp:198.2.129.139) at Mar 23 10:15:15
Mar 23 10:17:58 ns380124 postfix/anvil[31950]: statistics: max connection count 1 for (smtp:198.2.129.139) at Mar 23 10:15:15
Mar 23 10:17:58 ns380124 postfix/anvil[31950]: statistics: max cache size 1 at Mar 23 10:15:15
Mar 23 10:19:35 ns380124 postfix/smtpd[32278]: connect from nm1.bullet.mail.ir2.yahoo.com[212.82.96.32]
Mar 23 10:19:35 ns380124 postfix/smtpd[32278]: warning: SASL: Connect to private/auth failed: No such file or directory
Mar 23 10:19:35 ns380124 postfix/smtpd[32278]: fatal: no SASL authentication mechanisms
Mar 23 10:19:36 ns380124 postfix/master[30799]: warning: process /usr/libexec/postfix/smtpd pid 32278 exit status 1
Mar 23 10:19:36 ns380124 postfix/master[30799]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Mar 23 10:21:16 ns380124 postfix/anvil[32280]: statistics: max connection rate 1/60s for (smtp:212.82.96.32) at Mar 23 10:19:35
Mar 23 10:21:16 ns380124 postfix/anvil[32280]: statistics: max connection count 1 for (smtp:212.82.96.32) at Mar 23 10:19:35
Mar 23 10:21:16 ns380124 postfix/anvil[32280]: statistics: max cache size 1 at Mar 23 10:19:35
Mar 23 10:22:08 ns380124 postfix/postfix-script[32651]: stopping the Postfix mail system
Mar 23 10:22:08 ns380124 postfix/master[30799]: terminating on signal 15
Mar 23 10:22:09 ns380124 postfix/postfix-script[32732]: starting the Postfix mail system
Mar 23 10:22:09 ns380124 postfix/master[32734]: daemon started -- version 2.10.1, configuration /etc/postfix

Problem 1 : fatal: no SASL authentication mechanisms

dovecot -n
# 2.2.10: /etc/dovecot/dovecot.conf
# OS: Linux 3.14.32-xxxx-grs-ipv6-64 x86_64
auth_mechanisms = plain login
disable_plaintext_auth = no
mail_location = maildir:~/Maildir:INDEX=/var/lib/dovecot-virtualmin/index/%u:CONTROL=/var/lib/dovecot-virtualmin/control/%u
mbox_write_locks = fcntl
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
driver = pam
}
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
protocols = imap pop3
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
}
ssl = required
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem
userdb {
driver = passwd
}

postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_percent_hack = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, ns380124.ip-5-196-71.eu
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sender_bcc_maps = hash:/etc/postfix/bcc
sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

But there is no /var/spool/postfix/private/auth :
ls -al /var/spool/postfix/private/auth
ls: cannot access /var/spool/postfix/private/auth: No such file or directory

What is the problem?

Wed, 03/23/2016 - 04:54
kiminox

[root@ns364658 ~]# openssl s_client -connect smtp.domain.com:993
CONNECTED(00000003)
depth=0 OU = IMAP server, CN = imap.example.com, emailAddress = postmaster@example.com
verify error:num=18:self signed certificate
verify return:1
depth=0 OU = IMAP server, CN = imap.example.com, emailAddress = postmaster@example.com
verify return:1
---
Certificate chain
0 s:/OU=IMAP server/CN=imap.example.com/emailAddress=postmaster@example.com
i:/OU=IMAP server/CN=imap.example.com/emailAddress=postmaster@example.com
---
Server certificate
-----BEGIN CERTIFICATE-----
MIICQzCCAaygAwIBAgIJANmkP9V9nQboMA0GCSqGSIb3DQEBBQUAMFgxFDASBgNV
BAsTC0lNQVAgc2VydmVyMRkwFwYDVQQDExBpbWFwLmV4YW1wbGUuY29tMSUwIwYJ
KoZIhvcNAQkBFhZwb3N0bWFzdGVyQGV4YW1wbGUuY29tMB4XDTE2MDIxNDE4MTc0
NVoXDTE3MDIxMzE4MTc0NVowWDEUMBIGA1UECxMLSU1BUCBzZXJ2ZXIxGTAXBgNV
BAMTEGltYXAuZXhhbXBsZS5jb20xJTAjBgkqhkiG9w0BCQEWFnBvc3RtYXN0ZXJA
ZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM2Us88o+XE/
sMtwlmPL34ksxk9jo7uYfwE4kTPIlwYdflQogXXCODSnRYNJICRvOIvEuTYGpuzx
QwV/FVupvOyDQ16Gw8QPTHBRTNuAK45YSZ824N2nhjCpQfg2Bgf8k8YquZQqy1SQ
phcR0QMZHt5eP9FGYe3au9Iu7FkDM1GRAgMBAAGjFTATMBEGCWCGSAGG+EIBAQQE
AwIGQDANBgkqhkiG9w0BAQUFAAOBgQB9f/gI2CldyABetgEJI7JMD12lIaoxS9S3
FjpxF5p+E2BcRvpTK8oDC4a2mdYE5C24fy65xVXpbp0k34KwR8c82BgFgPN8Hfw8
xTeTJ0ySyJfi5TlSJIyQUB21SRT6gncnQFfav30rUYArACzwS5Vp2c2sxP12rBf9
+9A/d756nQ==
-----END CERTIFICATE-----
subject=/OU=IMAP server/CN=imap.example.com/emailAddress=postmaster@example.com
issuer=/OU=IMAP server/CN=imap.example.com/emailAddress=postmaster@example.com
---
No client certificate CA names sent
Server Temp Key: ECDH, secp384r1, 384 bits
---
SSL handshake has read 1146 bytes and written 405 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 1024 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384
Session-ID: CCED2DC8403B82B91A2347630402A658116F3637443D4FD5FD5ACD8207B5803C
Session-ID-ctx:
Master-Key: 8293FAB39EA4CCEA3BC896A55AA398DB63AEE5898987785A7B313D707486A60AA36D029CFEAFC1D0905685EAF6E006ED
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
TLS session ticket lifetime hint: 300 (seconds)
TLS session ticket:
0000 - 42 7d 34 e1 0d a1 72 ec-6b 64 11 6c 16 0f 72 3c B}4...r.kd.l..r<
0010 - 53 14 9c 49 b4 ef e1 fa-5a ed fc 01 5d 05 44 8c S..I....Z...].D.
0020 - 64 56 e7 f2 dd 81 19 2a-8e ca 1f 05 0b ae 68 be dV.....*......h.
0030 - e1 07 01 95 a1 f7 4b 64-99 17 04 77 38 ff 45 30 ......Kd...w8.E0
0040 - f4 0b 59 bf 76 e5 39 a4-40 c8 48 b2 17 ac 73 4e ..Y.v.9.@.H...sN
0050 - a7 3b 2f 3c 95 ed 68 a3-68 3d ea d9 93 d3 72 3d .;/<..h.h=....r=
0060 - 3d 89 b8 aa 78 45 8f 5b-35 7b e8 25 22 37 bb 30 =...xE.[5{.%"7.0
0070 - c2 00 36 e9 a5 8a c3 f1-9c 88 9e 42 5f 2d 4a 00 ..6........B_-J.
0080 - 0f 28 00 05 b4 88 7f 4b-8e 68 8e db a8 a0 55 98 .(.....K.h....U.
0090 - a4 77 50 da 68 ab ab 0b-92 dc 57 fa b8 4f 8b e3 .wP.h.....W..O..

Start Time: 1458726798
Timeout : 300 (sec)
Verify return code: 18 (self signed certificate)
---
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.

Wed, 03/23/2016 - 05:00
kiminox

telnet domain.com 143
Trying X.XX.X.X...
Connected to domain.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED] Dovecot ready.
login "user" "xxxxx"
login BAD First parameter in line is IMAP's command tag, not the command name. Add that before the command, like: a login user pass
a1 login "user" "xxxxx"
* BAD [ALERT] Plaintext authentication not allowed without SSL/TLS, but your client did it anyway. If anyone was listening, the password was exposed.
a1 NO [PRIVACYREQUIRED] Plaintext authentication disallowed on non-secure (SSL/TLS) connections.
a2 LIST "" "*"
a2 BAD Error in IMAP command received by server.
a3 EXAMINE INBOX
a3 BAD Error in IMAP command received by server.

Wed, 03/23/2016 - 05:01
kiminox

telnet domains.com 110
Trying x.x.x.x...
Connected to domain.com.
Escape character is '^]'.
+OK Dovecot ready.
quit
+OK Logging out
Connection closed by foreign host.

Wed, 03/23/2016 - 05:02
kiminox

openssl s_client -connect domain.com:995 -quiet
depth=0 OU = IMAP server, CN = imap.example.com, emailAddress = postmaster@example.com
verify error:num=18:self signed certificate
verify return:1
depth=0 OU = IMAP server, CN = imap.example.com, emailAddress = postmaster@example.com
verify return:1
+OK Dovecot ready.
quit

Wed, 03/23/2016 - 05:05
kiminox

but :
telnet domain.com 25
Trying x.x.x.x...
Connected to domain.com.
Escape character is '^]'.
Connection closed by foreign host.

Close immedialty...
What's wrong? I am stuck!

Topic locked