more G-Labs products

Author Topic: email (yahoo/gmail) won't work  (Read 3272 times)

August 22, 2014, 02:58:07 AM
Read 3272 times

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I set the email account widget up for yahoo and tried to send a message.  Nothing made it to email.  I installed tcpdump and watched port 465 and HG is communicating.  I don't know how to interpret the packets nor how the setup is wrong.  If anyone could help, I'd appreciate.  My test code is very simple:

Code: [Select]
bool sent = Net.SendMessage("<account>@yahoo.com","HG test email","If you see this, email work!");

if (sent)
{
    Program.Notify("email test", "Mail sent");
}
else
{
  Program.Notify("email test", "Mail error");
}

Code: [Select]
pi@raspberrypi ~/log $ sudo tcpdump -i eth0 -s0 port 465
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
17:55:39.852795 IP raspberry-pi.59225 > vcs-smyc.mail.vip.bf1.yahoo.com.ssmtp: Flags [S], seq 3705753041, win 14600, options [mss 1460,sackOK,TS val 46277942 ecr 0,nop,wscale 6], length 0
17:55:39.953259 IP vcs-smyc.mail.vip.bf1.yahoo.com.ssmtp > raspberry-pi.59225: Flags [S.], seq 2870624399, ack 3705753042, win 14480, options [mss 1460,sackOK,TS val 2015838895 ecr 46277942,nop,wscale 7], length 0
17:55:39.953480 IP raspberry-pi.59225 > vcs-smyc.mail.vip.bf1.yahoo.com.ssmtp: Flags [.], ack 1, win 229, options [nop,nop,TS val 46277952 ecr 2015838895], length 0
17:56:40.052355 IP vcs-smyc.mail.vip.bf1.yahoo.com.ssmtp > raspberry-pi.59225: Flags [F.], seq 1, ack 1, win 114, options [nop,nop,TS val 2015898994 ecr 46277952], length 0
17:56:40.054056 IP raspberry-pi.59225 > vcs-smyc.mail.vip.bf1.yahoo.com.ssmtp: Flags [F.], seq 1, ack 2, win 229, options [nop,nop,TS val 46283962 ecr 2015898994], length 0
17:56:40.153042 IP vcs-smyc.mail.vip.bf1.yahoo.com.ssmtp > raspberry-pi.59225: Flags [.], ack 2, win 114, options [nop,nop,TS val 2015899095 ecr 46283962], length 0

August 22, 2014, 11:43:24 AM
Reply #1

ado464

  • **
  • Information
  • Jr. Member
  • Posts: 32
even tho it says port 465, test port 25 with ssl true and false and repport back :)

August 22, 2014, 03:56:13 PM
Reply #2

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
looks like no response on port 25.

yahoo:
Code: [Select]
2014-08-22T06:55:45.4124340-07:00       HomeAutomation.HomeGenie.Automation    NetHelper        Message could not be sent.      Exception.StackTrace      at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x00000] in <filename unknown>:0
  at HomeGenie.Automation.Scripting.NetHelper.SendMessage (System.String from, System.String recipients, System.String subject, System.String messageText) [0x00000] in <filename unknown>:0

gmail:
Code: [Select]
2014-08-22T07:22:16.7703800-07:00       HomeAutomation.HomeGenie.Automation    NetHelper        Message could not be sent.      Exception.StackTrace      at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x00000] in <filename unknown>:0
  at HomeGenie.Automation.Scripting.NetHelper.SendMessage (System.String from, System.String recipients, System.String subject, System.String messageText) [0x00000] in <filename unknown>:0
« Last Edit: August 22, 2014, 04:23:07 PM by bkenobi »

August 23, 2014, 10:20:01 PM
Reply #3

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I found a guide for manually sending an email using openssl.  I was successful in sending a message with yahoo's smtp server from my raspi, so I know it can be done.

Code: [Select]
pi@raspberrypi ~ $ openssl s_client -crlf -connect smtp.mail.yahoo.com:465

...

220 smtp.mail.yahoo.com ESMTP ready
ehlo test
250-smtp.mail.yahoo.com
250-PIPELINING
250-SIZE 41697280
250-8 BITMIME
250 AUTH PLAIN LOGIN XYMCOOKIE
auth plain base64.encoded.username.and.password
235 2.0.0 OK
mail from: [email protected]
501 Syntax error in arguments
mail from <[email protected]>
501 Syntax error in arguments
mail from: <[email protected]>
250 OK , completed
rcpt to: <[email protected]>
250 OK , completed
data
354 Start Mail. End with CRLF.CRLF
from: me
to: me
subject: test

manual email test
.
250 OK , completed
quit
221 Service Closing transmission
closed
pi@raspberrypi ~ $

https://qmail.jms1.net/test-auth.shtml

So then it looks like either I have the wrong settings or HG isn't sending them to the smtp server correctly.

September 08, 2014, 12:59:25 PM
Reply #4

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
There is a similar question and possible solution in another thread here (in case someone is following this thread and not the other):

http://www.homegenie.it/forum/index.php?topic=223.msg1911#msg1911

September 08, 2014, 03:00:20 PM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I should have finished off this thread, but forgot.  The other thread does in fact work around the issue of HG not being compatible with implicit SSL by using explicit SSL.  I did not see that documented as available on yahoo or Gmail, so hopefully support will remain.