1

When reading email sent from an yahoo account, the method message.getPayload().getParts() returns null. Tested it with other domains (gmail, outlook, hotmail) and had no problem.

In fact, getPayload() returns a string without the "parts" field.

Any ideas?

Thanks.

Edit:

I'm using Java.

And that's an example of the raw message:

Delivered-To: ...@gmail.com
Received: by 10.25.38.80 with SMTP id m77csp2082720lfm;
        Wed, 23 Aug 2017 11:21:52 -0700 (PDT)
X-Received: by 10.36.88.19 with SMTP id f19mr3619353itb.114.1503512512655;
        Wed, 23 Aug 2017 11:21:52 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1503512512; cv=none;
        d=google.com; s=arc-20160816;
        b=hNlRtyLieEAxck27i5zZez/QG7M98ZOJjAHmzvMHPs/ON5G3TvtKm5IQ4SWxGef1bu
         pMLtqt3u3ti8EmOoaGvIsWF8fkCEYWJNyTrm+AfVBIW/vWcaBO5C+/gU/2l8c1bz640/
         cjGyUkfYH5P7eaA8Bn5qJqbGC6RN0jH99qP0keLCCXDEtD15pNUqWvlRy2cYthvxrApX
         gwmB5RGoDHJxWym97ULj2jbXU8d2msM2oCTKsGKAYPfPUKxpmU9omE1fAPSd+0a2UuGo
         qXviZ6r9ZOoj2UYeCulbLe2c8OaKXSPYT+j6OGSRQ/9KkM7122Mo3U7B30WdSm0steTO
         cOPg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=references:content-transfer-encoding:mime-version:subject
         :message-id:to:reply-to:from:date:dkim-signature
         :arc-authentication-results;
        bh=Tz5JmALH26W2NmpUut1b8KAtYumw1nslUgD+V4O7niU=;
        b=GACDabh89djjl0DusVFNR6mcyoStwHcH311IyqNkxC/rAipc9kIVjaxJHetooodQ4/
         TKBVH4N2mfLpeQSr0sFHILcnJWklC8K9ZMI11GVC1KMcvr0sdfSLBXZ2xXxkBq2aM/F9
         1AmCJ3dLwsn6n7qoFUPKukpt1dJWTmU9OdWq2rdw5477Ol7ieXnnC2SX3K7GyD1fKDjV
         /Skj6Q+vKDuNUzexuh1V4zTcuuAUM03VlG/gbrFjPrp3ABvnlzuV1/8nu4QdQte/h3Cz
         HJUOikVOQHm7HPTHJQi91639k3/Nl/TvC8bPpWF56CwRxBfMTtRZDHJAzjymOqYNjndM
         PL5g==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@yahoo.com header.s=s2048 header.b=n8P3/tJJ;
       spf=pass (google.com: domain of ...@yahoo.com designates 66.163.190.61 as permitted sender) smtp.mailfrom=...@yahoo.com;
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.com
Return-Path: <...@yahoo.com>
Received: from sonic307-38.consmr.mail.ne1.yahoo.com (sonic307-38.consmr.mail.ne1.yahoo.com. [66.163.190.61])
        by mx.google.com with ESMTPS id c132si2139994itc.196.2017.08.23.11.21.52
        for <...@gmail.com>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 23 Aug 2017 11:21:52 -0700 (PDT)
Received-SPF: pass (google.com: domain of ...@yahoo.com designates 66.163.190.61 as permitted sender) client-ip=66.163.190.61;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@yahoo.com header.s=s2048 header.b=n8P3/tJJ;
       spf=pass (google.com: domain of ...@yahoo.com designates 66.163.190.61 as permitted sender) smtp.mailfrom=...@yahoo.com;
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1503512512; bh=Tz5JmALH26W2NmpUut1b8KAtYumw1nslUgD+V4O7niU=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=n8P3/tJJ46TZtkbxEu9p93hHodloAc938JlVtFNggsFDKOh1CXeELNzqwZpx2RpnlxKLg0mMIrSO+6ixFI2jQXpI2OEkMjMW+Lojz2f6MDRzktI24qeoHK6z0OODwEr13l8+NRFuvEgatiOoKG4nK/0ESYRYj6MK2580zYFdMO34vdAUKwS5c7+T7cNTbb2Ov3+zNP+kHVOnFTpxcYKeRvqnueRbJMAgu/zqNEb5uptfny/uv96oSj0qampNulxjw3RM+rXzGnDhzex/dKS3aKUxkaTA/C1Y/pK88Arp14BYh5SUwlY1IM8+ae/gFFYHQmcN4tD99+f6QZkL+U+nDA==
X-YMail-OSG: bU76A0cVM1mKMrarfFd.RRvN1pJLGQPGtympfd4w.3r6YP1PfmogV2hMIGfIjW3
 p3.MJ5enUkT9dmftCW24yuYPZH4MhX2BJCXOQBBjVdpf4n7AWMev2Lg2V1l_yh9aivYy3lyFz2mp
 E7B7QicUKsBZsDrLKZy6aj1p1SKMXTK2BaM1FLvw7geXcSVImhw8xoWaTjWwXgrTrKmZv4xl9Lfn
 J17mHtiuK_aFBVuPTbneEqxexfSgqN.mZCJzHZYFUAOeU3U3dfVEYVxG8ohJK.rUNxEj2EgXdCg2
 FZq.xcE.R9_.ghSDSm5GH3G2BkpEEQ95VGAyPXfhEmZMLDKf08zx5_6FM_npwflAYYnnlLNYDJ0j
 bvuKIfPljJunLWdxSQvx3_RsKdlFrBXXR1umg41QuqzXlZs4C8FQBdgzNwPrhuGU_NoPKf.MAhCW
 rJmi9RcDFfNENxetttsECz9TvDacjN3.Ij3z6cf3oVkKVNTM8coPQpv5iEYUtQ0PRt3Iay.g.dg-
 -
Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Wed, 23 Aug 2017 18:21:52 +0000
Date: Wed, 23 Aug 2017 18:17:51 +0000 (UTC)
From: ... <...@yahoo.com>
Reply-To: ... <...@yahoo.com>
To: "...@gmail.com" <...@gmail.com>
Message-ID: <843172102.808351.1503512271497@mail.yahoo.com>
Subject: =?UTF-8?Q?[Sala_de_semin=C3=A1rios]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
References: <843172102.808351.1503512271497.ref@mail.yahoo.com>
X-Mailer: WebService/1.1.10451 YahooMailNeo Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0
Content-Length: 53

Data: 01/01/1970
Hora: 11:30
Dura=C3=A7=C3=A3o: 00:30
lincolnjpg
  • 11
  • 3
  • The `payload` is the only part in some `text/plain` messages. What does the entire `raw` message look like? – Tholle Aug 24 '17 at 10:09
  • @Tholle I've updated my question to include the raw message. – lincolnjpg Aug 25 '17 at 01:48
  • Great. The `payload` is indeed the only `part` in the message in your question. Maybe you could get some inspiration from [**this answer**](https://stackoverflow.com/questions/32655874/cannot-get-the-body-of-email-with-gmail-php-api/32660892#32660892), even though the algorithm is written in JavaScript. – Tholle Aug 25 '17 at 08:09

1 Answers1

0

This information might help. It appears there's a restriction in using Yahoo Mail unlike other domains.

Yahoo! Mail

Currently, accessing Yahoo! Mail mailbox messages via POP3 is restricted to paying users of the Yahoo! Mail plus service. Other than that, most parameters are similar to Gmail and Hotmail, except that the user name should be just the account user name, thus without the @ character and the domain name.

$pop3 = new pop3_class;
 $pop3->hostname = "pop.mail.yahoo.com";
 $pop3->port = 995;
 $pop3->tls = 1;
 $user = "account";
 $password = "account password";
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56