Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Mail Fetch Failure - Cannot authenticate to IMAP server

OST seems to be having mail authentication issues in v1.10.  The system will be running fine for 24 hours, no issues, all mail is being delivered and then all of a sudden we get the error: 

osTicket is having trouble fetching emails from the
following mail account:
 
User: private@example.com
Host: outlook.office365.com
Error: Can not authenticate to IMAP server:
[AUTHENTICATIONFAILED] Authentication failed.
7 consecutive
errors. Maximum of 5 allowed
This could be
connection issues related to the mail server. Next delayed login attempt in
approx. 10 minutes

After the error, I go to Admin Panel > Emails > Emails and enter our email username and password and click save changes.  I get the error:
Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed.
I am 100% certain I am entering the correct imap and smtp info.
The issue will usually resolve itself in about and hour, sometimes longer.  Anyone else seeing this?  I know our settings are correct because it does work occasionally.
Server InformationosTicket Versionv1.10 (901e5ea) —  Up to dateWeb Server SoftwareApacheMySQL Version5.5.52PHP Version7.0.14

Comments

  • Can you go look at the mailserver logs and see what it says is happening?
  • edited December 2016
    Here is a snippet from our maillog file.  Every time I try and authenticate via the admin panel it creates 6 records in the log with the info below.  No idea where this mail authorization database resides.  And no idea why this works for a day and then all of a sudden stops working.  (btw - I changed  the email address belowso I dont get spammed.)  

    rip=51.22.182.23, lip=51.22.182.23, TLS, session=<YjHb2SRElMsyFbYX>
    Dec 21 00:00:02 www dovecot_authdb_plesk[41103]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:00:08 www dovecot_authdb_plesk[41103]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:00:18 www dovecot_authdb_plesk[41103]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:00:35 www dovecot_authdb_plesk[41103]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:00:37 www dovecot_authdb_plesk[41103]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:00:39 www dovecot_authdb_plesk[41103]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:00:41 www dovecot: imap-login: Aborted login (auth failed, 6 attempts in 39 secs): user=<private@example.com>, method=PLAIN, rip=51.22.182.23, lip=51.22.182.23, TLS, session=<fJ8U3SREmMsyFbYX>
    Dec 21 00:03:46 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:03:52 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:04:02 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:04:19 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:04:36 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:04:38 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:04:40 www dovecot: imap-login: Aborted login (auth failed, 6 attempts in 54 secs): user=<private@example.com>, method=PLAIN, rip=51.22.182.23, lip=51.22.182.23, TLS, session=<lJN36iREussyFbYX>
    Dec 21 00:05:02 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:05:08 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:05:18 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:05:35 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:05:37 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:05:39 www dovecot_authdb_plesk[41363]: No such user 'private@example.com' in mail authorization database
    Dec 21 00:05:41 www dovecot: imap-login: Aborted login (auth failed, 6 attempts in 39 secs): user=<private@example.com>, method=PLAIN, rip=51.22.182.23, lip=51.22.182.23, TLS, session=<4cv17iREwMsyFbYX>
  • edited December 2016
    I found those two articles also but neither of them resolve the issue.  

    Something does not make sense here.  Those errors are related to an internal IMAP sever.  We are using Office 365.  The email address we are trying to receive from is not on our internet server, it is an email hosted by OFfice 365.  If I change OST as a test and use an internal email address everything works fine, but we are using an email domain managed by Office 365. Somehow OST is trying to receive mail using Dovecot (internal IMAP) even though we explicitly have outlook.office365.com as the IMAP host.  Even stranger is this was working fine just a day ago. I may have to call OST premium support if I cannot get this resolved, we are totally unable to fetch tickets at this point.
  • Source: https://support.office.com/en-us/article/POP-and-IMAP-settings-for-Outlook-Office-365-for-business-7fc677eb-2491-4cbc-8153-8e7113525f6c

    So in osTicket terms your settings for the email would look something like this:

    Email Address: private@example.com
    Email Name: <whatever you want to name it>

    Department: <which ever you want it to be>
    Priority: <what ever you want it to be>
    Help Topic <System Default, or what ever you want it to be>
    AutoResponse: unchecked

    Email Login Information
    username: private
    password: password

    Fetching Email via IMAP or POP
    Status: enable
    Hostname: ssl://outlook.office365.com
    Port Number: 993
    Mail Box Protocol: IMAP
    Fetch Freq: 2 min
    Emails per fetch: 10
    Fetched Emails => Delete emails (or whatever you want)

    Sending Email via SMTP
    Status: enable
    Hostname: ssl://smtp.office365.com
    Port Number: 587
    Authentication Required: No  (this might need to be yes, I dont know O365 reqs)
    Header Spoofing: <your choice>

    You would have to make sure that your web server has permission to talk to the mail server. 

  • edited December 2016
    i tried these settings. there are a couple of issues with the recommendations:
    1. If I do Hostname: ssl://outlook.office365.com, I immediately get an error that says:
    Can't open mailbox {ssl://outlook.office365.com:993/imap/ssl/novalidate-cert}INBOX: invalid remote specification2. I'm 98% certain the username needs to include the domain, so instead of private, it would need to be private@example.com.  I tried both and neither worked, still get the error above.
    You mentioned making sure the web sever has permission to talk to the mail server.  The link talks about SMTP (send mail). My smtp settings work perfectly, I can send mail from OST without issue.  The issue is fetching mail with IMAP (receive). No matter what the settings, I cannot get OST to talk to outlook.office365.com, instead it keeps trying to talk to my local mail server.  Clearly there is something wrong in the config.
    Just for testing purposes I stopped the dovecot IMAP server on my Linux server.  Then I tried connecting to outlook.office365.com through OST and I received the error:Can't connect to outlook.office365.com.motionrc.net,993: Connection refused
    why did it append ".motionrc.net" (my site domain)  to the IMAP host name?  I think this could be the issue.
  • I worked with professional support today.  We narrowed it down to a DNS issue or possible PHP 7 issues.  Either way we are working on it and for the time being we have entered the IP addresses for the IMAP and SMTP servers at Microsoft in order to circumvent the DNS issue.  

    Mark
  • Good morning,
    I have exactly the same issue with gmail. The previous version of OSTicket works like a charm with the same setting but for that I am not able to make it at work.


    Any solution?
  • edited December 2016
    @sev7en
    1. Please do not hijack other peoples threads.
    2. Please help us to help you by reading and following the posting guidelines located in this thread:  Please read before requesting assistance.  The more information you give us the better we will be able to assist you. Thank you.
  • Good afternoon,
    I apologize, I will open a stand-alone ticket.


    I am sorry.
Sign In or Register to comment.