Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Coldfusion administrator Mail > Maintain a connection

Explorer ,
Nov 20, 2012 Nov 20, 2012

I host my own server and have 2 clients who I use SENDGRID as an SMTP host for.

Each client gets their own username and password and sends mail through smtp.sendgrid.net.  In my application I add the server, username and password tag into the cfmail tag to route those emails directly bypassing my cfadmin settings.

I recently discovered a program where messages from "client 1" and showing up as being send as "client 2". 

After speaking with sendgrid regarding the problem, they have their logs showing that the session is being authenticated as client2 and not client 1 and that their system is appropriately storing them based off that data.

Out of a batch of 3000 emails sent by client 1, 65 of them are attributed to client 2.

After looking around, the only thing I was able to consider was the Cfadmin maintain connection option under mail.

I was wondering, if anyone knows the criteria to which coldfusion keeps the connection open for.  If my theory holds correct, coldfusion only checks for a SMTP server and ignores the username/password when maintaining an option connection.  So if a email from client 1 opens the connection, and then it stays open, an email from client 2 may slip into the outgoing batch.

For right now, I unchecked the maintain open connection tab to see if that has an effect, but I fear it will hog resources on a larger batch of messages.

Going on the above theory on server names, I'm in the process of setting up an alternate DNS record with a cname so that I can use "sendgrid.mydomain.com" to reference smtp.sendgrid.net.  I'm hoping that is enough to allow coldfusion to create a connection to the new server and allow me to use the maintain open connection tab.

Any insight?

1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 24, 2012 Nov 24, 2012

I recently discovered a program where messages from "client 1" and showing up as being send as "client 2"....Out of a batch of 3000 emails sent by client 1, 65 of them are attributed to client 2.

Could you please explain what you mean by showing up as being send as "client 2" and attributed to client 2? Does the cfmail tag have from="client1_e-mail_address", yet the receiver sees instead from="client2_e-mail_address"?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 26, 2012 Nov 26, 2012
LATEST

Thanks for the reply.

I have signed up my clients with Sendgrid.com to SMTP relaying account.  Each client is issued their own username/password, to send emails through their own accounts.  They are each completely independant of each other and their only common interest is that they are both hosting on my server.

Inside client 1 I have mailing routines such as

<cfmail to="#email#" from="#from" subject="#subject#" type="html" server="smtp.sendgrid.net" username="client1username" password="client1Password" query="getList">

message body

</cfmail>

and

<cfmail to="#email#" from="#from" subject="#subject#" type="html" server="smtp.sendgrid.net" username="client2username" password="client2Password" query="Newsletters">

message body

</cfmail>

What I am finding is that if both clients send a mailing at the same time, their mail builds up in the spool folder (like normal)... it is potentially possible that 25000 messages may be in the spool at once.

When coldfusion goes to deliver those messages while the "keep connection alive" is checked, I am finding that since the SMTP servers are the same, it will pass both clients through the same connection without checking to see which username/password was used to authenticate the open connection to the server.

So my theory is that if "client1username" was used to authenticate the connection to sendgrid, it keeps it open for all connections to sendgrid, and delivers all the messages from client1 and client2 rather than opening a 2nd connection for the "client2username".

As a workaround, in my DNS I created a cname for one of my clients to reference smtp.sendgrid.net so that I could edit their server as sendgrid.domainname.org and update the server tag is cfmail.  Since both domains are no longer sending through "smtp.sendgrid.net", it is allowing CF to create a new connection.

steve

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources