Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Security

 AfterLogic Forum : MailBee.NET Security
Subject Topic: SendMailMerge & DomainKeys DKIM Signing Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
zeta
Newbie
Newbie
Avatar

Joined: 02 June 2010
Online Status: Offline
Posts: 4
Posted: 02 June 2010 at 5:58pm | IP Logged Quote zeta

Hi,

I've been testing the DKIM signing
(DomainKeys.Sign) features and they work great
whenever I send(Smtp.Send) the emails.

But when it comes to using SendMailMerge
instead of Send, the emails that are being
sent are failing the DKIM test.

I execute those functions in the following
order:

smtp.Message = dk.Sign(smtp.Message, null,
privateKey, false, "selector");
smtp.SendMailMerge(null, null, dt);

And I believe that when SendMailMerge is
called, it changes the original message which
was signed to begin with, and turns it into an
unsigned one.

Is there a way to use both methods
concurrently? Or use SendMailMerge to send
signed emails?
Back to Top View zeta's Profile Search for other posts by zeta
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 5931
Posted: 03 June 2010 at 4:36am | IP Logged Quote Igor

The important thing about using DomainKeys is
that you can't modify a message after signing it
- but that's exactly what SendMailMerge is
doing. So, if you'd like to use mail merge for
messages signed with DomainKeys, then you need
to run mail merge first, then sign messages and
send them out. Using msg.Merge.MergedMessage for
that looks like a perfect approach for this.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
zeta
Newbie
Newbie
Avatar

Joined: 02 June 2010
Online Status: Offline
Posts: 4
Posted: 03 June 2010 at 10:35am | IP Logged Quote zeta

When you mention "run mail merge first", are you   
referring to smtp.SendMailMerge or
msg.Merge.MergedMessage?

As far as I see it, using smtp.SendMailMerge
would send an email with a wrong signature. And
using msg.Merge.MergedMessage would not be able
to use the DataTable. Is there something I'm
missing here?
Back to Top View zeta's Profile Search for other posts by zeta
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 5931
Posted: 04 June 2010 at 6:44am | IP Logged Quote Igor

Both methods can use any data sources
including database of course, but with
SendMailMerge that works in a simpler way we
must admit.

The approach we'd suggest is: do not sign
messages before SendMailMerge, instead use
Smtp.SendingMessage event, the message will be
fully composed at the moment, so there
shouldn't be any problems with wrong
signatures.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
zeta
Newbie
Newbie
Avatar

Joined: 02 June 2010
Online Status: Offline
Posts: 4
Posted: 04 June 2010 at 11:01am | IP Logged Quote zeta

I'm having problems signing the message at the
event.

Code:

private void smtp_SendingMessage(object
sender, SmtpSendingMessageEventArgs e)
{
      var dk = new DomainKeys(true);
      e.MailMessage = dk.Sign(e.MailMessage,
null, privateKey, false, "selector",
DomainKeysTypes.DKIM);
}


It seems that e.MailMessage is read-only.
Back to Top View zeta's Profile Search for other posts by zeta
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 5931
Posted: 07 June 2010 at 8:16am | IP Logged Quote Igor

It is read-only indeed, but you shouldn't have
problems assigning signed message using
LoadMessage method.

Please let us know if this helps you. Thanks!

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
zeta
Newbie
Newbie
Avatar

Joined: 02 June 2010
Online Status: Offline
Posts: 4
Posted: 07 June 2010 at 10:58am | IP Logged Quote zeta

OK, now everything works. (use the
GetMessageRawData() after signing, people).
Back to Top View zeta's Profile Search for other posts by zeta
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2182
Posted: 07 June 2010 at 11:12am | IP Logged Quote Alex

Good to hear. Anyway, we'll think about how to make DK/DKIM signing more straight-forward during bulk mail operations.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide