Does Gmail support RFC 821? I know it is using ESMTP. Based on understanding ESMTP is RFC 1869. But I must use RFC 821 commands with C# and want to test it. If Gmail doesn't provide support, is there any server provides this service for developers?
Thanks in advance
RFC1869 defines a set of extensions to the SMTP protocol that a server can support. They come in addition to the standard SMTP protocol described in RFC 821. In other words, any server that supports RFC 1869 must also support RFC 821. The newer standard makes this explicit:
4.1. Changes to STD 10, RFC 821
This specification is intended to extend STD 10, RFC 821 without
impacting existing services in any way. The minor changes needed are
enumerated below.
If a client connects to such a server and issues a standard HELO command, it should get a server that speaks SMTP. If you need to use any of the SMTP extensions, though, you need to instead issue the extension command EHLO, which indicates a client that also speaks RFC1869.
However, just because the server speaks SMTP doesn't mean it's going to speak it with you. In particular, the server may require authentication as per RFC 4954 (e.g. require an AUTH LOGIN or similar command, or a STARTTLS command for encrypted communication). If you fail to properly authenticate before issuing a command, the server could legally send an SMTP error. While this error would be a legal SMTP response per RFC 821, that's probably not going to help you out very much.
RFC 1869 (ESMTP) is a refinement of RFC 821 (SMTP), not a separate protocol. You can still talk basic SMTP to an ESMTP server -- in fact, ESMTP servers are required to support it.
Since it sounds like you're trying to build something that interoperates with GMail SMTP, keep in mind that it's not intended for use by anything other than a desktop mail client. Trying to send bulk mail via GMail will end badly.
Almost all Internet Service (connectivity) Providers (ISPs) offer an SMTP server for their customers to use to send email. Your ISP's help page undoubtedly explains how to do this -- it probably mentions something like smtp.comcast.net or smtp.whatver.net.
It is quite likely, though, that they won't let you send more than a certain number of email messages per day through that port. And, they certainly won't let you send any messages through it unless you're on a machine on their network.
You may also be able to use gmail's smtp server. But, in order to do this your client software will need to be able to use TLS, port 587, and authentication (using your gmail username and password). See here:
http://support.google.com/mail/bin/answer.py?hl=en&answer=86374
This need for authenticated and encrypted communication with the smtp server could prove to be quite a pain in the neck for your work of debugging. Best to find an open SMTP server you can test things with.
The good news: RFC821 is pretty doggone simple.
Yahoo can send email to rfc821 mail server.
And another tool that is amazin is https://www.wormly.com/test_smtp_server
Related
I'm developing an ASP.NET MVC application that needs to transmit sensitive information via email. I'm aware of using S/MIME to encrypt the email contents end-to-end, but I cannot use it for various reasons. I also realize, however, that the emails would be sent in plain-text from the web host's SMTP server to the destination email servers, opening up a serious man-in-the-middle vulnerability. Therefore, I need to ensure that the outgoing SMTP server will transmit a message ONLY IF it can establish a TLS/SSL connection with the destination mail server.
I've been searching for a while and can't even figure out where in the process that decision is made. Most answers address enforcing TLS between the application and the SMTP server, which I've already solved. Can anyone shed some light on this? Thanks.
What you are trying to do is not possible. Once you've submitted the mail to the mail server you've lost control over it. There is no way to instruct the server (and all following server in the path) to only deliver the mail with TLS.
I'm trying to understand exactly what it is I need to be implementing and am just after a little guidance. I know very little about email standards such as POP3, IMAP, SMTP which is probably what's making the getting started difficult.
What'd I'd like to do consists of a couple of things:
Be notified of the arrival of an email at a specific custom address. e.g. hi.me#myapp.com.
Handle multiple addresses per user.
Be able to process this email and either delete it, leave it and be able to display in a web email client or forward it on based on various rules.
I've seen a few SMTP libraries and a POP3 one, but I'm not 100% sure what I need to do this. I'm guessing the best way would be to write a full C# mail server - but I'm hoping for a little guidance/suggestion.
Thanks
If you really want to build a mailserver from scratch, the protocol specifications are all available as RFCs.
For IMAP that would be RFC-3501 and for SMTP RFC-2821, you can google for the rest.
I've been working on a C# SMTP server in my (very limited) spare time, mostly out of frustration with existing MTAs and as an exercise in C# server programming. I can tell you that there's a bit more to it than you might think. So if you want fast results, I'd seriously consider hooking into an existing MTA/mailserver setup.
Depending on how fast you want to process messages, it may be sufficient to poll one or more mailboxes. You could process the messages and, for example, forward them to another mailbox using the built-in .NET SmtpClient.
On top of that, all mail servers I know of implement not just the SMTP protocol but also a slew of anti-spam measures. Most of these measures have matured over many years. You get all that for free if you build on top of an existing mail server infrastructure.
Then again, configuration of just about any mail server I know seems to be a fine art, hence my frustration with them.
I have been able to send mails from my own domain successfully. My problem now is that I need to access the account and retrieve all the mails that I receive from postmaster and process the information in the mail.
How can I do this? I have been searching the web but could only find solutions involving third party libraries. .NET doesn't bring an inbuild class that helps with this?
First you need to understand what protocols does the Mail Server in question support.
You can find this by either reading the help that accompanies it or search in Google for that Mail Server. You may also need to set some settings on the server before you can start coding.
After you understood what protocols your server supports, use some of the following:
If you are using a POP3 server, you may fine the following article useful : A POP3 Client in C# .NET
If you are facing IMAP or Exchange server, you may want to the link that Billy Coover gave you: Read MS Exchange email in C#
What type of email server are you working with? If it's exchange, there are some options: Access exchange e-mail in C#
First you can try to dedect what protocols(IMAP/POP3) supported by remote server.
You can try imap_clinet_app.zip or pop3_client_app.zip applications from http://www.lumisoft.ee/lsWWW/download/downloads/Examples/ to connect your server.
If you can connect, then specified protocol supported.
Both application comes with full source code, so if can use IMAP or POP3, you can use that library in your project.
Is it possible to find POP3 server address for any given email id (like sam#mycustomdomain.com)? If yes, please provide some guidance preferably in PHP or .Net.
Edit :
I get addresses by querying MX record but those are not always the same which people use to fetch their emails.
I don't think you can "guess" the POP3 server for any email address and be right each time, no : the POP3 server can either :
be something like pop.thedomainnameintheaddress
or something totally different, like ssl.hostingcompany.com
In the first case, you could try to guess -- and sometimes be right... But in the second, you don't stand quite a chance.
You might want to take a look at Thunderbird 3 : I think it includes some auto-configuration mecanism about that : you enter your e-mail address, and it tries to find the POP server for your.
Not sure how it works, but I suppose there is a database containning that kind of informations, that Thunderbird sends requests to ; that would be the "best" solution, I'd say, as it can be updated without having to change Thunderbird itself, and doesn't rely on "guessing".
About Thundrbird's autoconfiguration mecanism, here's an interesting link : https://wiki.mozilla.org/Thunderbird:Autoconfiguration#Implementation -- especially the third point, which links to a directory where you can find configuration files for lots of domains.
For instance : https://live.mozillamessaging.com/autoconfig/gmail.com
Gets you an XML file indicating how Thunderbird has to be configured for #gmail.com emails.
And there's quite a couple of configuration files for other domains -- so this might be an interesting idea, at least for "well-known" domains ;-)
Of course, this doesn't solve the problem for non-well-known domains...
I don't think so; at least, not in a general way. Emails are just forwarded on to the right domain, and handled internally. For instance, my email address is stored on a server that provides both IMAP and POP access, and also forwarded to a webmail provider, who provide IMAP and POP access. So the question 'what's its POP3 server?' doesn't really make sense.
No, not really. It is however possible to find an smtp server for an email address. It is really not specific to any programming language, but the way you would go about it would be extract domain from email address (eg. me#somedomain.com => somedomain.com) and then make a dns query with type=MX. This will return the servers that accept mails for that domain, in order of priority.
If the question is, "For any given email address is there an automatic way to find the address of a POP3 server for it?" I'd say the answer is no.
Some people perhaps don't have POP3 access to their emails at all, and many people such as myself have our own domain hosted at a service provider and the POP3/IMAP servers are under the service provider's domains.
As part of my app's config process, I have a sanity checker that validates all user-supplied data. This includes email server settings that the app uses to send email.
I'd like a simple sanity check on those settings without actually sending any email. It'd be great if this could support all standard flavors of SMTP setups including those with authentication/ssl/etc.
It doesn't need to be exhaustive but the more coverage, the better.
Currently all I do is verify I can open a connection to the given server on the given port. Something a little deeper would be nice.
Note: I'm not trying to validate email addresses--that's not relevant to this question.
You just open a raw connection to the server & port that the user supplies and do a
HELO Server.Domain.Com
Mail From: validaccount#domain.com
to see if you get a valid HELO response & Sender OK Response
(if smtp authentication is enabled).
Same as you would do if you telnet direct to the server.
http://www.petri.co.il/test_smtp_service.htm
This might also be useful
http://qmail.jms1.net/test-auth.shtml
I'm sure someone brighter and more qualified will pipe up with a better answer. However, at first blush I'd say that you cannot verify the ability to successfully send email without actually sending an email.
However, if you want to automate the process, you can have a 'MyApp_SanityCheck#gmail.com' (or your local domain) address.
Then you can create a watchdog application that monitors that email address, or just a simple app which programmatically interfaces with that email address and checks if an email was received within X minutes. This way you can be 100% certain that the emails are able to be sent out.
This link shows how to programmatically check gmail addresses.
An important note: If you application is sending out external emails, then it would be best if the email address you use is external, because it is possible that your server could be unable to send external emails, but internal emails go through just fine, and in that case your sanity check would send up a false positive.