?
Solved

SMTP, CFMAIL, and CF5 - authentication?

Posted on 2004-03-31
11
Medium Priority
?
557 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
[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
  • 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
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 
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
 
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 200 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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 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