Restore not working - can't figure out solution

Issue #310 resolved
Former user created an issue

So far everything is working, including LDAP logins, except for restoring emails back to the server.

Environment details:

mailpiler 0.1.25-rc2 on Centos 6.5 Exchange 2010 on Server 2008R2

config-site.php:

$config['SITE_NAME'] = 'archive.mydomain.com'; $config['SITE_URL'] = 'http://archive.mydomain.com/'; $config['DIR_BASE'] = '/var/www/html/mailpiler/'; $config['ENABLE_SYSLOG'] = 1; $config['SMTP_DOMAIN'] = 'archive.mydomain.com'; $config['SMTP_FROMADDR'] = 'no-reply@archive.mydomain.com'; $config['ADMIN_EMAIL'] = 'admin@archive.mydomain.com';

$config['SMARTHOST'] = '127.0.0.1'; $config['SMARTHOST_PORT'] = 25;


When I try to restore I see the following in maillog:

May 28 16:03:23 conf-dm-piler piler[1188]: connection from 127.0.0.1 May 28 16:03:23 conf-dm-piler piler[1188]: 4000000053864f250032f8d400b264122b19: discarding: restored copy May 28 16:03:23 conf-dm-piler piler[1188]: 4000000053864f250032f8d400b264122b19: from=no-reply@archive.mydomain.com, size=4189/0, attachments=0, reference=, message-id=CAGAjDE=9Jek0QDOM4rsSJ2kV8oaKubsrdoU+AZ+wQJ6CQAi5DQ@mail.gmail.com, retention=0, delay=0.16, delays=0.16/0.00/0.00/0.00/0.00/0.00, status=stored May 28 16:03:23 conf-dm-piler piler-webui[1165]: sending mail from=no-reply@archive.mydomain.com, rcpt=tekz08@mydomain.com, status=1


The GUI declares that the messages are 'restored', but nothing is ever received by my email account. I have Exchange configured with a receive connector with TLS auth and accepting emails from anonymous users.

I've tried changing the configuration of the 'SMARTHOST' over to the email address of the Exchange server (192.168.1.15), but that has basically the same results. 'Restored' but nothing ever received.

Our main domain is 'mydomain.com'... no idea if the configuration above is correct or not but hopefully you can provide some insight.

Thanks.

Comments (9)

  1. Janos SUTO repo owner

    127.0.0.1:25/tcp for smarthost is definitely not ok. I'd say switch it back to your exchange, ie. 192.168.1.15, then install "ngrep" on the piler host, then run ngrep -X port 25, and try to restore a single (and small) email, and show me the result.

  2. Former user Account Deleted
    [root@conf-dm-piler ~]# ngrep -X port 25
    interface: eth0 (192.168.1.0/255.255.255.0)
    filter: ( port 25 ) and (ip or ip6)
    ####
    T 192.168.1.15:25 -> 192.168.1.10:58547 [AP]
      220 mail.mydomain.com Microsoft ESMTP MAIL Service ready at Wed, 28 May 2014 16:45:07 -0500..
    ##
    T 192.168.1.10:58547 -> 192.168.1.15:25 [AP]
      HELO archive.mydomain.com..
    #
    T 192.168.1.15:25 -> 192.168.1.10:58547 [AP]
      250 mail.mydomain.com Hello [192.168.1.10]..
    #
    T 192.168.1.10:58547 -> 192.168.1.15:25 [AP]
      MAIL FROM: <no-reply@archive.mydomain.com>..
    #
    T 192.168.1.15:25 -> 192.168.1.10:58547 [AP]
      250 2.1.0 Sender OK..
    #
    T 192.168.1.10:58547 -> 192.168.1.15:25 [AP]
      RCPT TO: <jgrimes@mydomain.com>..
    #
    T 192.168.1.15:25 -> 192.168.1.10:58547 [AP]
      250 2.1.5 Recipient OK..
    #
    T 192.168.1.10:58547 -> 192.168.1.15:25 [AP]
      DATA..
    #
    T 192.168.1.15:25 -> 192.168.1.10:58547 [AP]
      354 Start mail input; end with <CRLF>.<CRLF>..
    #
    T 192.168.1.10:58547 -> 192.168.1.15:25 [A]
      Received: by piler.X-piler-id: 319.Received: from mydomain.com (192.168.1.3) by mail.mydomain.com.. (192.168.1.15) with Microsoft SMTP Server (TLS) id 14.2.347.0; Wed, 28 May
      .. 2014 15:06:26 -0500..Received: from [127.0.0.1] (helo=localhost.localdomain).by mailcleaner stage4.. with esmtp .with id 1Wpk7f-0002RL-Jq .for <jgrimes@mydomain.com> .from.. <tek
      z08@gmail.com>; Wed, 28 May 2014 15:06:51 -0500..Received: from mail-yh0-f54.google.com ([209.85.213.54]).by.. mydomain.com stage1 with esmtp .(Exim MailCleaner) .id.. 1Wpk7R-0002Qk
      -8K .for <jgrimes@mydomain.com> .from <email_address1@gmail.com>;.. Wed, 28 May 2014 15:06:37 -0500..Received: by mail-yh0-f54.google.com with SMTP id i57so9232863yha.13..        for <jgrim
      es@mydomain.com>; Wed, 28 May 2014 13:07:00 -0700.. (PDT)..X-MailCleaner-SPF: pass..DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;..        d=gmail.com; s=20120113;..
      h=mime-version:date:message-id:subject:from:to:content-type;..        bh=2QGQoPQ+YJzcNYLCwi1aT8t7roCgaMeAdMOQ6DWh/dE=;..        b=kA/us4yKeiUpu+1EzRjegDl0htCxDHHmBgDXTlwTjbhlwvvDRzaAcsmHMD
      RswGHQ60..         /v42ertaH09416xU4NgGkoU96SLQKVLOcvcxCIjiNQryoFyb9aU9P2c/4Ewyp/iZGK8/..         dbQaNi0i8BHpA4UX5vIzB4QRPzlpW5AVitAwWfLB7iJZHdl4ZcbKKgQGIEPmOyaBUJbE..         hNrh5zPIzZz
      FwaA1Ik9vfFHnD6v7CFXAqKUAW8YLd6kUcJUcn2U8SWG9jIY7kpDHW1Sm..         gncJPr36s9AtAEjdeN1YPwZQ1XksHV59l7hgWyyjXknqzuWYj2ON//WcTD1j7U03rsXl..         aXyQ==..MIME-Version: 1.0..X-Received: by
       10.236.52.74 with SMTP id d50mr2658010yhc.44.1401307620098;.. Wed, 28 May 2014 13:07:00 -0700 (PDT)..Received: by 10.170.205.147 with HTTP; Wed, 28 May 2014 13:07:00 -0700 (PDT)..Date: We
      d, 28 May 2014 15:07:00 -0500..Message-ID: <CAGAjDE=9Jek0QDOM4rsSJ2kV8oaKubsrdoU+AZ+wQJ6CQAi5DQ@mail.gmail.com>..Subject: test..From: Jay Grimes <email_address1@gmail.com>..To: Jay Grimes <jgrimes
      @mydomain.com>..Content-Type: multipart/alternative;...boundary="_6d345f15-666a-428a-b42d-c9a02a76e0a3_"..X-WatchGuard-Spam-ID: str=0001.0A090206.538641E5.00EF,ss=1,re=0.000,fgs=0..
      X-WatchGuard-Spam-Score: 0, clean; 0, no virus..X-WatchGuard-Mail-Client-IP: 209.85.213.54..X-WatchGuard-Mail-From: email_address1@gmail.com..X-WatchGuard-Mail-Recipients: jgrimes@mydomain.
      com..X-Spamc: is spam (99.1/5.0)..X-MailCleaner-Information: Please contact postmaster@mydomain.com for more information..X-MailCleaner-ID: 1Wpk7R-0002Qp-JK..X-MailCleaner: Found to
       be clean..X-MailCleaner-SpamCheck: spam, whitelisted by system, Spamc (score=99.1, required=5.0,...HTML_MESSAGE 0.0, DKIM_ADSP_CUSTOM_MED 0.0, T_DKIM_INVALID 0.0,...BAYES_00 -1.9, USER_IN
      _BLACKLIST 100, DKIM_SIGNED 0.1,...NML_ADSP_CUSTOM_MED 0.9)..X-MailCleaner-ReportURL: https://mailcleaner/rs.php..Return-Path: email_address1@gmail.com..X-MS-Exchange-Organization-OriginalArrivalT
      ime: 28 May 2014 20:06:26.3195.. (UTC)..X-MS-Exchange-Forest-ArrivalHubServe
    #
    T 192.168.1.10:58547 -> 192.168.1.15:25 [AP]
      r: MAIL-SVR.mydomain2.COM..X-MS-Exchange-Organization-OriginalClientIPAddress: 192.168.1.3..X-MS-Exchange-Organization-OriginalServerIPAddress: 192.168.1.15..X-MS-Exchange-Organization-Aut
      hSource: mail-svr.mydomain2.COM..X-MS-Exchange-Organization-AuthAs: Anonymous..X-MS-Exchange-Organization-MessageDirectionality: Incoming..X-MS-Exchange-Organization-Cross-Premises-Headers
      -Processed: mail-svr.mydomain2.COM..X-MS-Exchange-Organization-OriginalSize: 2867..X-MS-Exchange-Forest-MessageScope: 00000000-0000-0000-0000-000000000000..X-MS-Exchange-Organization-Messa
      geScope: 00000000-0000-0000-0000-000000000000..X-MS-Exchange-Organization-HygienePolicy: Standard..X-MS-Exchange-Organization-Recipient-Limit-Verified: True..X-MS-Exchange-Forest-RulesExec
      uted: mail-svr..X-MS-Exchange-Organization-Rules-Execution-History: ConfidentialityStatement%%%AttachmentConfidentiality%%%Jason Jonas.. Forward%%%Leah Edwards Forward....--_6d345f15-666a-
      428a-b42d-c9a02a76e0a3_..Content-Type: text/plain; charset="UTF-8"..X-WatchGuard-AntiVirus: part scanned. clean action=allow....test....--_6d345f15-666a-428a-b42d-c9a02a76e0a3_..Content-Ty
      pe: text/html; charset="UTF-8"..X-WatchGuard-AntiVirus: part scanned. clean action=allow....<div dir="ltr">test</div>....--_6d345f15-666a-428a-b42d-c9a02a76e0a3_--..
    ##
    T 192.168.1.10:58547 -> 192.168.1.15:25 [AP]
      r: MAIL-SVR.mydomain2.COM..X-MS-Exchange-Organization-OriginalClientIPAddress: 192.168.1.3..X-MS-Exchange-Organization-OriginalServerIPAddress: 192.168.1.15..X-MS-Exchange-Organization-Aut
      hSource: mail-svr.mydomain2.COM..X-MS-Exchange-Organization-AuthAs: Anonymous..X-MS-Exchange-Organization-MessageDirectionality: Incoming..X-MS-Exchange-Organization-Cross-Premises-Headers
      -Processed: mail-svr.mydomain2.COM..X-MS-Exchange-Organization-OriginalSize: 2867..X-MS-Exchange-Forest-MessageScope: 00000000-0000-0000-0000-000000000000..X-MS-Exchange-Organization-Messa
      geScope: 00000000-0000-0000-0000-000000000000..X-MS-Exchange-Organization-HygienePolicy: Standard..X-MS-Exchange-Organization-Recipient-Limit-Verified: True..X-MS-Exchange-Forest-RulesExec
      uted: mail-svr..X-MS-Exchange-Organization-Rules-Execution-History: ConfidentialityStatement%%%AttachmentConfidentiality%%%Jason Jonas.. Forward%%%Leah Edwards Forward....--_6d345f15-666a-
      428a-b42d-c9a02a76e0a3_..Content-Type: text/plain; charset="UTF-8"..X-WatchGuard-AntiVirus: part scanned. clean action=allow....test....--_6d345f15-666a-428a-b42d-c9a02a76e0a3_..Content-Ty
      pe: text/html; charset="UTF-8"..X-WatchGuard-AntiVirus: part scanned. clean action=allow....<div dir="ltr">test</div>....--_6d345f15-666a-428a-b42d-c9a02a76e0a3_--..
    ##
    T 192.168.1.10:58547 -> 192.168.1.15:25 [AP]
      .....
    ##
    T 192.168.1.15:25 -> 192.168.1.10:58547 [AP]
      250 2.6.0 <CAGAjDE=9Jek0QDOM4rsSJ2kV8oaKubsrdoU+AZ+wQJ6CQAi5DQ@mail.gmail.com> [InternalId=294585] Queued mail for delivery..
    #
    T 192.168.1.10:58547 -> 192.168.1.15:25 [AP]
      QUIT..
    #
    T 192.168.1.15:25 -> 192.168.1.10:58547 [AP]
      221 2.0.0 Service closing transmission channel..
    ####^Cexit
    

    Just updated with a clean result.

    Edit: Removed identifiable info

  3. Former user Account Deleted

    The email was a subject of 'test' with a body of 'test.' This seemed like a lot for that message, but I am not practiced in analyzing raw protocol data so this could be a lot more than you wanted.

  4. Former user Account Deleted

    Apologies for somewhat spamming - I just updated the log with a 'clean' result. There was another message included in the last one I posted.

  5. Former user Account Deleted

    one more quick update --

    telnetting in and manually sending a message DOES reach my mailbox:

    [root@conf-dm-piler ~]# telnet 192.168.1.15 25
    Trying 192.168.1.15...
    Connected to 192.168.1.15.
    Escape character is '^]'.
    220 mail.mydomain Microsoft ESMTP MAIL Service ready at Wed, 28 May 2014 17:01:06 -0500
    helo
    250 mail.mydomain Hello [192.168.1.10]
    mail from: test@test.com
    250 2.1.0 Sender OK
    rcpt to: jgrimes@mydomain
    250 2.1.5 Recipient OK
    data
    354 Start mail input; end with <CRLF>.<CRLF>
    subject: test
    hi this is a test
    
    
    test
    test
    
    .
    250 2.6.0 <edc987d5-7aa6-4bc8-ac00-cbc4e6979c17@MAIL-SVR.mydomain2.COM> [InternalId=294611] Queued mail for delivery
    

    And again with no-reply@archive.mydomain as the sender, it works just fine.

    [root@conf-dm-piler ~]# telnet 192.168.1.15 25
    Trying 192.168.1.15...
    Connected to 192.168.1.15.
    Escape character is '^]'.
    220 mail.mydomain Microsoft ESMTP MAIL Service ready at Wed, 28 May 2014 17:03:35 -0500
    helo
    250 mail.mydomain Hello [192.168.1.10]
    mail from: no-reply@archive.mydomain
    250 2.1.0 Sender OK
    rcpt to: jgrimes@mydomain
    250 2.1.5 Recipient OK
    data
    354 Start mail input; end with <CRLF>.<CRLF>
    subject: test
    
    testing again
    test
    
    .
    250 2.6.0 <267907de-e468-4873-9a8e-075de9c50da8@MAIL-SVR.mydomain2.COM> [InternalId=294617] Queued mail for delivery
    

    Edit: Removed identifiable info

  6. Former user Account Deleted

    This is looking to be more and more an Exchange issue as the emails are definitely being received by my server - they're just not delivering to mailboxes for some reason. I'll update here if I discover the reason why, but as far as I can tell this is not a mailpiler issue.

    Thanks and I apologize for wasting your time!

  7. Janos SUTO repo owner

    Try setting the following in config-site.php:

    $config['REWRITE_MESSAGE_ID'] = 1;

    then try to restore a single email.

  8. Log in to comment