2

I am trying to send email through OpenSSL as below :

Client > openssl s_client -crlf -connect smtp.mail.yahoo.com:465
SERVER > 220 smtp.mail.yahoo.com ESMTP ready
Client > HELO localhost
SERVER > 250 smtp.mail.yahoo.com
Client > auth login
SERVER > 334 VXNlcm5hbWU6
Client > aC5rYW1yYXZh
SERVER > 334 UGFzc3dvcmQ6
Client > bXlQYXNz // It's not my real password :)
SERVER > 235 2.0.0 OK
Client > MAIL FROM: <h.kamix@yahoo.com>
SERVER > 250 OK , completed
Client > rcpt to: <h.kamix1@gmail.com>
SERVER > 250 OK , completed
Client > data
SERVER > 354 Start Mail. End with CRLF.CRLF
Client > subject: Test title
Client > Hello this is a test email.
Client > .
Client > 
SERVER > 250 OK , completed
Client > quit
SERVER > 221 Service Closing transmission
SERVER > closed

Everything looks fine, but it doesn't send any email and gets me Service Closing transmission error at the last step!

I think it's clear enough.

Please tell me what am I missing here?

  • 1
    `gmail.com` is notorious for just having mail disappear into the ether for unspecified reasons. Have you tried delivering email to another yahoo account that way, or indeed to your own? That would be a better test for whether the issue is in the sending or the receipt. – MadHatter May 13 '14 at 16:25
  • Your right. It sent email to yahoo account. But why doesn't sent email to gmail accounts? – Hamed Kamrava May 13 '14 at 16:28
  • It does; gmail then doesn't put it in the recipient's INBOX, for reasons known only to google. I'm afraid the best answer we can provide is in our canonical question [How to send emails and avoid them being classified as spam](http://serverfault.com/questions/48428/how-to-send-emails-and-avoid-them-being-classified-as-spam), and I'm voting to close as a duplicate thereof. – MadHatter May 13 '14 at 16:30
  • 3
    `221 Service Closing transmission` is the correct response to `QUIT`. As to why the email isn't going anywhere, I'm guessing since your example email is fairly invalid (body not separated from headers by a blank line, no `From:` header, no `To:` header) it's getting marked as spam. – DerfK May 13 '14 at 16:31
  • @MadHatter Gmail doesn't count it as Spam email. Gmail does not get that email at all! – Hamed Kamrava May 13 '14 at 16:34
  • 2
    Hamed, you don't know that. From the tests you've done, it seems very likely that the mail is being delivered to gmail; all we know for certain is that it doesn't show up in the recipient's INBOX. Without access to the logs on either yahoo or google, you can't tell the difference between the two situations. – MadHatter May 13 '14 at 16:35
  • @MadHatter Please say that as an answer I will choose your answer as the best :) – Hamed Kamrava May 13 '14 at 16:44

1 Answers1

2

You've tested sending email to yahoo the same way, and that gets through.

All the evidence, then, is that sending this way works fine. What is much more likely is that google is receiving the mail you send this way, but simply not putting it in either the recipient's INBOX or spam folder. Google are fairly notorious for just having emails disappear into the ether.

Sadly, without access to the mail logs on either end, you have no way of telling what's actually happening. This is one of many reasons why outsourced email isn't a very good idea, despite the way modern businesses are in love with it.

The collected wisdom of ServerFault on the subject of how not to have your emails eaten by google can be found in the answers to this question; we can't say more than that on the subject, I'm afraid.

MadHatter
  • 78,442
  • 20
  • 178
  • 229