Designing an embedded device to send email

Posted on 2006-04-10
Last Modified: 2008-03-03
I inherited a project from another engineer who left the company.  It's an embedded device (home appliance) that sends email (does not receive).  It installs in any home with DSL/cable/etc.  It is programmable by the installer.  I'm trying to learn all I can about SMTP authentication and have read all the pertinent RFCs, but questions remain.

Here's the way it DID work:
It can be programmed with-
 SMTP server IP address & port
 "From:" address
 "To:" address and message body

Of course, several customers complained it wouldn't work because their server required them to log in.  The original API available to me allowed for POP login, but not SMTP AUTH.  So I added another programmable option: Username/password.  If it is programmed with a username/password, it logs onto the POP server, then sends email (simple SMTP).  If there is no user/pass programmed, it just sends mail.  That fixed it for many customers, but not all.  Some required SMTP AUTH.

So, I got the latest API update which includes functions for SMTP AUTH.  If I can help it, I don't want to add any additional programming options. So...

If they require SMTP AUTH, I'll just use the username/password program fields already provided.  But this raises the following questions -
How do I know whether they require POP login before SMTP or just SMTP AUTH?
Can I just ALWAYS log in to the POP server, then try logging into the SMTP server?  Or will I need to make those options separate and selectable/programmable?
If I can attempt both, do I need to allow for two separate Username/passwords?  How many service providers require or allow them to be different?

Also, is it OK to use the domain in the "FROM:" address as the parameter to the EHLO command?  Or should that be a separate programmable option as well?

Depending on the answers I get to this, I may have a couple additional questions for clarification before closing this topic.
Question by:teduncan
    LVL 1

    Assisted Solution

    Well, you will have to have seperate options for authentication. They should be able to turn authentication on and off at will. Some smtp servers may reject you if you try to throw authentication at it. The Helo or EHLO command may not always work either due to some email server not allowing relaying. You will basically have to create all the options that Outlook Express has for connection and authentication if you want to be sure that most email servers will accept your email.

    Here is what I suggest you do, it will save you a lot of time...
    Setup your own mail server at your office there and create your equipment to send to it from anywhere. This cuts your development time down to zilch and guess what... no more unhappy customers and no more time spent dealing with tech support issues on this.

    The server could be really small if you do not expect to get a lot of email everyday. May only cost you $800 - $1,300 if it can be a small wimpy server. Will it take you 8 hours to develop all these options in your application, don't forget testing, debugging, tech support, documentation for users (And still customers may be unhappy) Might save you money to make it just use your own mail server. I bet your boss would think it was a great argument. I assume that you are using VB6 since you have answered questions on VB6... this can get scarey if you have to develop all of these options in VB6.

    Hope this helps
    LVL 18

    Accepted Solution

    I just looked at all my equipment that offers sending email.  Examples- Ricoh scanner, lanier copier/scanner, hplaserjet (wants to tell you it's out of supplies) , APC ups, triplite UPS, cheap netgear home router (wants to tell you your filtering policy was broken)
    AT BEST they offer configuration for SMTP AUTH
    not that many offer that, usually expect that the environment they are installed in has some way to accomodate the device rather than the other way around.

    So do you want your appliance to be better than these others?  Is it expected that the installer will be computer and server savvy.  

    Example- if your product is for the IT industry in some way, you are probably safe offering SMTP AUTH
    If however your product is a home consumer gadget, remember that-
    installer may not be able to find a ISP mail server,
    LVL 1

    Author Comment

    Sorry it's taken so long for my reply.

    I dread providing all the options Outlook does - not from a programming perspective, but from a user/installer's point of view.  I want to keep this device as simple as possible.

    Brent, I am a VB6 programmer, but this project is an embedded system written in C with calls into a real-time OS API.  My VB6 project communicates with and programs it.  If you're curious, the device is a network interface for a home automation/security system.

    We have a mail server here at work, but the IT guys won't let me change it's settings to test various options - obviously, that would affect the whole company.  I'd toyed with the notion of enabling the email server in IIS on my on machine.  Is that difficult to set up?

    Carl, thanks for the info on the other devices.  Yes, I want to make it smart - and automated and simple.

    Keeping is simple is the reason behind why I ask if I can just try logging into both the POP and SMTP servers - rather than providing options to select either.  If that is safe to do, then all they need to do is enter a username/password, and I'll attempt logging in to both.  Whichever one allows me to send email - who cares? As long as it works!  For the SMTP server, my login (plain/cram/etc) will depend on the servers response to ehlo.  And if they don't provide a username/password, I'll not try to log in to anything - just connect to the SMTP server and send mail.

    Do you know if there's any harm in doing this?
    LVL 1

    Author Comment

    Bumping this back up, hoping either Brent or Carl will answer my last question...
    LVL 1

    Author Comment

    Well, the project is done now.  What I did was ... if not user/password was entered, I simply try to send the mail w/o auth.  If user/password is provided, I attempt to log into the POP server, then the SMTP server with the same password.  Now, I know some unique servers require different passwords (the exception rather than the rule) - but as long as the SMTP login works, I don't care.  I only log into the POP server in case they're using POP before SMTP auth.

    Beta tests ran fine - no problems.  Product was released slowly - no tech calls about it so far.  Looks like I'm gonna be OK.

    Because Brent & Carl contributed equally (IMHO), I'll split points between you guys.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
    If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
    This Micro Tutorial demonstrates  how Internet marketers work with competitive analysis data, and a common task in data preparation is creating separate column for domains. You will then extract from a list of URLs.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now