Solved

SMTP, CFMAIL, and CF5 - authentication?

Posted on 2004-03-31
11
508 Views
Last Modified: 2013-12-24
How can I send a message from CF5 to an IIS SMTP virtual server that requires authentication? I need to lock down relaying so I don't become a spam zombie.
0
Comment
Question by:brianlees
  • 6
  • 4
11 Comments
 
LVL 5

Expert Comment

by:Seth_Bienek
ID: 10727494
I am fairly certain that the syntax for CF5x is:

<cfmail... server="mail.myserver.org" username="myusername" password="mypassword"... >

Take Care,

Seth
0
 

Author Comment

by:brianlees
ID: 10727530
Actually, it came back with a big fat no on that...I think it is only versions higher than 5.   I get the following CF error:

Error Diagnostic Information
Just in time compilation error

An unknown attribute 'username' has been encountered at document position (23:172) to (23:179) while processing tag CFMAIL. This tag can only take the following attributes:

BCC
CC
FROM
GROUP
GROUPCASESENSITIVE
MAILERID
MAXROWS
MIMEATTACH
PORT
QUERY
SERVER
STARTROW
SUBJECT
TIMEOUT
TO
TYPE
The last successfully parsed CFML construct was a CFMAIL tag occupying document position (23:1) to (23:7).
0
 
LVL 5

Expert Comment

by:Seth_Bienek
ID: 10727572

You might be hosed.  You can try the CFMX format, but I doubt it'll work.  Couldn't hurt, though:

<cfmail... server="username:password@mail.myserver.org">

Again, I'm 99% sure this will bomb, but without having CF5 running anywhere here, I can't test it myself.

Good luck!

Seth
0
 
LVL 1

Expert Comment

by:Joker1975
ID: 10734961
Can you get the mail server to trust the IP address of your CF server?

A long shot (I've never tried it) might be cfmailparam
http://livedocs.macromedia.com/coldfusion/5.0/CFML_Reference/Tags66.htm#1101294

Syntax
<cfmail   to = "recipient"  subject = "msg_subject"  from = "sender"  ...more attibutes... >
  <cfmailparam     file = "file-name" >
  or
  <cfmailparam     name = "header-name"     value = "header-value" >
  ...
</cfmail>

so you might be able to do something like
<cfmailparam name="username" value = "#form.username#">
<cfmailparam name="password" value = "#form.password#">

I don't know if it'll work, but I thought it was worth mentioning
0
 

Author Comment

by:brianlees
ID: 10734983
The mail server is on the same box as the CF server.  It is just the standard SMTP virtual server in IIS.  Anonymous is turned off, so I need to authenticate.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 5

Expert Comment

by:Seth_Bienek
ID: 10735019
You can go into your SMTP settings and allow anonymous connections from 127.0.0.1, and you'll be good to go!
0
 

Author Comment

by:brianlees
ID: 10735041
...and I would have to ensure that our firewall is set up to restrict telnet on port 25 to the box?  I mean, if you telnet on port 25, aren't you now "local"?
0
 
LVL 5

Expert Comment

by:Seth_Bienek
ID: 10735076
No, it would actually require authentication, unless the remote IP was 127.0.0.1 (loopback ip).

All telnetting on port 25 does is open a direct connection to the smtp server.  You could technically send an email this way, but you would either need to authenticate or be connecting from the server itself for even this to work.

Make sense?

Seth
0
 

Author Comment

by:brianlees
ID: 10735096
So the loopback is only for "connections" originating from the machine, am I correct?
0
 
LVL 5

Accepted Solution

by:
Seth_Bienek earned 50 total points
ID: 10735111
...As a note, ANY incoming connections to port 25 on that server should be blocked anyway, since you don't use the server for sending mail from anything but itself.

So, if you have a firewall, by all means block incoming connections to that port (just for added security), and any others that you do not explicitly need.

Outgoing connections for port 25 will need to remain open though.

Seth
0
 
LVL 5

Expert Comment

by:Seth_Bienek
ID: 10735124
Yes.

127.0.0.1 is a loopback IP for pretty much any machine (all OS's that I know of).

Seth
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Time Sheet Help 6 34
SCCM vs Windows server 5 72
whm high memory usage in processes 7 37
cookies analysis tools 2 26
A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 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

19 Experts available now in Live!

Get 1:1 Help Now