Posts Tagged ‘Yahoo!’

Yahoo SMTP 8 BITMIME bug

Tuesday, February 17th, 2015

It’s sometimes hard to believe, that even the biggest make such mistakes.

Here’s the capability (EHLO) response from Yahoo’s SMTP server:

S: 220 smtp.mail.yahoo.com ESMTP ready
C: EHLO [192.168.0.11]
S: 250-smtp.mail.yahoo.com
S: 250-PIPELINING
S: 250-SIZE 41697280
S: 250-8 BITMIME
S: 250 STARTTLS

Can you spot the problem? It’s not that easy, and it has been brought to my attention by one of our customers:

S: 220 smtp.mail.yahoo.com ESMTP ready
C: EHLO [192.168.0.11]
S: 250-smtp.mail.yahoo.com
S: 250-PIPELINING
S: 250-SIZE 41697280
S: 250-8 BITMIME
S: 250 STARTTLS

It supposed to be: 8BITMIME, at least according to RFC6152

the EHLO keyword value associated with the extension is 8BITMIME;

Most annoying part is that in many cases, space is used to split extensions keyword and its parameters e.g. SIZE 41697280. We want Mail.dll to be robust enough to accept custom extensions or extensions unknown yet, that follow this standard.

Shame on you Yahoo!.

SENTBEFORE doesn’t work correctly on Yahoo IMAP server

Friday, June 13th, 2014

Expression.SentBefore doesn’t work correctly on Yahoo IMAP server.

IMAP protocol equivalent of this expression is SENTBEFORE. It examines email’s Date: header.

It appears that although SENTSINCE doesn’t work, SENTSINCE (Expression.SentSince), BEFORE (Expression.Before) and SINCE (Expression.Since) do work correctly. BEFORE and SINCE use email’s INTERNALDATE recorded by the IMAP server instead of Date: header.

C: 0895789b79c64868 UID FETCH 14622 (UID RFC822.SIZE INTERNALDATE ENVELOPE)
S: * 1 FETCH (UID 14622
INTERNALDATE "10-Jun-2014 13:02:08 +0000"
ENVELOPE ("Wed, 10 Jun 2014 15:02:08 +0000" "test2" NIL NIL NIL NIL NIL NIL NIL NIL))
S: 0895789b79c64868 OK UID FETCH completed
C: 2b535791f07e4515 UID SEARCH BEFORE 12-Jun-2014
S: * SEARCH 14622
S: 2b535791f07e4515 OK UID SEARCH completed
C: b726a850e61c4082 UID SEARCH SENTBEFORE 12-Jun-2014
S: * SEARCH
S: b726a850e61c4082 OK UID SEARCH completed
C: 3e479e518dc04915 UID SEARCH BEFORE 13-Jun-2014
S: * SEARCH 14622
S: 3e479e518dc04915 OK UID SEARCH completed
C: 31b7f9ffbe4f4934 UID SEARCH SENTBEFORE 13-Jun-2014
S: * SEARCH
S: 31b7f9ffbe4f4934 OK UID SEARCH completed
C: 2fd2d29b90a24f16 LOGOUT
S: * BYE IMAP4rev1 Server logging out
S: 2fd2d29b90a24f16 OK LOGOUT completed

The fact is that Yahoo IMAP implantation is buggy. Once, the server assigned “17-Jan-1970 05:37:46 +0000” as an INTERNALDATE to one of my emails, just to change that on the next login.

Yahoo: IMAP, POP3, and SMTP settings

Friday, December 14th, 2012

Yahoo supports access via IMAP, POP3 and SMTP protocols. Below you can find the configuration settings for all protocols.

All Yahoo servers (IMAP, POP3 and SMTP) don’t use SSL (you can use Connect method) or use implicit SSL (use ConnectSSL method). IMAP and POP3 servers additionally support explicit SSL (you can use Connect method and then secure the channel using StartTLS or STLS methods)

IMAP

Server: imap.mail.yahoo.com
SSL: true-implicit
Port: 993 (default)
User: pat@yahoo.com

POP3

Server: pop.mail.yahoo.com
SSL: true-implicit
Port: 995 (default)
User: pat@yahoo.com

SMTP

Server: smtp.mail.yahoo.com
SSL: false / true-implicit
Port: 587 (default) / 465 (default)
User: pat@yahoo.com

Following are the code samples for Mail.dll .NET IMAP, POP3 and SMTP component.

// C#

using (Imap client = new Imap())
{
    client.ConnectSSL("imap.mail.yahoo.com");
    client.UseBestLogin("pat@yahoo.com", "password");
    ...
}

using (Pop3 client = new Pop3())
{
    client.ConnectSSL("pop.mail.yahoo.com");
    client.UseBestLogin("pat@yahoo.com", "password");
    ...
}

using (Smtp client = new Smtp ())
{
    client.ConnectSSL("smtp.mail.yahoo.com");
    client.UseBestLogin("pat@yahoo.com", "password");
    ...
}
' VB.NET

Using client As New Imap()
	client.ConnectSSL("imap.mail.yahoo.com")
	client.UseBestLogin("pat@yahoo.com", "password")
	...
End Using

Using client As New Pop3()
	client.ConnectSSL("pop.mail.yahoo.com")		
	client.UseBestLogin("pat@yahoo.com", "password")
	...
End Using

Using client As New Smtp()
	client.ConnectSSL("smtp.mail.yahoo.com")
	client.UseBestLogin("pat@yahoo.com", "password")
	...
End Using

You can find more details about using implicit and explicit SSL or TLS with email protocols:

Free Yahoo! Mail via IMAP

Sunday, May 30th, 2010

Update: Mail.dll issues custom ID command automatically, when it recognizes you are accessing yahoo server.

It is possible to get direct Yahoo! IMAP access.
Yahoo! operates IMAP servers (imap.mail.yahoo.com in particular), which are globally accessible.
However they require a specific, but non-standard IMAP command to be sent before login is done. The command is: “ID (“GUID” “1”)”

// C#
imap.SendCommand(@"ID (""GUID"" ""1"")");
' VB
imap.SendCommand("ID (""GUID"" ""1"")")

You can also use IMAP over SSL on the standard port 993.

Here’s the full C# version of the code:

using (Imap imap = new Imap())
{
	imap.ConnectSSL("imap.mail.yahoo.com");

	// Not needed as Mail.dll is going to issue this command automatically
	// imap.SendCommand(@"ID (""GUID"" ""1"")");

	imap.Login("user", "password");

	imap.SelectInbox();
	List<long> uidList = imap.Search(Expression.All());
	foreach (long uid in uidList)
	{
		IMail email = new MailBuilder()
    			.CreateFromEml(imap.GetMessageByUID(uid));
		Console.WriteLine(email.Subject);
	}
	imap.Close();
}

and VB.NET version:

Using imap As New Imap()
	imap.ConnectSSL("imap.mail.yahoo.com")

	' Not needed as Mail.dll is going to issue this command automatically
	'imap.SendCommand("ID (""GUID"" ""1"")")

	imap.Login("user", "password")

	imap.SelectInbox()
	Dim uidList As List(Of Long) = imap.Search(Expression.All())
	For Each uid As Long In uidList
		Dim email As IMail = New MailBuilder() _
			.CreateFromEml(imap.GetMessageByUID(uid))
		Console.WriteLine(email.Subject)
	Next
	imap.Close()
End Using

Yahoo’s IMAP server differences:
– non-standard command ID command is required before any other command,
– Examine explicitly requires CLOSE command (Imap.CloseCurrentFolder), otherwise subsequent SELECT (Imap.Select) has no effect and mailbox is still in read-only stat,
-Yahoo does not support IDLE command,
– SELECT for not existing folder does not create new folder.

You can download the latest version of Mail.dll .NET IMAP component here