Beispiel #1
0
        public override void NetDirtyHandle()
        {
            var msg = new MailList();

            foreach (var mail in Children)
            {
                if (mail.NetDirty) //脏邮件
                {
                    var thisMail = (Mail)mail;
                    var tempMail = new MailCell
                    {
                        Guid      = thisMail.Guid,
                        StartTime = thisMail.OverTime,
                        Name      = thisMail.Name,
                        Type      = thisMail.Type
                    };

                    if (thisMail.Reward.Count > 0)
                    {
                        tempMail.State = thisMail.State + 100;
                    }
                    else
                    {
                        tempMail.State = thisMail.State + 200;
                    }
                    msg.Mails.Add(tempMail);
                }
            }
            mCharacter.Proxy.SyncMails(msg);
        }
Beispiel #2
0
    private void GetMail()
    {
        string senderid = Request.Cookies["id"].Value.ToString();
        string mailtype = "答疑";

        Fannie.Mail ml = new Fannie.Mail();
        DataTable   dt = new DataTable();
        DataSet     ds = ml.GetMyMail(2, senderid, mailtype);
        DataColumn  dc = new DataColumn();

        dc.ColumnName = "DataNo";
        ds.Tables[0].Columns.Add(dc);
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            ds.Tables[0].Rows[i]["DataNo"] = (i + 1).ToString();
        }
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            ds.Tables[0].Rows[i]["Theme"]    = SubStr(Convert.ToString(ds.Tables[0].Rows[i]["Theme"]), 40);
            ds.Tables[0].Rows[i]["Contents"] = SubStr(Convert.ToString(ds.Tables[0].Rows[i]["Contents"]), 50);
        }
        dt = ds.Tables[0];
        if (dt.Rows.Count == 0)
        {
            Label1.Visible = true;
        }
        else
        {
            Label1.Visible = false;
        }
        MailList.DataKeyNames = new string[] { "MailNo" };
        MailList.DataSource   = ds;
        MailList.DataBind();
    }
    protected void mailSearchSearchButton_Click(object sender, EventArgs e)
    {
        if (!this.ValidateFields("mail3"))
        {
            this.ClearFields(5);
            this.ClearFields(6);
            return;
        }

        MailList mail = (MailList)this.Master._CoachingDal.GetMailListByMailAddress(this.mailSearchText.Text);

        if (mail == null)
        {
            this.Master._Logger.Warn(new AdminException(". mail == null"), MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(36, "Red", this.mailSearchText.Text));
            return;
        }

        if (this.mailActionHiddenRe1.Value == "2")
        {
            this.Notify(this.Master._Notifier.Notify(37, "Red", mail.MailListName + " " + mail.MailListMail));
            this.mailActionHiddenRe2.Value = mail.MailListID;
        }
        else
        {
            this.UpdateMailInit(mail);
        }
    }
        public void BindItem(MailList item)
        {
            itemName            = item.Name;
            txtDescription.Text = item.Description;
            if (String.IsNullOrEmpty(item.ModeratorAddress))
            {
                Utils.SelectListItem(ddlListModerators, GetLocalizedString("Text.SelectModerator"));
                selectedModerator = GetLocalizedString("Text.SelectModerator");
            }
            else
            {
                Utils.SelectListItem(ddlListModerators, item.ModeratorAddress);
                selectedModerator = item.ModeratorAddress;
            }
            chkReplyToList.Checked = (item.ReplyToMode == ReplyTo.RepliesToList);
            Utils.SelectListItem(ddlPostingMode, item.PostingMode);
            txtPassword.Text                = item.Password;
            chkPasswordEnabled.Checked      = item.RequirePassword;
            txtSubjectPrefix.Text           = item.SubjectPrefix;
            chkSubjectPrefixEnabled.Checked = item.EnableSubjectPrefix;
            txtMaxMessageSize.Text          = item.MaxMessageSize.ToString();
            txtMaxRecipients.Text           = item.MaxRecipientsPerMessage.ToString();

            // members
            mailEditItems.Items = item.Members;
        }
Beispiel #5
0
        public async Task <IActionResult> Edit(long id, [Bind("Id,Name,OwnerEmail")] MailList mailList)
        {
            if (id != mailList.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(mailList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MailListExists(mailList.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(mailList));
        }
Beispiel #6
0
        public static void Trace(Packet packet, PacketMonitorForm PacketMonitor)
        {
            IpPacket  ipPacket  = null;
            TcpPacket tcpPacket = null;

            try
            {
                ipPacket = PacketDotNet.IpPacket.GetEncapsulated(packet);
                if (ipPacket == null || ipPacket.Version == IpVersion.IPv6)
                {
                    return;
                }
                tcpPacket = PacketDotNet.TcpPacket.GetEncapsulated(packet);
                if (tcpPacket == null)
                {
                    return;
                }


                long Key = ipPacket.SourceAddress.Address + tcpPacket.SourcePort + ipPacket.DestinationAddress.Address + tcpPacket.AcknowledgmentNumber;

                if (isReassembledPacketOfPostRequest(ipPacket, tcpPacket))
                {
                    PacketReassemble(Key, tcpPacket);
                    MailList[Key].TimeToLive = 0;

                    // Var_PushFlag == true 表示資料都已經擷取完全
                    if (MailList[Key].Var_PushFlag == true)
                    {
                        var Mail = MailList[Key];
                        foreach (var Data in Mail.PostRequestDataList)
                        {
                            Mail.PostRequestData += new string(Data);
                        }
                        foreach (var Data in Mail.VarDataList)
                        {
                            Mail.VarData += new string(Data);
                        }

                        DoSomething(Mail, PacketMonitor);
                        MailList.Remove(Key);
                    }
                }
                else if (isPostRequest(tcpPacket))
                {
                    MailList.Add(Key, new HttpMail(ipPacket, tcpPacket));
                }
                else
                {
                    return;
                }

                AddMailLiveTime();
            }
            catch
            {
                Console.WriteLine();
                return;
            }
        }
Beispiel #7
0
        public void SaveItem(MailList item)
        {
            item.Description = txtDescription.Text;
            if (ddlListModerators.SelectedValue == GetLocalizedString("Text.SelectModerator"))
            {
                item.ModeratorAddress = null;
            }
            else
            {
                item.ModeratorAddress = ddlListModerators.SelectedValue;
            }

            item.ReplyToMode             = chkReplyToList.Checked ? ReplyTo.RepliesToList : ReplyTo.RepliesToSender;
            item.PostingMode             = (PostingMode)Enum.Parse(typeof(PostingMode), ddlPostingMode.SelectedValue, true);
            item.ListToAddress           = ddlListToAddress.SelectedValue;
            item.ListFromAddress         = ddlListFromAddress.SelectedValue;
            item.ListReplyToAddress      = ddlListReplyToAddress.SelectedValue;
            item.Password                = txtPassword.Text;
            item.RequirePassword         = chkPasswordEnabled.Checked;
            item.SubjectPrefix           = txtSubjectPrefix.Text;
            item.EnableSubjectPrefix     = chkSubjectPrefixEnabled.Checked;
            item.DigestMode              = cbDigestMode.Checked;
            item.SendSubscribe           = cbSendSubcsribe.Checked;
            item.SendUnsubscribe         = cbSendUnsubscribe.Checked;
            item.AllowUnsubscribe        = cbAllowUnsubscribe.Checked;
            item.DisableListcommand      = !cbDisableListcommand.Checked;
            item.DisableSubscribecommand = !cbDisableSubscribecommand.Checked;

            item.MaxMessageSize          = Int32.Parse(txtMaxMessageSize.Text);
            item.MaxRecipientsPerMessage = Int32.Parse(txtMaxRecipients.Text);
            item.Members = mailEditItems.Items;
            ctrl         = null;
        }
    protected void removeYes_Click(object sender, EventArgs e)
    {
        if (Request["RemoveCode"] == null)
        {
            this.logger.Error(new AdminException
                                  (". Request[\"RemoveCode\"] == null"), MethodBase.GetCurrentMethod().Name);
            this.removeLabel.Text = @"לא הוסרת מרשימת התפוצה עקב בעיות טכניות. אנא פנה ידנית 
                                    בדף 'צור קשר' באתר עם כתובת האימייל איתה נרשמת לרשימת התפוצה";
            return;
        }

        MailList mail = this.coachingDal.GetMailListByRemoveCode((string)Request["RemoveCode"]);

        if (mail == null)
        {
            this.logger.Error(new AdminException
                                  (". mail == null"), MethodBase.GetCurrentMethod().Name);
            this.removeLabel.Text = @"לא הוסרת מרשימת התפוצה עקב בעיות טכניות. אנא פנה ידנית 
                                    בדף 'צור קשר' באתר עם כתובת האימייל איתה נרשמת לרשימת התפוצה";
            return;
        }

        this.coachingDal.DisableMailList(mail.MailListID);
        this.removeLabel.Text = "הוסרת מרשימת התפוצה בהצלחה";
        this.buttons.Visible  = false;
        this.question.Visible = false;
    }
Beispiel #9
0
        public void BindItem(MailList item)
        {
            Utils.SelectListItem(ddlReplyTo, item.ReplyToMode);
            Utils.SelectListItem(ddlPostingMode, item.PostingMode);

            mailEditItems.Items = item.Members;
        }
 protected void BtnSaveAccess_Click(object sender, EventArgs e)
 {
     if (base.IsValid)
     {
         string exportFileName = MailList.GetExportFileName(this.TxtExportToAccess.Text);
         if (FileSystemObject.IsExist(exportFileName, FsoMethod.File))
         {
             try
             {
                 int num = Users.ExportDataToAccess(exportFileName, Convert.ToInt32(this.DropGroup1.SelectedValue));
                 if (num > 0)
                 {
                     AdminPage.WriteSuccessMsg("操作成功:共导出 " + num.ToString() + " 个会员Email地址到" + this.TxtExportToAccess.Text + "文件。<a href=" + exportFileName + ">点击这里将文件下载回本地</a>", "MailListExport.aspx");
                 }
                 else
                 {
                     AdminPage.WriteErrMsg("该会员组没有可供导出的数据!");
                 }
             }
             catch (OleDbException exception)
             {
                 AdminPage.WriteErrMsg("<li>数据库操作失败,错误原因:" + exception.Message + "</li>");
             }
         }
         else
         {
             AdminPage.WriteErrMsg("文件不存在!");
         }
     }
 }
    private bool ValidateMailBeforeAddUpdate(string name, string mailAddress)
    {
        if (name == "" || name == null)
        {
            this.Master._Logger.Error(new AdminException
                                          (". name == \"\" || name == null"), MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(23, "Red", ""));
            return(false);
        }

        if (mailAddress == "" || mailAddress == null)
        {
            this.Master._Logger.Error(new AdminException
                                          (". mailAddress == \"\" || mailAddress == null"), MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(23, "Red", ""));
            return(false);
        }

        if (this.mailActionHiddenUp2.Value == "")
        {
            if (this.Master._CoachingDal.GetMailListByMailAddress(mailAddress) != null)
            {
                this.Master._Logger.Warn(new AdminException(". this.Master._CoachingDal.GetMailListByMailAddress(this.mailAddress.Text) != null"),
                                         MethodBase.GetCurrentMethod().Name);
                this.Notify(this.Master._Notifier.Notify(40, "Red", this.mailAddress.Text));
                return(false);
            }
        }
        else
        {
            MailList mail = (MailList)this.Master._CoachingDal.Get("mailList", this.mailActionHiddenUp2.Value);
            if (mail == null)
            {
                this.Master._Logger.Error(new AdminException
                                              (". mail == null"), MethodBase.GetCurrentMethod().Name);
                this.Notify(this.Master._Notifier.Notify(23, "Red", ""));
                this.ClearFields(6);
                return(false);
            }

            if (!this.Master._CoachingDal.GetMailListByMailAddressExcept
                    (mail.MailListMail, mailAddress))
            {
                this.Master._Logger.Warn(new AdminException
                                             (". !this.Master._CoachingDal.GetMailListByMailAddressExcept(mail.MailListMail, mailAddress)"),
                                         MethodBase.GetCurrentMethod().Name);
                this.Notify(this.Master._Notifier.Notify(40, "Red", this.mailAddress.Text));
                return(false);
            }
        }

        if (!this.Master._GlobalFunctions.ValidateMailAddress(mailAddress))
        {
            this.Master._Logger.Warn(new AdminException(". !this.Master._CoachingDal.ValidateMailAddress(mailAddress)"),
                                     MethodBase.GetCurrentMethod().Name);
            this.mailAddLabel.Text = "Illegal Mail Address";
            return(false);
        }
        return(true);
    }
 public void SaveItem(MailList item)
 {
     item.PostingMode               = (PostingMode)Enum.Parse(typeof(PostingMode), ddlPostingMode.SelectedValue, true);
     item.ModeratorAddress          = txtEmailAnnouncements.Text;
     item.Members                   = mailEditItems.Items;
     item.RequireSmtpAuthentication = cbSMTPAuthentication.Checked;
 }
 public void SaveItem(MailList item)
 {
     item.Description              = txtDescription.Text;
     item.ModeratorAddress         = ddlListModerators.SelectedValue;
     item.MembersSource            = (IceWarpListMembersSource)Enum.Parse(typeof(IceWarpListMembersSource), ddlMembersSource.SelectedValue);
     item.Members                  = mailEditItems.Items;
     item.FromHeader               = (IceWarpListFromAndReplyToHeader)Enum.Parse(typeof(IceWarpListFromAndReplyToHeader), ddlFromHeaderAction.SelectedValue);
     item.ReplyToHeader            = (IceWarpListFromAndReplyToHeader)Enum.Parse(typeof(IceWarpListFromAndReplyToHeader), ddlReplyToHeaderAction.SelectedValue);
     item.ListFromAddress          = txtFromHeaderValue.Text;
     item.ListReplyToAddress       = txtReplyToHeaderValue.Text;
     item.SubjectPrefix            = txtSubjectPrefix.Text;
     item.Originator               = (IceWarpListOriginator)Enum.Parse(typeof(IceWarpListOriginator), ddllblOriginator.SelectedValue);
     item.PostingMode              = (PostingMode)Enum.Parse(typeof(PostingMode), ddlPostingMode.SelectedValue);
     item.PasswordProtection       = (PasswordProtection)Enum.Parse(typeof(PasswordProtection), ddlPasswordProtection.SelectedValue);
     item.Password                 = txtPassword.Text;
     item.DefaultRights            = (IceWarpListDefaultRights)Enum.Parse(typeof(IceWarpListDefaultRights), ddlDefaultRights.SelectedValue);
     item.MaxMessageSize           = Convert.ToInt32(txtMaxMessageSize.Text);
     item.MaxMembers               = Convert.ToInt32(txtMaxMembers.Text);
     item.SendToSender             = chkSendToSender.Checked;
     item.DigestMode               = chkDigestMailingList.Checked;
     item.MaxMessagesPerMinute     = Convert.ToInt32(txtMaxMessagesPerMinute.Text);
     item.SendSubscribe            = chkSendSubscribe.Checked;
     item.SendUnsubscribe          = chkSendUnSubscribe.Checked;
     item.ConfirmSubscription      = (IceWarpListConfirmSubscription)Enum.Parse(typeof(IceWarpListConfirmSubscription), ddlConfirmSubscription.SelectedValue);
     item.CommandsInSubject        = chkCommandInSubject.Checked;
     item.DisableSubscribecommand  = !chkEnableSubscribe.Checked;
     item.AllowUnsubscribe         = chkEnableUnsubscribe.Checked;
     item.DisableListcommand       = !chkEnableLists.Checked;
     item.DisableWhichCommand      = !chkEnableWhich.Checked;
     item.DisableReviewCommand     = !chkEnableReview.Checked;
     item.DisableVacationCommand   = !chkEnableVacation.Checked;
     item.Moderated                = chkModerated.Checked;
     item.CommandPassword          = txtCommandPassword.Text;
     item.SuppressCommandResponses = chkSuppressCommandResponses.Checked;
 }
Beispiel #14
0
        private ActionResult OnSendMail(GrimRequest request)
        {
            if (!request.TryGetParameterByKey("to", out var toParam))
            {
                _logger.LogWarning($"Got get mail send request with missing 'to' parameter");
                return(BadRequest());
            }
            else if (!request.TryGetParameterByKey("subject", out var subjectParam))
            {
                _logger.LogWarning($"Got get mail send request with missing 'subject' parameter");
                return(BadRequest());
            }
            else if (!request.TryGetParameterByKey("body", out var bodyParam))
            {
                _logger.LogWarning($"Got get mail send request with missing 'body' parameter");
                return(BadRequest());
            }
            else if (!request.TryGetParameterByKey("mail_id", out var mailIdParam))
            {
                _logger.LogWarning($"Got get mail send request with missing 'mail_id' parameter");
                return(BadRequest());
            }

            // Mail list with 1 is sent
            var mailList = new MailList()
            {
                Mails = new List <Mail>()
                {
                    new Mail(),
                }
            };

            return(Ok());
        }
    private void GetMail()
    {
        string receiveid = Request.Cookies["id"].Value.ToString();
        string mailtype  = "开题材料";

        Fannie.Mail ml = new Fannie.Mail();
        DataTable   dt = new DataTable();
        DataSet     ds = ml.GetMyMail(1, receiveid, mailtype);
        DataColumn  dc = new DataColumn();

        dc.ColumnName = "DataNo";
        ds.Tables[0].Columns.Add(dc);
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            ds.Tables[0].Rows[i]["DataNo"] = (i + 1).ToString();
        }
        MailList.DataKeyNames = new string[] { "MailNo" };
        MailList.DataSource   = ds;
        MailList.DataBind();
        dt = ds.Tables[0];
        if (dt.Rows.Count == 0)
        {
            Label1.Visible = true;
        }
        else
        {
            Label1.Visible = false;
        }
    }
Beispiel #16
0
        public void SaveItem(MailList item)
        {
            item.ReplyToMode = (ReplyTo)Enum.Parse(typeof(ReplyTo), ddlReplyTo.SelectedValue, true);
            item.PostingMode = (PostingMode)Enum.Parse(typeof(PostingMode), ddlPostingMode.SelectedValue, true);

            item.Members = mailEditItems.Items;
        }
    protected void mailDisableActionButton_Click(object sender, EventArgs e)
    {
        if (this.mailActionHiddenUp2.Value == "")
        {
            this.Master._Logger.Error(new AdminException(". this.mailActionHiddenUp2.Value == \"\""),
                                      MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(23, "Red", ""));
            return;
        }

        MailList mail = this.ValidateEnableDisableMail(this.mailActionHiddenUp2.Value, 2);

        if (mail == null)
        {
            return;
        }

        try
        {
            this.Master._CoachingDal.DisableMailList(mail.MailListID);
            this.Notify(this.Master._Notifier.Notify(33, "White", mail.MailListName + " " + mail.MailListMail));
            this.Master._Logger.Log(new AdminException(". " + mail.MailListName + " " + mail.MailListMail +
                                                       " Was Successfully Disabled"), MethodBase.GetCurrentMethod().Name);
        }
        catch (Exception m)
        {
            this.Master._Logger.Error(m, MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(43, "White", mail.MailListName + " " + mail.MailListMail));
        }
    }
    public string AddToList(string contactId, string listId, string status)
    {
        bool success = false;

        string _output = "-1";
        try
        {
            Uri uri = new Uri(baseUrl + AccountId + "/c/" + ClientFolderId + "/subscriptions/");
            MailList ml = new MailList();
            ml.contactId = contactId;
            ml.listId = listId;
            ml.status = status;

            var jsonSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();

            string json = jsonSerializer.Serialize(ml);

            json = "[" + json + "]";

            // Create a new request to the above mentioned URL.

            HttpWebRequest r = (HttpWebRequest)WebRequest.Create(uri);

            r.Method = "POST";
            r.Accept = "application/json";
            r.Headers.Add("Api-Version", "2.0");
            r.Headers.Add("Api-AppId", AppId);
            r.Headers.Add("Api-Username", Username);
            r.Headers.Add("Api-Password", Password);
            // r.Headers.Add("Accept", "application/json");
            r.ContentType = "application/json";

            string data = json;
            byte[] dataStream = Encoding.UTF8.GetBytes(data);
            r.ContentLength = dataStream.Length;
            // Assign the response object of 'WebRequest' to a 'WebResponse' variable.

            Stream s = r.GetRequestStream();
            // Send the data.
            s.Write(dataStream, 0, dataStream.Length);
            s.Close();

            HttpWebResponse resp = (HttpWebResponse)r.GetResponse();
            System.IO.StreamReader sr = null;
            string sResponse = null;
            sResponse = "";
            sr = new StreamReader(resp.GetResponseStream());
            sResponse = sr.ReadToEnd();

            _output = sResponse;
            success = true;
        }
        catch
        {
            success = false;
        }

        return "true";
    }
 public void BindItem(MailList item)
 {
     Utils.SelectListItem(ddlPostingMode, item.PostingMode);
     mailEditItems.Items          = item.Members;
     txtEmailAnnouncements.Text   = item.ModeratorAddress;
     cbSMTPAuthentication.Checked = item.RequireSmtpAuthentication;
     ToggleFormControls();
 }
Beispiel #20
0
 private void LoadMailList()
 {
     MailList.Load();
     foreach (string mail in MailList.GetList)
     {
         AddMail(mail);
     }
 }
    protected void mailDisableBut_Click(object sender, EventArgs e)
    {
        string mailListID = "";

        try
        {
            mailListID = ((LinkButton)sender).CommandName;
        }
        catch (Exception j)
        {
            this.Master._Logger.Error(j, MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(23, "Red", ""));
            return;
        }


        if (mailListID == "" || mailListID == null)
        {
            this.Master._Logger.Error(new AdminException
                                          (". mailListID  == \"\" || mailListID  == null"), MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(23, "Red", ""));
            return;
        }

        MailList mail = (MailList)this.Master._CoachingDal.Get("mailList", mailListID);

        if (mail == null)
        {
            this.Master._Logger.Error(new AdminException
                                          (". mail == null"), MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(23, "Red", ""));
            return;
        }

        if (mail.Active == 2)
        {
            this.Master._Logger.Warn(new AdminException
                                         (". mail.Active == 2"), MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(34, "Red", mail.MailListName + " " + mail.MailListMail));
            return;
        }

        try
        {
            this.Master._CoachingDal.DisableMailList(mail.MailListID);
            this.Notify(this.Master._Notifier.Notify(33, "White", mail.MailListName + " " + mail.MailListMail));
            this.Master._Logger.Log(new AdminException(". " + mail.MailListName + " " + mail.MailListMail +
                                                       " Was Successfully Disabled"), MethodBase.GetCurrentMethod().Name);

            this.mailGrid.DataSource = this.Master._CoachingDal.GetAll("mailList");
            this.mailGrid.DataBind();
        }
        catch (Exception m)
        {
            this.Master._Logger.Error(m, MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(23, "Red", ""));
        }
    }
Beispiel #22
0
 private void SaveMailList()
 {
     MailList.Clear();
     foreach (Node node in ListMailItems.Nodes)
     {
         MailList.AddMail(node.Tag.ToString());
     }
     MailList.Save();
 }
Beispiel #23
0
        static void Main3()
        {
            MailList list = new MailList();

            foreach (EMail mail in list)
            {
                //...
            }
        }
Beispiel #24
0
 private void RebuildMailList()
 {
     MailEditor.Visible     = false;
     TableFields.Visible    = false;
     MailList.PageSize      = UC.PagingSize;
     MailList.sqlDataSource = "SELECT * FROM ML_MAIL";
     MailList.DataBind();
     MailList.Visible = true;
     FileName.Text    = "-1";
 }
        public void BindItem(MailList item)
        {
            Utils.SelectListItem(ddlReplyTo, item.ReplyToMode);
            Utils.SelectListItem(ddlPostingMode, item.PostingMode);

            chkModerationEnabled.Checked = item.Moderated;
            txtModeratorEmail.Text       = item.ModeratorAddress;

            mailEditItems.Items = item.Members;
        }
Beispiel #26
0
        public static void Trace(Packet packet)
        {
            IpPacket  ipPacket  = null;
            TcpPacket tcpPacket = null;

            try
            {
                ipPacket = PacketDotNet.IPv4Packet.GetEncapsulated(packet);
                if (ipPacket == null)
                {
                    return;
                }
                tcpPacket = PacketDotNet.TcpPacket.GetEncapsulated(packet);
                if (tcpPacket == null)
                {
                    return;
                }
            }
            catch
            {
                Console.WriteLine();
                return;
            }

            bool _isSend;

            if (isMailPort(tcpPacket, out _isSend))
            {
                // analyze whether the mail session is exist.
                if (!MailList.ContainsKey(tcpPacket.SourcePort + tcpPacket.DestinationPort))
                {
                    MailTrace _MailTrace = new MailTrace(ipPacket.SourceAddress, ipPacket.DestinationAddress, tcpPacket.SourcePort, tcpPacket.DestinationPort, _isSend);
                    _MailTrace.PcapFileWriter.Write(packet.Bytes);
                    MailList.Add(tcpPacket.SourcePort + tcpPacket.DestinationPort, _MailTrace);
                    return;
                }

                // the mail session has exist and write it into pcap file.
                MailList[tcpPacket.SourcePort + tcpPacket.DestinationPort].PcapFileWriter.Write(packet.Bytes);

                if (MailList[tcpPacket.SourcePort + tcpPacket.DestinationPort].MailEnd == true)
                {
                    MailList.Remove(tcpPacket.SourcePort + tcpPacket.DestinationPort);
                }
                if (tcpPacket.Fin == true)   // the fin flag means the session will be disconnected. First is from Server and Second is from client.
                {
                    MailList[tcpPacket.SourcePort + tcpPacket.DestinationPort].PacketFlagFinCount++;
                    if (MailList[tcpPacket.SourcePort + tcpPacket.DestinationPort].PacketFlagFinCount == 2)
                    {
                        MailList[tcpPacket.SourcePort + tcpPacket.DestinationPort].MailEnd = true;
                    }
                }
            }
        }
Beispiel #27
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            STRBDpopin.Begin();
            MailUtil.mailPage = this;
            await MailUtil.Login();

            inboxList              = new MailList();
            inboxList.DataLoading += InboxLoading;
            inboxList.DataLoaded  += InboxLoaded;
            LSTVWinbox.ItemsSource = inboxList;
        }
Beispiel #28
0
        public void QueueMessage(string mailTo, string content)
        {
            var mail = new MailList()
            {
                MailTo      = mailTo,
                MailContent = content,
                SendStatus  = (int)MailListStatus.Default,
                MailListId  = new Guid()
            };

            _repository.InsertMailList(new MailList[] { mail });
        }
Beispiel #29
0
        public async Task <IActionResult> Create([Bind("Id,Name")] MailList mailList)
        {
            if (ModelState.IsValid)
            {
                mailList.OwnerEmail = User.FindFirst(ClaimTypes.Name).Value;
                _context.Add(mailList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(mailList));
        }
Beispiel #30
0
        private void PVTmail_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            PVTEHmail.UpdateUI(PVTmail.SelectedIndex);
            switch (PVTmail.SelectedIndex)
            {
            case 0:
            {
            }
            break;

            case 1:
            {
                if (sentList != null)
                {
                    return;
                }
                sentList              = new MailList(MailUtil.FolderType.SentItem);
                sentList.DataLoading += SentLoading;
                sentList.DataLoaded  += SentLoaded;
                LSTVWsent.ItemsSource = sentList;
            }
            break;

            case 2:
            {
                if (junkList != null)
                {
                    return;
                }
                junkList              = new MailList(MailUtil.FolderType.JunkMail);
                junkList.DataLoading += JunkLoading;
                junkList.DataLoaded  += JunkLoaded;
                LSTVWjunk.ItemsSource = junkList;
            }
            break;

            case 3:
            {
                if (trashList != null)
                {
                    return;
                }
                trashList              = new MailList(MailUtil.FolderType.Trash);
                trashList.DataLoading += TrashLoading;
                trashList.DataLoaded  += TrashLoaded;
                LSTVWtrash.ItemsSource = trashList;
            }
            break;

            default: break;
            }
        }
        public bool AddMail(string mailTo, string mailContent)
        {
            var mail = new MailList()
            {
                MailTo      = mailTo,
                MailContent = mailContent,
                SendStatus  = (int)MailListStatus.Default,
                MailListId  = new Guid()
            };

            _repository.InsertMailList(new MailList[] { mail });
            return(true);
        }
        public void SaveItem(MailList item)
        {
            item.ReplyToMode = (ReplyTo)Enum.Parse(typeof(ReplyTo), ddlReplyTo.SelectedValue, true);
            item.PostingMode = (PostingMode)Enum.Parse(typeof(PostingMode), ddlPostingMode.SelectedValue, true);

            // save password
            item.Password = txtPassword.Text;

            item.Moderated        = chkModerationEnabled.Checked;
            item.ModeratorAddress = txtModeratorEmail.Text;

            item.Members = mailEditItems.Items;
        }