C6.7 Evolution To Cyrus Imap(s) Fails

Home » CentOS » C6.7 Evolution To Cyrus Imap(s) Fails
CentOS 17 Comments

Am 11.08.2015 um 17:56 schrieb Dr J Austin:

What does cyrus-imapd log?

Alexander

17 thoughts on - C6.7 Evolution To Cyrus Imap(s) Fails

  • ———— Original Message ————
    A “connection refused” response generally means that the daemon isn’t allowing the connection (isn’t listening or is configured to reject), rather than something with the handshake protocol. So, mucking with your clients’ encryption/authentication settings probably won’t do anything.

    You might also want to use netstat to confirm what’s listening as your imapd and to confirm that it’s listening on the external interface (not just localhost). Something like:

    netstat -pln | egrep ‘:993|:143’

    as root, should get the interesting bits.

    Also, you might want to check to see if the cyrus config files were touched with the update (look also for rpmnew and rpmold cyrus config files).

  • Am 11.08.2015 um 21:47 schrieb Dr J Austin:

    /var/log/maillog is the default log file for the MAIL facility. Else check your syslog() daemon configuration.

    Alexander

  • Hi Alexander

    [root@maui:/var/log]$ watch ‘tail -n40 maillog

    does not quiver when I try to connect In coming mail can be seen but nothing about evo connections as far as I
    can see

    There do seem to be some warnings/errors – they don’t look relavant??

    Many thanks for your help

    John

    Aug 11 21:17:29 maui lmtpunix[10038]: duplicate_check:
    <2601564684-JVVYITYRHUOROMKSRSWVQKEO@mzdrthfhs35.com-internet.us> user.ja
    0
    Aug 11 21:17:29 maui lmtpunix[10038]: duplicate_check:
    <2601564684-JVVYITYRHUOROMKSRSWVQKEO@mzdrthfhs35.com-internet.us> user.ja
    0
    Aug 11 21:17:29 maui lmtpunix[10038]: Delivered:
    <2601564684-JVVYITYRHUOROMKSRSWVQKEO@mzdrthfhs35.com-internet.us> to mailbox: user.ja Aug 11 21:17:29 maui lmtpunix[10038]: mystore: starting txn 2147483715
    Aug 11 21:17:29 maui lmtpunix[10038]: mystore: committing txn 2147483715
    Aug 11 21:17:29 maui lmtpunix[10038]: duplicate_mark:
    <2601564684-JVVYITYRHUOROMKSRSWVQKEO@mzdrthfhs35.com-internet.us> user.ja
    1439324249 441771
    Aug 11 21:17:29 maui lmtpunix[10048]: executed Aug 11 21:17:43 maui lmtpunix[10038]: accepted connection Aug 11 21:17:43 maui lmtpunix[10038]: lmtp connection preauth’d as postman Aug 11 21:17:43 maui lmtpunix[10038]: IOERROR: fstating sieve script
    /var/lib/imap/sieve/j/ja/defaultbc: No such file or directory Aug 11 21:17:43 maui lmtpunix[10038]: duplicate_check:

    user.ja 0
    Aug 11 21:17:43 maui lmtpunix[10038]: duplicate_check:

    user.ja 0
    Aug 11 21:17:43 maui lmtpunix[10038]: Delivered:
    to mailbox: user.ja Aug 11 21:17:43 maui lmtpunix[10038]: mystore: starting txn 2147483717
    Aug 11 21:17:43 maui lmtpunix[10038]: mystore: committing txn 2147483717
    Aug 11 21:17:43 maui lmtpunix[10038]: duplicate_mark:

    user.ja 1439324263 441772
    Aug 11 21:18:08 maui lmtpunix[10048]: accepted connection Aug 11 21:18:08 maui lmtpunix[10048]: lmtp connection preauth’d as postman Aug 11 21:18:08 maui lmtpunix[10048]: IOERROR: fstating sieve script
    /var/lib/imap/sieve/j/ja/defaultbc: No such file or directory Aug 11 21:18:08 maui lmtpunix[10048]: duplicate_check:
    <55CA5873.7090007@htt-consult.com> user.ja 0
    Aug 11 21:18:08 maui lmtpunix[10048]: duplicate_check:
    <55CA5873.7090007@htt-consult.com> user.ja 0
    Aug 11 21:18:08 maui lmtpunix[10048]: Delivered:
    <55CA5873.7090007@htt-consult.com> to mailbox: user.ja Aug 11 21:18:08 maui lmtpunix[10048]: mystore: starting txn 2147483718
    Aug 11 21:18:08 maui lmtpunix[10048]: mystore: committing txn 2147483718
    Aug 11 21:18:08 maui lmtpunix[10048]: duplicate_mark:
    <55CA5873.7090007@htt-consult.com> user.ja 1439324288
    441773
    Aug 11 21:19:03 maui master[2515]: process 10038 exited, status 0
    Aug 11 21:19:13 maui master[2515]: process 10048 exited, status 0
    Aug 11 21:19:13 maui master[10160]: about to exec
    /usr/lib/cyrus-imapd/lmtpd Aug 11 21:19:13 maui lmtpunix[10160]: executed

  • Am 11.08.2015 um 22:28 schrieb Dr J Austin:

    That’s suspicious.

    Let’s exclude it is the client which causes the problem: Connect directly to the IMAPS server on CLI.

    openssl s_client -connect :993

    You hopefully see a greeting message from the IMAP server. Then issue

    a1 LOGIN username password

    If you see a success message that you logged in, then everything is fine with your cyrus-imapd.

    Logout by entering

    a2 LOGOUT

    If you got that far, the troublemaker is Evolution. Can’t help you with that one as I am not using it. Validate all the account settings to be valid.

    Right, irrelevant for your isse.

    Cyrus-IMAPd tries to execute the default sieve but there is no sieve filter defined for the mailbox. You can ignore that or just configure your syslog to not log these debug messages.

    Same as above.

    So far just activity of the LMTP processes to deliver mail into the mailbox.

    Processes get terminated. That’s fine.

    You really should see your user login in this log file.

    Alexander

  • Hmmm

    Summary On the server maui itself Failure when using IP address but works with name maui for root and fred

    On a separate machine paxos Failure for both IP address and name maui and maui.jaa.org.uk for both root and ja

    However the error messages are different between maui and paxos

    John

    ———————————————————————–

  • A little more info about using s_client on paxos to connect to maui

    openssl s_client -connect maui.jaa.org.uk:993

    Wireshark shows just one packet each way (to/from port 993)
    A request for connection from paxos to maui and a reset from maui to paxos

    [Expert Info (Chat/sequence): Connection establish request (SYN): server port 993]

    [Severity level: Chat]
    [Group: sequence]

    (RST, ACK)
    [Expert Info (Warn/sequence): Connection reset (RST]
    [Connection reset (RST)]
    [Severity level: Warn]
    [Group: Sequence]

    John

  • I don’t think that wireshark adds much to this. Unless you had a proxy in the middle, the “connection refused” responses already indicated that your connections were getting to the/a server, it’s just refusing the connections.

    Connections by name, especially short forms, are suspect unless you can be very certain of how they are being resolved (i.e., what IPnumber you end up trying to connect to). There is no reason that using root to connect to port 993 would work when a normal user doesn’t. An IMAP server either accepts the initial connection from a machine or not – it doesn’t know or care what type of user is originating the connection.

    You may want to look into what you were able to connect to via:

    openssl s_client -connect maui:993

    I’d start by looking up what “maui” resolves to.

    I just looked up maui.jaa.org.uk. It (currently) resolves to
    213.152.52.233, not the 148.197 you seemed to be using above. I
    realize you may have some form of dynamic dns going here, but thought I’d mention it.

    Could you try (as root) two slightly different version of my earlier netstat commands:

    netstat -pnlA inet | egrep ‘:993|:143’

    netstat -pnlA inet6 | egrep ‘:993|:143’

    the addition of “A inet/inet6” will show whether it is listening via ipv4 (inet) or ipv6 (inet6) on the imap ports.

  • I know I’m late to this thread, but a useful tool for testing your Cyrus IMAP service is the ‘imtest’ command, which is in the cyrus-imapd-utils package.

    imtest -v -s

    (I used to manage a cyrus murder, a long time ago, and imtest is a great tool for debugging)

    However, your issue sounds more like a network-level problem than a IMAPd problem.

  • Hi Richard

    I have been working at trying to get cyrus to listen on 148.197.29.5
    interface instead of the localhost – I have failed

    Whenever I add things to /etc/cyrus.conf such as imaps cmd=”imapd -s” listen=”[148.197.29.5]:imaps” prefork=1

    [root@maui:~]$ service cyrus-imapd restart

    [root@maui:~]$ ps -ef|grep cyr cyrus 22187 1 0 13:26 ? 00:00:00 idled cyrus 28044 1 0 13:54 ? 00:00:00
    /usr/lib/cyrus-imapd/cyrus-master -d cyrus 28048 1 0 13:54 ? 00:00:00 idled cyrus 28050 28044 0 13:54 ? 00:00:00 imapd cyrus 28051 28044 0 13:54 ? 00:00:00 pop3d cyrus 28052 28044 0 13:54 ? 00:00:00 pop3d -s cyrus 28053 28044 0 13:54 ? 00:00:00 lmtpd -a cyrus 28054 28044 0 13:54 ? 00:00:00 imapd cyrus 28055 28044 0 13:54 ? 00:00:00 pop3d cyrus 28058 28044 0 13:54 ? 00:00:00 imapd cyrus 28059 28044 0 13:54 ? 00:00:00 imapd cyrus 28060 28044 0 13:54 ? 00:00:00 imapd cyrus 28061 28044 1 13:54 ? 00:00:00 pop3d root 28063 11348 0 13:54 pts/2 00:00:00 grep cyr

    Then no “imapd -s” appears

    I have tried all sorts of combinations in cyrus.conf but all fail to LISTEN on 148.197.29.5

    I have tried taking maui out of /etc/hosts

    My IP addresses are a bit odd – but I have been using 148.197.29.0/24 for so long, … They have never escaped as far as I know!
    client machine ja@paxos ~ 1$ host 148.197.29.5
    5.29.197.148.in-addr.arpa domain name pointer maui.jaa.org.uk. ja@paxos ~ 2$ host maui maui.jaa.org.uk has address 148.197.29.5

    server machine
    [root@maui:/etc/pki/cyrus-imapd]$ host maui maui.jaa.org.uk has address 148.197.29.5
    ———————————————————————

  • Am 12.08.2015 um 15:16 schrieb Dr J Austin:

    No square brackets around the ip address.

    Make sure the IP address 148.197.29.5 is definitely up on any of the system’s devices. Verify running “ip address list”.

    [ … ]

    I am sure it is because that IP address isn’t bound to any device.

    Alexander

  • imap cmd=”imapd” listen=”imap” prefork=5
    # imaps cmd=”imapd -s” listen=”imaps” prefork=1
    imaps cmd=”imapd -s” listen=”148.197.29.5:imaps” prefork=1
    pop3 cmd=”pop3d” listen=”pop3″ prefork=3

    [root@maui:/var/log]$ gedit /etc/cyrus.conf
    [root@maui:/var/log]$ service cyrus-imapd stop Shutting down cyrus-imapd: [ OK ]
    Exporting cyrus-imapd databases: [ OK ]
    [root@maui:/var/log]$ service cyrus-imapd start Importing cyrus-imapd databases: [ OK ]
    Starting cyrus-imapd: [ OK ]
    [root@maui:/var/log]$ ps -ef|grep cyrus cyrus 31699 1 0 19:13 ? 00:00:00
    /usr/lib/cyrus-imapd/cyrus-master -d cyrus 31703 1 0 19:13 ? 00:00:00 idled cyrus 31705 31699 0 19:13 ? 00:00:00 imapd cyrus 31706 31699 0 19:13 ? 00:00:00 pop3d cyrus 31707 31699 0 19:13 ? 00:00:00 pop3d -s cyrus 31708 31699 0 19:13 ? 00:00:00 lmtpd -a cyrus 31709 31699 0 19:13 ? 00:00:00 imapd cyrus 31710 31699 0 19:13 ? 00:00:00 pop3d cyrus 31712 31699 0 19:13 ? 00:00:00 imapd cyrus 31713 31699 0 19:13 ? 00:00:00 imapd cyrus 31714 31699 0 19:13 ? 00:00:00 imapd cyrus 31715 31699 0 19:13 ? 00:00:00 pop3d root 31717 3627 0 19:13 pts/1 00:00:00 grep cyrus
    [root@maui:/var/log]$ ip a l
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
    2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:30:1b:a0:4d:cc brd ff:ff:ff:ff:ff:ff
    inet 148.197.29.5/24 brd 148.197.29.255 scope global eth0
    inet6 fe80::230:1bff:fea0:4dcc/64 scope link
    valid_lft forever preferred_lft forever

    See above

    I must be missing something very obvious !

    John

    A few extra tests

    [root@maui:/var/log]$ nmap -A -T4 -p 993 127.0.0.1

    Starting Nmap 5.51 ( http://nmap.org ) at 2015-08-12 19:23 BST
    Nmap scan report for localhost.localdomain (127.0.0.1)
    Host is up (0.000049s latency). PORT STATE SERVICE VERSION
    993/tcp closed imaps Too many fingerprints match this host to give specific OS details Network Distance: 0 hops

    OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 2.12 seconds
    ———————————————————————-

  • Am 12.08.2015 um 20:29 schrieb Dr J Austin:

    That limits the listener to bind to only the specific IP address and not to all interfaces including localhost.

    What gets being logged at exactly that point? cyrus-imapd logs information at service start.

    Please provide the content of /etc/imapd.conf.

    Ok, IP 148.197.29.5 is set for interface eth0.

    You configured the imaps service not to bind to localhost.

    What did you configure in your DNS and set in /etc/hosts? Please provide last one.

    Alexander

  • Many thanks to Alexander, Richard, Jonathan and m.roth

    The Magic incandation !

    portrelease dovecot service cyrus-imapd restart

    [root@maui:/etc/named]$ cat /etc/portreserve/dovecot imap imaps pop3
    pop3s

    My total ignorance of portrelease/portreserve has been a bit of a problem!

    Now to fix it permanently and get evolution back in one piece

    But why was cyrus able to use imap, pop3 & pop3S but not imaps?

    John

    !This showe it up!

    ——————————————————————

  • Look in /etc/portreserve/ and look at the files there (both the names on the files and their contents). That will give you a sense of what services are covered. Your previous netstat output indicated that portreserve was “holding” both 143 (imap) and 993 (imaps). Since we were focusing on imap I didn’t ask for netstat for other ports, so don’t know what else it might have been “holding”.

    [snip … ]

    I’m not certain where that’s coming from. That will all work internally (assuming internal consistency), but the outside world has a rather different view.

    The information returned by whois for jaa.org.uk (which has your name as registrant) shows:

    Name servers:
    ns.hosteurope.com
    ns2.hosteurope.com

    as the nameservers for that domain.

    If you do a “dig” against either of those servers for your maui host:

    dig @ns.hosteurope.com maui.jaa.org.uk

    you get:

    maui.jaa.org.uk. 14400 IN A 213.152.52.233

    An rDNS lookup on that IPnumber returns:

    233.52.152.213.in-addr.arpa. 56246 IN PTR jaa.org.uk.

    while the rDNS on 148.197.29.5 returns:

    5.29.197.148.in-addr.arpa. 50161 IN PTR adarwash1.ee.port.ac.uk

    which matches the forward lookup:

    adarwash1.ee.port.ac.uk. 86400 IN A 148.197.29.5

    So, the outside world has a rather different view of what your ipnumber(s) are than you seem to be getting/using internally.