/// <summary> /// Retrieve expired records. /// Records without processed notification and older than the <c>ExpiredMinutes</c> /// Load a limited amount of record set by <c>BulkCount</c> /// </summary> /// <param name="settings"></param> /// <returns></returns> protected override IList <Mdn> ExpiredMdns(TimeoutSettings settings) { IList <Mdn> mdns; mdns = MDNManager.GetExpiredProcessed(settings.ExpiredMinutes, settings.BulkCount).ToList(); if (mdns.Count() > 0) { Logger.Debug("Processing {0} expired processed mdns", mdns.Count()); } return(mdns); }
/// <summary> /// Retrieve expired records. /// Records without processed notification and older than the <c>ExpiredMinutes</c> /// Load a limited amount of record set by <c>BulkCount</c> /// </summary> /// <param name="settings"></param> /// <returns></returns> protected override IList<Mdn> ExpiredMdns(TimeoutSettings settings) { IList<Mdn> mdns; mdns = MDNManager.GetExpiredProcessed(settings.ExpiredMinutes, settings.BulkCount).ToList(); if (mdns.Count() > 0) { Logger.Debug("Processing {0} expired processed mdns", mdns.Count()); } return mdns; }
static DSNMessage CreateNotificationMessage(Mdn mdn, TimeoutSettings settings) { var perMessage = new DSNPerMessage(settings.ProductName, mdn.MessageId); var perRecipient = new DSNPerRecipient(DSNStandard.DSNAction.Failed, DSNStandard.DSNStatus.Permanent , DSNStandard.DSNStatus.NETWORK_EXPIRED_PROCESSED, MailParser.ParseMailAddress(mdn.Recipient)); // // The nature of Mdn storage in config store does not result in a list of perRecipients // If you would rather send one DSN with muliple recipients then one could write their own Job. // var notification = new DSN(perMessage, new List<DSNPerRecipient> { perRecipient }); var sender = new MailAddress(mdn.Sender); var notificationMessage = new DSNMessage(sender.Address, new MailAddress("Postmaster@" + sender.Host).Address, notification); notificationMessage.AssignMessageID(); notificationMessage.SubjectValue = string.Format("{0}:{1}", "Rejected", mdn.SubjectValue); notificationMessage.Timestamp(); return notificationMessage; }
/// <summary> /// Load applicatioin settings and job settings /// </summary> /// <param name="context"></param> /// <returns></returns> protected TimeoutSettings Load(JobExecutionContext context) { try { var settings = new TimeoutSettings(context); m_store = new ConfigStore(settings.ConnectionString, settings.QueryTimeout); m_logger = Log.For(this); MDNManager = new MdnManager(new ConfigStore(settings.ConnectionString)); return(settings); } catch (Exception e) { WriteToEventLog(e); var je = new JobExecutionException(e); je.UnscheduleAllTriggers = true; throw je; } }
/// <summary> /// Load applicatioin settings and job settings /// </summary> /// <param name="context"></param> /// <returns></returns> protected TimeoutSettings Load(JobExecutionContext context) { try { var settings = new TimeoutSettings(context); m_store = new ConfigStore(settings.ConnectionString, settings.QueryTimeout); m_logger = Log.For(this); MDNManager = new MdnManager(new ConfigStore(settings.ConnectionString)); return settings; } catch (Exception e) { WriteToEventLog(e); var je = new JobExecutionException(e); je.UnscheduleAllTriggers = true; throw je; } }
static DSNMessage CreateNotificationMessage(Mdn mdn, TimeoutSettings settings) { var perMessage = new DSNPerMessage(settings.ProductName, mdn.MessageId); var perRecipient = new DSNPerRecipient(DSNStandard.DSNAction.Failed, DSNStandard.DSNStatus.Permanent , DSNStandard.DSNStatus.NETWORK_EXPIRED_PROCESSED, MailParser.ParseMailAddress(mdn.Recipient)); // // The nature of Mdn storage in config store does not result in a list of perRecipients // If you would rather send one DSN with muliple recipients then one could write their own Job. // var notification = new DSN(perMessage, new List <DSNPerRecipient> { perRecipient }); var sender = new MailAddress(mdn.Sender); var notificationMessage = new DSNMessage(sender.Address, new MailAddress("Postmaster@" + sender.Host).Address, notification); notificationMessage.AssignMessageID(); notificationMessage.SubjectValue = string.Format("{0}:{1}", "Rejected", mdn.SubjectValue); notificationMessage.Timestamp(); return(notificationMessage); }
/// <summary> /// Get queued mdns that are considered expired based on type of <c>Timeout</c> /// </summary> /// <param name="settings"></param> /// <returns></returns> protected abstract IList <Mdn> ExpiredMdns(TimeoutSettings settings);
/// <summary> /// Get queued mdns that are considered expired based on type of <c>Timeout</c> /// </summary> /// <param name="settings"></param> /// <returns></returns> protected abstract IList<Mdn> ExpiredMdns(TimeoutSettings settings);