Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sending From Non-authenticated 365 Email

Posted on 2014-02-09
15
Medium Priority
?
1,724 Views
Last Modified: 2016-11-23
This may be a dumb question, as I am basically asking how to spoof an email address.  In this case, the spoofing actually serves a functional purpose.  

Here is what I am trying to do:

I have dell's help desk/computer management software called "Kace".  Kace allows users to submit tickets via email to create cases.  Instead of having users create tickets through email, I want to create a one-click solution that will allow users to alert IT staff of an issue by clicking a button.

Email setup:
We use office 365 to host our email
Kace connects to a help desk account in 365 using POP3
Kace uses this account when creating tickets and sending updates to the submitter

The one-click solution:
A user clicks a button on a php page, and an email is sent to the help desk address that is then picked up by Kace to create a ticket.  
The user gets an email stating that the ticket has been created.

Problems:
When the user clicks the button, I can identify their email address, but I cannot send an email using this account without asking the user for their 365 credentials.

Question:
Could I configure a 365 account to allow this type of non-authenticated mail to reach its inbox?

Please let me know if I need to provide any additional information.  Thanks for reading.
0
Comment
Question by:thedeal56
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
15 Comments
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39846377
You would simply send with the name as the user's email, but the sending credentials would be something generic like your own email or "admin@" etc.  Their ticketing system will sense the "from" address, not the credential.  What you are asking about is common and I do the same for a similar situation.
0
 

Author Comment

by:thedeal56
ID: 39846393
Thanks for the fast reply.  That's really good news.  Is this what you're talking about?
$mail = new PHPMailer();
    $mail->IsSMTP(); // set mailer to use SMTP
    $mail->Host = "smtp.office365.com"; // specify main and backup server
    $mail->SMTPAuth = true;
    $mail->Port = 587;
    $mail->SMTPSecure = "tls";
    $mail->SMTPAuth = true; // turn on SMTP authentication
    $mail->Username = "helpdesk@domain.com"; // SMTP username
    $mail->Password = "somepassword"; // SMTP password
    $mail->From = "helpdesk@murfreesborotn.gov"; // the authenticated account
    $mail->FromName = "theuseremail@domain.com"; // the user's email ?
    $mail->AddAddress("helpdesk@domain.com"); // Address you're sending to

Open in new window

0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39846405
These two lines can be from the user filling out your form or however you have authenticated them and just using their address

    $mail->From = "helpdesk@murfreesborotn.gov"; // the authenticated account
    $mail->FromName = "theuseremail@domain.com"; // the user's email ?

Can use variables for whatever you want

    $mail->From = User_email_address // the authenticated account
    $mail->FromName = User_full_name_or_email_address; // the user's email ?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:thedeal56
ID: 39846408
I was trying that out, but I was running into an issue where the authenticated account didn't have permissions to send as the from address.  I will try this again real quick just to make sure. Thank you.
0
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39846417
The authentication needs to be your office365 domain.  If you have an office365 account for helpdesk@yourdomain.com and use that password it should work.

I am not as well versed in php.  In asp when I send via CDO there are some extra parameters for authentication.  I use http://www.paulsadowski.com/wsh/cdo.htm
0
 

Author Comment

by:thedeal56
ID: 39846419
Just to confirm, If I authenticate as one user, but attempt to send as another user, I get this error:

SMTP Error: data not accepted.

I haven't displayed the logs to go deeper on this error, but I suspect it has to do with incorrect send as permissions.
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39846423
Do you have permissions set to allow for smtp relay?
0
 

Author Comment

by:thedeal56
ID: 39846426
I'm not sure if there are specific relay options per account on the 365 side, but if I run my script where I send from the account I authenticate with, I do get the emails.
0
 

Author Comment

by:thedeal56
ID: 39846429
I enabled the verbose logging just to see the actual error I was getting:

Client does not have permissions to send as this sender
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39846457
Is the sender's address an actual paid account?  Or just an alias?  

I don't have a way to test this anymore.  My client switched to google apps.  

If you go to users and groups, https://portal.microsoftonline.com/UserManagement/ActiveUsers.aspx will you see the "from" address in this list?

Based on this, http://technet.microsoft.com/en-us/library/dn554323.aspx, I wonder what would happen if you tried it without authentication as long is the IP belongs to the domain.
0
 

Author Comment

by:thedeal56
ID: 39846466
The sender's address is an actual account, and it does show up in that list.  I will look further into connection unauthenticated, but here's the message I got from dropping the authentication:

MAIL FROM command failed,530,5.7.1 Client was not authenticated

Do you think it would be possible to use a gmail account for the initial email? Could this restriction on sending as another address be a security measure that 365 has taken? Thanks so much for your help with this.
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39846477
I know it works in google apps.  Like I said, I can't get into the office365 domain I used to.

What about going to Exchange Admin, on the left click on Protection, then the top menu in the middle, Connection.  From there you can scope the ip from your webserver.
0
 

Author Comment

by:thedeal56
ID: 39846494
I ended up trying this setting:

authenticate and send from the same user, but add a reply to variable
$mail->AddReplyTo('useremail@domain.com', 'Some User');

Open in new window


Everything seems to work fine now.  Thank you very much!
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39846516
That is the easy way....!  

Glad it works.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
This Experts Exchange lesson shows how to use VBA to loop through rows in Excel.  In order to sort, filter, and use database features, there needs to be a value in each column for every row. When data arrives with values missing, code to copy values…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…
Suggested Courses

596 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