Restore to mailbox used to work, but no longer

Issue #872 closed
Mike Schuler created an issue

We've been using Piler for a couple of years (thank you very much for producing this application). We just transitioned our email service from Zimbra to Office 365. "Restore to mailbox" worked flawlessly when we were on Zimbra, but doesn't work with Office 365.

Message traces at Office 365 indicate the messages are not being received there at all.

Our SMARTHOST was 127.0.0.1/25 (when it worked with Zimbra). We've tried changing it to many other things, with no luck.

We'd appreciate any advice you can offer.

We're using Piler 1.1.1

Comments (14)

  1. Janos SUTO repo owner

    What does the local smarthost mail logs say? Is there any indication of failure in the logs? Or o365 accepts the email, just it never gets to the recipient's mailbox?

  2. Mike Schuler reporter

    If you mean the /var/log/mail.log on the piler machine...then

    When we had SMARTHOST as 127.0.0.1, this was the log Jan 10 09:40:41 piler piler-webui[10435]: sending mail from=no-reply@piler.xxxxxxxx.com, rcpt=mschuler@yyyyyyyyyy.com, status=1

    When we changed it to "outlook.office365.com", this is the log Jan 10 10:41:02 piler piler-webui[10435]: sending mail from=no-reply@piler.xxxxxxxx.com, rcpt=mschuler@yyyyyyyyyy.com, status=0

    Note the status changed from 1 to 0. Is there something else in the logs we should be looking for?

    I'm reasonably confident o365 is not getting the mails.

  3. Janos SUTO repo owner

    You said, you had the smarthost set to 127.0.0.1. It means you have postfix, exim, whatever on localhost to send emails to restore. So you should have some postfix or exim entries in mail.log when you try to restore. Also it would be great if you could share some details of your setup and settings to make me understand what's going on.

  4. Mike Schuler reporter

    I apologize for sounding like a newb. I didn't set this up, and am flying a bit in the dark. "But", your last reply helps me. Yes, we had the smarthost as 127.0.0.1. We thought piler had it's own "built-in mail server", and the was the agent sending mails to the destination server.

    However, you mentioning postfix, exim, etc... tells me it doesn't. I noticed ssmtp was configured on the machine. I'm sure that must be the mailing agent that piler was/is using.

    I'll change the smarthost back to 127.0.01 and verify the ssmtp config. I have a feeling that may be the issue. Thank you for your patience.

  5. Janos SUTO repo owner

    Well, piler is indeed a mail server, however it receives mails only, not relays them. So if you want to send emails over smtp, then you need a real MTA, perhaps ssmtp. Now if you have ssmtp running, then try restoring an email to you, and show me the ssmtp logs.

  6. Mike Schuler reporter

    I verified the ssmtp config, and tested...it definitely works. However, I'm drawing the conclusion that piler is "not" using ssmtp as the sending MTA.

    Note these entries in syslog from the latest attempt to restore one email.

    Jan 10 12:11:30 piler piler[8861]: connection from 127.0.0.1 Jan 10 12:11:30 piler piler[8861]: 400000005a56575c0288db6c00fab9252566: discarding: restored copy Jan 10 12:11:30 piler piler[8861]: 400000005a56575c0288db6c00fab9252566: from=no-reply@piler.xxxxxxxx.com, size=36797/0, attachments=0, reference=BLUPR14MB03085D5239B18176FC9C2AAAA2230@BLUPR14MB0308.namprd14.prod.outlook.com, message-id=BLUPR14MB0308AE1881DB43350A965450A2230@BLUPR14MB0308.namprd14.prod.outlook.com, retention=0, delay=0.04, delays=0.04/0.00/0.00/0.00/0.00/0.00, status=undef Jan 10 12:11:30 piler piler-webui[10435]: sending mail from=no-reply@piler.xxxxxxxx.com, rcpt=mschuler@yyyyyyyy.com, status=1

    Postfix is not installed on this machine, but I'm at a loss as to what is attempting to send these mails.

  7. Janos SUTO repo owner

    How about if I look around using ssh? It would result a faster resolution. If that's ok, then find me on skype (janos.suto).

  8. Mike Schuler reporter

    sure, we use Skype for business...there are a ton of Janos Suto's ... are you janos.suto@skypeids.net ??

  9. Luke Luzicka

    Hi Janos, Ill be communicating with you on this issue. Yes there are a lot of janos.suto matches in skype. Can you send me a skype message at lluzicka please? thanks

  10. Luke Luzicka

    Janos,

    Sorry we could't link up yesterday. I got sidetracked and dealing with Skype makes me crazy.

    I figured out a solution to the restore problem! For people searching for a solution to a similar problem I will do a quick recap and tell my solution.

    Our organization used to use Zimbra for mail. We had piler set up to LDAP auth off of Zimbra. We recently switched to Office365, and I changed config-site.php to auth off of Imap using office365. Users logging in worked fine, but restore to mailbox no longer worked. It worked fine with Zimbra. I thought I needed to change the SMARTHOST, SMARTHOST_PORT, or something else. We also futzed with ssmtp settings on the piler server thinking perhaps piler used SSMTP to send the restored emails. (side note: from looking at the code i dont think it does. When it sends smtp mails, it looks like it basically telnets (or something similar) to the SMARTHOST over the SMARTHOST_PORT and sends the email using the smart host. At least that is what it looks like in model/mail->send_smtp_email() ) What ended up fixing the issue as adding one line to config-site.php: $config['RESTORE_OVER_IMAP'] = 1;

    Works perfectly now. LOL

    I can't be sure, but I am wondering if the LDAP authentication settings in config-site.php was where piler got its ability to restore emails when we were using Zimbra. Perhaps it rode over the connection it made to use LDAP to authenticate the user to restore emails from the GUI? Doesn't really sound right, but I can't think of any other way it was able to restore emails before. Nothing else changed when we switched to Office365.

    Anyways, it is fixed now.

    Thank you so much for your fast response and willingness to help! I have never had a response from a developer like that before. Happy new year! I hope my solution will help someone in the future.

    Luke

  11. Log in to comment