Closed solasdev closed 7 years ago
Odds are they are detected as MIME parts but aren't seen as attachments. Dig in with a debugger and poke around! Try mail.parts
and take a look at the code that determines whether a MIME part is an attachment.
Thanks for the response.
Weirdly the email isn't multipart.
Pasted below the raw mail, you might be able to make more sense from it...
=> #<Mail::Message:70138743146660, Multipart: false, Headers: <Return-Path: Diver@Keelings.com>, <Received: by 10.80.166.156 with SMTP id e28csp2741315edc; Mon, 7 Aug 2017 23:00:23 -0700 (PDT)>, <Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp0176.outbound.protection.outlook.com. [213.199.180.176]) by mx.google.com with ESMTPS id y2si157420pgo.679.2017.08.07.23.00.22 for <keelingsoxparser@gmail.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 23:00:23 -0700 (PDT)>, <Received: from AM4PR0202CA0014.eurprd02.prod.outlook.com (2603:10a6:200:89::24) by VI1PR02MB0973.eurprd02.prod.outlook.com (2a01:111:e400:5340::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1320.16; Tue, 8 Aug 2017 06:00:18 +0000>, <Received: from DB5EUR01FT050.eop-EUR01.prod.protection.outlook.com (2a01:111:f400:7e02::202) by AM4PR0202CA0014.outlook.office365.com (2603:10a6:200:89::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1320.16 via Frontend Transport; Tue, 8 Aug 2017 06:00:18 +0000>, <Received: from mail.keelings.com (77.75.97.180) by DB5EUR01FT050.mail.protection.outlook.com (10.152.5.82) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1304.16 via Frontend Transport; Tue, 8 Aug 2017 06:00:18 +0000>, <Received: from IE-ROS-DIVER01 (192.168.1.90) by IE-ROS-MAIL01.Keelings.com (192.168.1.93) with Microsoft SMTP Server id 14.3.301.0; Tue, 8 Aug 2017 07:00:06 +0100>, <Resent-From: <kcoms@oxbusinesssystems.com>>, <Date: Tue, 08 Aug 2017 07:00:04 +0100>, <From: <diver@keelings.com>>, <To: <kcoms@oxbusinesssystems.com>, <colin_edwards@keelings.com>>, <Message-ID: <-1672714156.1502172004172.dial.diver@IE-ROS-DIVER01>>, <Subject: DAILY VPC VOLUMES FOR OXSYSTEMS>, <Mime-Version: 1.0>, <Content-Type: application/octet-stream; name="Daily VPC Quantities.xls">, <Content-Transfer-Encoding: base64>, <Content-Disposition: attachment; filename="Daily VPC Quantities.xls">, <Delivered-To: keelingsoxparser@gmail.com>, <X-Received: by 10.84.130.9 with SMTP id 9mr3381663plc.388.1502172023318; Mon, 07 Aug 2017 23:00:23 -0700 (PDT)>, <ARC-Seal: i=1; a=rsa-sha256; t=1502172023; cv=none; d=google.com; s=arc-20160816; b=jOpGkHa9s1bC+tNvalWGlATLBWxisopJomVAXuTetCL29K9xJ70Tlq0EYWtc1seZiJ XlPBsGZDg8ZUZotXDwOmDrQ00NAIdmeqU5Y1gfpK2+WJJSxOIQBvo/C3hV5QH7+GRwXr QlKfncP4fjAKDsNky8WkSPKpeEDm7aB+kTrWOR3BO8OK53+psnFHkWnAxSmKfsaY/kX+ ONClUiFzHPMXYWGI1Z+mAOrT+0lyejn3L8uhebvZmQti24znn1Bvp6Q+TKNfqN4ZvXI1 uXXkluJu+LCvUBdBROtwO0WdePDV9WmciefmPuoB2cISFpAC706RbZ2/orp1SpAJi4wa reuQ==>, <ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput:content-disposition :content-transfer-encoding:mime-version:subject:to:from:date :message-id:resent-from:dkim-signature:arc-authentication-results; bh=8nIxMpy3Zbooh+sEZG+TG2Q/DT8mmsNgRuc+1k+ft40=; b=QxzEWt8O/HyQ3tiMeiOA4M9QiMtLm/0IWNrboZwkzQM56PuOkPNtkPTGWxFZVfe2oJ lETSG3tsM31XDXiDGs3kXH3OzjzU5RBbJHN27AXbY3B4LRq/RytvEloQxyi9GwDvxW6j +GPtONLLVus2qB0NbIeeKg9xIPCyE7/zfuNquNTkscntpTxMSHG6rPM8ghtBOSLLX8HH /Y2A44vmgvRTTF2fDnGH1q6UnixomoNeNhFcdfLQYayXy0agUdagLa2EePM6iI4h62xe 8hHEx78MR2niBWsuKNsyM6PCjyqZl7GXp3F2sbjT15bO+7Ckl3MDAyPr0DP4UlR87S47 Qnsg==>, <ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oxbusinesssystems.onmicrosoft.com header.s=selector1-oxbusinesssystems-com header.b=vgxlHtSr; spf=pass (google.com: domain of kcoms@oxbusinesssystems.com designates 213.199.180.176 as permitted sender) smtp.mailfrom=kcoms@oxbusinesssystems.com>, <Received-SPF: pass (google.com: domain of kcoms@oxbusinesssystems.com designates 213.199.180.176 as permitted sender) client-ip=213.199.180.176;>, <Authentication-Results: mx.google.com; dkim=pass header.i=@oxbusinesssystems.onmicrosoft.com header.s=selector1-oxbusinesssystems-com header.b=vgxlHtSr; spf=pass (google.com: domain of kcoms@oxbusinesssystems.com designates 213.199.180.176 as permitted sender) smtp.mailfrom=kcoms@oxbusinesssystems.com>, <DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oxbusinesssystems.onmicrosoft.com; s=selector1-oxbusinesssystems-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8nIxMpy3Zbooh+sEZG+TG2Q/DT8mmsNgRuc+1k+ft40=; b=vgxlHtSrj12fCaKGVP9Qcf2gtmcl/mt2iMpppTm4NCEK7uC2PwKpeSOQuUrvusm8R2JBpzer5Kv3CfApEGnMr74t07UMXuFf6h+EbOINProfbTVJQTXNWLlrUUP2A4fA0vd+J2f05WaF2LVMPMTJzSYWZhKrZoKdGQB33t8ZjuQ=>, <Authentication-Results: spf=none (sender IP is 77.75.97.180) smtp.mailfrom=Keelings.com; oxbusinesssystems.com; dkim=none (message not signed) header.d=none;oxbusinesssystems.com; dmarc=none action=none header.from=keelings.com;>, <Received-SPF: None (protection.outlook.com: Keelings.com does not designate permitted sender hosts)>, <X-Generated-By: DI-DiveLine Scheduler Engine 6.4 (46) and Dial 6.4 (46)>, <X-DiveLine-Server: IE-ROS-DIVER01:2130>, <X-DiveLine-User: keelings_admin>, <X-Job-User: keelings_admin>, <X-Job-Name: DAILY VPC VOLUMES FOR OXSYSTEMS>, <X-EOPAttributedMessage: 0>, <X-EOPTenantAttributedMessage: 5331f117-9301-4279-9669-d642cddb9b69:0>, <X-Forefront-Antispam-Report: CIP:77.75.97.180;IPV:NLI;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(6009001)(8156002)(3000300001)(428002)(199003)(4423002)(189002)(621065002)(73894003)(86362001)(7596002)(305945005)(4270600006)(7636002)(106466001)(33646002)(104016004)(1096003)(6636002)(101416001)(246002)(80792005)(8676002)(62796015)(77096006)(626005)(72206003)(356003)(50986999)(54356999)(9686003)(15003)(33716001)(55016002)(86152003)(59296005)(105586002)(2876002)(217873001)(215093002)(79686003);DIR:INB;SFP:;SCL:1;SRVR:VI1PR02MB0973;H:mail.keelings.com;FPR:;SPF:None;PTR:mail.keelings.com;A:1;MX:1;LANG:en;>, <X-Microsoft-Exchange-Diagnostics: 1;DB5EUR01FT050;1:gEbnmCunNRxhw7V4csfa/fAtw6XNKZ0rPVarec9/lk9QMV0Ys8AMrcBxLwTDy2qnG0Udnk2GUvi0PZJv6cCtOSilfdBYPTHWpGDjrfq8UQjOcm9XGEjlCHRA+3oVM5xZLZkkg0OsOFJUhsZ7V7FmzqMWrPo06iaMKsbFLBNyI/x5RJgUNK0PD+EmrxKpOkFzUFwVkCWfGHXuhqA+yfTEeIakBL2geGzA6PKUWSXruQlfcFgq8J7ORCfuOkGAMs/QxWIQdpSNn4vFc1sLHB0CTc9AaO7iYfOV8oNlTdI2nB557da0vbwERCcGgNKh4Xz8orUkiNXc8pdsfWvwq/4uuRKEPg0C0OJWWgQPJZZBuCmGhkXhlWJkx31OCez+/JCE6jeYfj3BruNtV+i2yai7DGu60/KwECblBDeXC99g/MNUKj53BnL1yOXQsK7Rgt8K4V5sXwBHnmlUAJUsBRdBq44oXE2vcOT6ptezlnQ6o5q40pcNpyLxDqHybQx1sRXfqbhKUdGR5B6RWKY7ewDyC+BBm84Kuoo2K5cdsq97x5kOBx9xI/G3zrhX2ngtxo6bmKiGaL2mCIxtk9Jk91Pti0VZpu8LACP0nKQZjlXW1ylSJmToySgqLgkjf4tjG+QXHvAvmqUwEANTc5Y8sFYhFo/f4X2ecSsuDdNOFC8c8uu0ZKyYbGcPZcBdKpCJBmAnzsnMINEarpoTS/6ddebYlfIQnp3r8Nqd5t/QFYQSMplinNTqE4lhXKc6LmOghIIT1mq5EBK2XxQZM1Lx5Hs3Tk+s8zBZvPN+fvXYC4R3WE5GmjvYg3PomIclM5K27PHt4gP4yMSTry/MBs/r4JeiuP9KiHjHgYxLLfKAWyHEnclogSB1LRkRnxR2MFskppakio0zkg7SX77RkPLSp8D7H5u9zvfZFcGejff86xw+bCw=>, <X-MS-PublicTrafficType: Email>, <X-MS-Office365-Filtering-Correlation-Id: bfa9821e-8f5b-4bdf-236a-08d4de22bf36>, <X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(23075)(300000503095)(300135400095)(49563074)(71702078)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:VI1PR02MB0973;>, <X-Microsoft-Exchange-Diagnostics: 1;VI1PR02MB0973;3:sd54g5DPnnjc3yNrosopC2ON2zwDgjdlrbl2mdqK/b1h1PsD0RGlIRR6U6G8FtRudH3aX7dRbVNAE7Zv9TYb9sdEvmXfWLDXbagz8J67p4OjOIitXTsjFkisEhNOhlYEm54+e2gfESvZCfXJHRF1KkNUfuMhtOwW3+jRPt5fwEcuRXxFSnRX143d2cpVYHnTC5wx4lI3+wyexyDsFkFN5Dm+y9AN89TAfLqj0VjQ6zf/CDwVfNXDDUUpIuLyCQo8b741R8vBlc2JQZdFyDHkbBsM9o2DCdoLTZ3XVtXkRL9TFPG0+eG6QUqW/jDnhSgqsNtI1ZqUwU5HmvV3gl2DjQ==;25:/gldIbOZsK1+w64LY65DTMZvBovxd40AN9OavBdrKY6qrebsKmNww1ObSIaR6xl/6FIu+vygAZ2DhtHYQJQXmMWKVhEcLhyhQ11aJ415NfSGcva9hPaqDWwlHvaBnx/xVe5+w4L6kzzkknxsEy1ZgcBTjrOsVfjY5ZDJGogWupuD/u0NycaaE31cywvl3qKehwhXSvgzEzNR++0kT5B676QYbEz4RhNzBa+t2nV83K0=;31:f5cHvvip+9EgIn04U16mA5C583j2uTnSRzJrihew76phJk+0RKNZf7rH4BOw83tCtlYN5NJGdhp3TZoHgUGkb8AshW5tMqqCVMT5SOyysE2PBQrPQK3isB+KwngsFke6;4:oBjnz1He6n9op7YjFM0QVYXQwo218Oa6DhzmG5VXYS6I3Wo1ihbiHmp9JVBN6/93KIsqW7Eh+8i2806LuTOJVcvp1Wfhh55mu7goWJrXs2CGAAMRy2hBSLaOrNzORKcB2Vg/l6EZj1FyqNiLO491EA==>, <X-MS-TrafficTypeDiagnostic: VI1PR02MB0973:|VI1PR02MB0973:>, <X-Exchange-Antispam-Report-Test: UriScan:;>, <X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(601004)(2401047)(7630418)(13016025)(8121501046)(13018025)(7631346)(7632307)(7633261)(9101536074)(3002001)(93006095)(93003095)(10201501046)(100000703101)(100105400095)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR02MB0973;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRV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vS03Dv/keyIFVJk6c5QWnN36ErbyMgjKf2S11xnLT6Rpc1276WqQVQLducWhOEUJXkmszjIhZ1UoA/f3puU7PDD80uixAYJGLxXOCSNC9EPQlx7eZ/vJLyBecZhKkbzO4muG3tNwMgBiUsGBICH+QZ+woFNhX4+R8XsMHkuL5NzMCluxqvEd8l+kAcExZ5GU4m3bF/u5785q4l0y8tA=;5:doz9loVZtYclpvktwd70uGVCrgf5i7OD7oPPmYW6Z5ZhrJgMZzRWXfi8TedLtQ52qAseerwCm6L2prhojm5/gxzG3JQeO0QTH3Yi/Mx1bMiaZwDIT9QFWfw/DODTDtbCCemcP4e+4M+9j3nY42agzA==;24:Rooz96UQZl+kns45Zuicr1e/iTdE7BnYqenlD91Xpf92u5btKOUfSE990y712301nYhcgoLhZDVHAPnBgcGsy8ocEKgMhyBVh2nbPyOnVaE=;7:Itab/SRsAqAFtZeJwIzOxO+ILbyvalul3z0OYh4tFu3DaT3//xLnp+H0h2pbSMvU0ufTyHc/zC1eBkjdvgOneA9Ey6cALpQhshhW12xK7crYynl33y/v49PL//XuV8vgCTMxE605Npr6k0sYTzUCpzjrvX0Mm1xGWpwqg14ZOta0N5bCmuhjm0NXxvQvH6C6yJaNPCN0zGZvRKdNkZIkAjeSvEEeiVFjSqxBOvc9Pbg=;23:sw+pYcZ3ALAkkA+6Nw8yQrFtL71Fd1j3ZKfTtKfCApxK5E+6sEEERJCyhRHSzdL5O8jP8y2D5W0wTtnLUm7YzxhfMXDGPpGphiZVt6lDOVzlBDfZ+wnsfslegTcrOzzS>, <SpamDiagnosticOutput: 1:99>, <SpamDiagnosticMetadata: NSPM>, <X-MS-Exchange-Inbox-Rules-Loop: kcoms@oxbusinesssystems.com>, <X-ExternalRecipientOutboundConnectors: 5331f117-9301-4279-9669-d642cddb9b69>, <X-OriginatorOrg: oxbusinesssystems.com>, <X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2017 06:00:18.2146 (UTC)>, <X-MS-Exchange-CrossTenant-Id: 5331f117-9301-4279-9669-d642cddb9b69>, <X-MS-Exchange-CrossTenant-FromEntityHeader: Internet>, <X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB0973>>
<Content-Type: application/octet-stream; name="Daily VPC Quantities.xls">,
<Content-Transfer-Encoding: base64>,
<Content-Disposition: attachment; filename="Daily VPC Quantities.xls">
The email body is itself a raw file. It's not attached to a text/html email.
Ok thanks, so do you think it's possible to download file from this? Sorry bit of a noob at all this.
mail.decoded
will give you the email body, which will be the file's contents in this case.
A couple of mails in the inbox that definitely have xls file attachments are returning empty when queried using the gem.
mail.attachments = []
Why would this be?