CN110535758B - Mail processing method and device - Google Patents

Mail processing method and device Download PDF

Info

Publication number
CN110535758B
CN110535758B CN201910969571.9A CN201910969571A CN110535758B CN 110535758 B CN110535758 B CN 110535758B CN 201910969571 A CN201910969571 A CN 201910969571A CN 110535758 B CN110535758 B CN 110535758B
Authority
CN
China
Prior art keywords
mail
matching
processed
idle thread
calling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910969571.9A
Other languages
Chinese (zh)
Other versions
CN110535758A (en
Inventor
崔义芳
王志海
喻波
韩振国
安鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wondersoft Technology Co Ltd
Original Assignee
Beijing Wondersoft Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wondersoft Technology Co Ltd filed Critical Beijing Wondersoft Technology Co Ltd
Priority to CN201910969571.9A priority Critical patent/CN110535758B/en
Publication of CN110535758A publication Critical patent/CN110535758A/en
Application granted granted Critical
Publication of CN110535758B publication Critical patent/CN110535758B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/18Commands or executable codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/212Monitoring or handling of messages using filtering or selective blocking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/42Mailbox-related aspects, e.g. synchronisation of mailboxes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a mail processing method and device. The method comprises the following steps: when receiving a mail to be processed, calling a first idle thread to receive mail content corresponding to the mail to be processed, sending the mail content to a strategy matching process, matching the mail content according to a preset filtering strategy through the strategy matching process to obtain a matching result, calling a second idle thread to receive the matching result, and executing corresponding processing on the mail to be processed according to the matching result. The invention can improve the filtering efficiency of the mail filter, reduce the mail accumulation and improve the transmission timeliness of the e-mails.

Description

Mail processing method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a mail.
Background
With the development of communication technology, e-mail has become a fast and economical modern communication technology means. However, email provides a vehicle for the dissemination of spam, viruses, malicious programs, or sensitive content, posing a threat to computer system security. In order to improve the safety of the use of the e-mails, the application of the mail filter is increasingly wide, the mail filter can carry out strategy matching on the content of each mail, and the mail is determined to be released or blocked according to the result of the strategy matching, so that the threats of junk information, viruses, malicious programs, sensitive content and the like in the mail to the system safety are reduced.
At present, a mail filter processes mails by adopting threads, when mail data arrives, if the current thread number does not exceed the maximum thread number, one thread is allocated to process the mail content, and the thread is finished after the processing is finished.
Disclosure of Invention
The invention provides a mail processing method and a mail processing device, which aim to solve the problem of low processing efficiency of a mail filter in the prior art.
In order to solve the above problems, the present invention is realized by:
in a first aspect, the present invention provides a mail processing method applied to a mail filter, the method including: when a mail to be processed is received, calling a first idle thread to receive mail content corresponding to the mail to be processed, and sending the mail content to a strategy matching process; matching the mail content according to a preset filtering strategy through the strategy matching process to obtain a matching result; calling a second idle thread to receive the matching result; and executing corresponding processing on the mail to be processed according to the matching result.
Optionally, after the first idle thread is invoked to receive the mail content corresponding to the mail to be processed and send the mail content to the policy matching process, the method further includes:
releasing the first idle thread.
Optionally, the matching the mail content according to a preset filtering policy through the policy matching process to obtain a matching result includes:
receiving a preset filtering strategy issued by the management platform through the strategy matching process;
and matching the mail content according to the preset filtering strategy, and determining a matching result.
Optionally, the method further comprises:
recording the acquisition time corresponding to the mail content;
calling a third idle thread to obtain the current time;
calling the third idle thread, and calculating the absolute value of the difference between the current time and the acquisition time;
and receiving/sending the mail to be processed under the condition that the absolute value of the difference is greater than the preset time length.
Optionally, the performing, according to the matching result, corresponding processing on the to-be-processed email includes:
when the matching result is a result of successful matching, stopping receiving/sending the mail to be processed;
and receiving/sending the mail to be processed when the matching result is the result of failed matching.
In a second aspect, an embodiment of the present invention provides a mail processing apparatus, applied to a mail filter, where the apparatus includes: the system comprises a first calling module, a strategy matching process and a second calling module, wherein the first calling module is used for calling a first idle thread to receive mail content corresponding to a mail to be processed and sending the mail content to the strategy matching process when the mail to be processed is received; the matching module is used for matching the mail content according to a preset filtering strategy through the strategy matching process to obtain a matching result; the second calling module is used for calling a second idle thread to receive the matching result; and the processing module is used for executing corresponding processing on the mail to be processed according to the matching result.
Optionally, the apparatus further comprises:
and the release module is used for releasing the first idle thread after calling the first idle thread to receive the mail content corresponding to the mail to be processed and sending the mail content to the strategy matching process.
Optionally, the matching module comprises:
the matching sub-module is used for receiving the preset filtering strategy issued by the management platform through the strategy matching process; and matching the mail content according to the preset strategy, and determining a matching result.
Optionally, the apparatus further comprises:
the acquisition time recording module is used for recording the acquisition time corresponding to the mail content;
the current time obtaining module is used for calling a third idle thread to obtain the current time;
the absolute value calculation module is used for calling the third idle thread and calculating the absolute value of the difference between the current time and the acquisition time;
and the mail processing module is used for receiving/sending the mail to be processed under the condition that the absolute value of the difference is greater than the preset time length.
Optionally, the processing module includes:
a mail blocking sub-module, configured to block receiving/sending the to-be-processed mail when the matching result is a result of successful matching;
and the mail processing submodule is used for receiving/sending the mail to be processed when the matching result is the result of failed matching.
The embodiment of the invention has the following advantages:
according to the mail processing method provided by the invention, when the mail to be processed is received, the first idle thread is called to receive the mail content corresponding to the mail to be processed, the mail content is sent to the strategy matching process, the mail content is matched according to the preset filtering strategy through the strategy matching process to obtain the matching result, the second idle thread is called to receive the matching result, and the corresponding processing is executed on the mail to be processed according to the matching result, so that the working efficiency of a mail filter can be improved, the mail accumulation is reduced, and the transmission timeliness of the electronic mail is improved.
Drawings
FIG. 1 is a flow chart illustrating steps of a mail processing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a mail processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Example one
Referring to fig. 1, a flowchart illustrating steps of a first embodiment of a mail processing method according to the present invention is shown, where the method is applied to a mail filter, and specifically may include the following steps:
step 101: and when the mail to be processed is received, calling a first idle thread to receive the mail content corresponding to the mail to be processed, and sending the mail content to the strategy matching process.
In the embodiment of the present invention, the mail filter may include four parts, namely, postfix (mail transfer agent), mail filtering process, policy matching process, and management platform, where the mail filtering process may receive mail data sent by postfix through the 10025 port and interact with postfix in the form of SMTP message.
The mail filtering process adopts a single-process multithreading mode, and when the mail filtering process monitors that the port has the mail to be processed sent by postfix, a first idle thread is called to receive the mail content corresponding to the mail to be processed.
The first idle thread is any idle thread selected by the mail filtering process from the thread pool. It should be noted that, when the mail filtering process receives the to-be-processed mail, and there is no idle thread in the current thread pool, the mail filtering process notifies postfix to block waiting, and sends the to-be-processed mail to the mail filtering process after the first preset time.
And after the first idle thread is called, the first idle thread receives the mail content corresponding to the mail to be processed and sends the mail content to the strategy matching process.
It should be noted that, after receiving the mail content corresponding to the mail to be processed, the first idle thread stores the mail content and the information of the receiving and sending person, and generates a unique identifier uuid for the mail, where the uuid and the mail may be 34-bit digital codes. After the uuid is generated, the first idle thread packages the uuid and the postfix connection information to obtain package information, wherein the package information may include the uuid of the mail, socket information for connecting the mail and the postfix, a mail file name and a timestamp.
Optionally, after the first idle thread generates a uuid for the email, setting the state information of the email to incoming, where the incoming indicates that the email is successfully received but has not been sent to the policy matching process. After the first idle thread sets the mail status information to incoming, the mail status information may also be encapsulated in the encapsulation information.
And after the first idle thread obtains the encapsulation information, inserting the encapsulation information into the hashmap. Optionally, the first idle thread may further store the encapsulation information in the database, so that the user may view the encapsulation information of each email stored in the database.
After the first idle thread performs the above processing on the package information of the email, the email content may be sent to the policy matching process.
Optionally, after the first idle thread sends the mail content to the policy matching process, the mail state information of the package information inserted into the hashmap is modified, where the modified mail state information is active, and the state of active indicates that the mail content has been sent to the policy matching process, but the matching result is not obtained.
Optionally, in an embodiment of the present invention, after the step 101, the method may further include:
step A1: the first idle thread is released.
Optionally, after the first idle thread sends the mail content to the policy matching process, the first idle thread is released, so that the first idle thread can be continuously used. It should be noted that, if the state information of the mail is modified by using the first idle thread after the content of the mail is sent to the policy matching process, the first idle thread is released after the state information of the mail is modified to active.
And after the first idle thread is released, the first idle thread is recycled into the thread pool.
Step 102: and matching the mail content according to a preset filtering strategy through a strategy matching process to obtain a matching result.
In the embodiment of the invention, after receiving the mail content sent by the first idle thread in the mail filtering process, the strategy matching process matches the mail content according to the preset filtering strategy to obtain a matching result, wherein the matching result comprises information that the mail content is successfully matched or information that the mail content is unsuccessfully matched and uuid of the mail.
If the matching of the mail content is successful, it indicates that the mail content includes content that should be filtered according to the preset filtering policy, and the mail may have spam, viruses, malicious programs, sensitive content, and the like, and should be blocked. And the matching of the mail content fails, which indicates that the junk information, viruses and the like are not found in the mail, and the mail can be released.
Optionally, the step 102 may include:
substep B1: and receiving a preset filtering strategy issued by a management platform through the strategy matching process.
In the embodiment of the invention, the strategy matching process can receive the preset filtering strategy issued by the management platform. The management platform can receive the preset filtering strategy configured by the user through the web page.
It should be noted that, after receiving the preset filtering policy configured by the user, the management platform sends the preset filtering policy configured by the user to the policy matching process.
Substep B2: and matching the mail content according to a preset filtering strategy, and determining a matching result.
In the embodiment of the invention, the strategy matching process matches the mail content according to the preset filtering strategy sent by the management platform which is received last time, judges whether the mail content hits the preset filtering strategy or not, and determines the matching result according to whether the mail content hits the preset filtering strategy or not.
Step 103: and calling a second idle thread to receive the matching result.
In the embodiment of the invention, the mail filtering process calls the second idle thread to receive the matching result sent by the strategy matching process.
The second idle thread may be a predetermined thread in the mail filtering process, which is dedicated to receive the policy matching result, and the second idle thread may also be the same thread as the first idle thread.
Step 104: and executing corresponding processing on the mail to be processed according to the matching result.
In the embodiment of the invention, when the second idle thread receives the matching result sent by the strategy matching process, the corresponding processing is executed on the mail to be processed according to the matching result.
Specifically, the second idle thread judges whether the hash map has the encapsulation information of the e-mail corresponding to the uuid according to the uuid of the e-mail information included in the matching result, if the corresponding encapsulation information is not found in the hash map, the matching result is considered as invalid data, and the second idle thread continues to wait for receiving the matching result sent by the policy matching process.
If the second idle thread finds the packaging information of the e-mail corresponding to the uuid in the hashmap, the e-mail to be processed needs the second idle thread to execute corresponding processing according to the matching result, wherein the corresponding processing is executed as follows: and judging whether the mail is blocked or released according to the matching result, namely whether the matching is successful or failed, and informing postfix to block the mail or release the mail.
Optionally, after the second idle thread performs corresponding processing on the to-be-processed email, the encapsulation information corresponding to the email in the hashmap is deleted, and the corresponding state information is modified into done, where the state is done to indicate that the email has been matched by the policy matching process, a matching result is obtained, and the postfix is notified to perform processing, and the second idle thread may store the state information of the email in the database, so that the user may obtain the information of the processed email through the database.
Optionally, the step 104 may include:
substep C1: and when the matching result is a result of successful matching, preventing the mail to be processed from being received/sent.
In the embodiment of the invention, when the matching result is successful, the second idle thread sends socket information based on the SMTP to the postfix, the socket information comprises information that the matching result is successful, and after the postfix receives the socket information sent by the second idle thread, the successful matching information in the socket is identified, and the mail to be processed is prevented from being received or sent. Specifically, if the mail to be processed is a mail to be received through postfix, the mail to be processed is prevented from being received, and if the mail to be processed is a mail to be sent through postfix, the mail to be processed is prevented from being sent.
Substep C2: and receiving/sending the mail to be processed when the matching result is the result of failed matching.
In the embodiment of the present invention, when the matching result is a matching failure, the second idle thread sends, to the postfix, socket information based on the SMTP protocol, where the socket information includes information that the matching result is a matching failure, and after the postfix receives the socket information sent by the second idle thread, the postfix identifies the matching failure information included in the socket, and then receives or sends the to-be-processed mail. Specifically, if the mail to be processed is a mail to be received through postfix, the mail to be processed is received, and if the mail to be processed is a mail to be sent through postfix, the mail to be processed is sent.
The mail processing method provided by the invention can improve the working efficiency of the mail filter, reduce the mail accumulation and improve the timeliness of e-mail transmission. In addition, the state information of the mails is continuously updated, the state of the mails can be fully and timely recorded, the statistical analysis of the mails is facilitated, and the experience of users is improved.
Optionally, in an embodiment of the present invention, the method may further include:
step D1: and recording the acquisition time corresponding to the mail content.
In the embodiment of the invention, when the first idle thread receives the mail content sent by the postfix, the acquisition time corresponding to the mail content is recorded, the acquisition time can be recorded in a timestamp mode, and after the first idle thread receives the mail content, information such as uuid of the mail, the timestamp of the mail, socket information connected with the postfix and the like is encapsulated, encapsulated information is obtained, and the encapsulated information is inserted into a hashmap.
Step D2: and calling a third idle thread to acquire the current time.
In this embodiment of the present invention, the third idle thread may be a predetermined thread in the mail filtering process, which is specially used for checking whether the mail to be processed is overtime, and the third idle thread may also be the same thread as the first idle thread.
The third idle thread can acquire the current time in real time, traverse the hashmap, and acquire respective timestamps of the multiple mails from the encapsulation information of the multiple mails inserted in the hashmap, where the time recorded by the timestamps is the acquisition time of the multiple mails.
Step D3: and calling the third idle thread, and calculating the absolute value of the difference between the current time and the acquisition time.
After the third idle thread acquires the current time, the third idle thread may be called, and a difference absolute value between the current time and the acquisition time is calculated, where the difference absolute value is an interval duration from the start of the acquisition of the mail content to the current time.
The third idle thread may calculate an absolute value of a difference between the current time and the acquisition time according to the acquisition time obtained from the timestamp and the current time, and perform step D4.
Step D4: and receiving/sending the mail to be processed under the condition that the absolute value of the difference is greater than the preset time length.
The preset time duration refers to a time duration for acquiring the mail content preset by a service person, and the preset time duration may be 5min, 10min, and the like, and specifically may be determined according to a service requirement, which is not limited in the embodiment of the present invention.
After the absolute value of the difference between the acquisition time of the mail content and the current time is calculated, the magnitude relation between the absolute value of the difference and the preset time length can be used for judging whether the time is out from the acquisition of the mail content.
It should be noted that the third idle thread only notifies postfix to allow the overtime mails, and the mails which are not overtime are still processed according to steps 102 to 104, so as to prevent the mails from being allowed to pass.
Optionally, after the third idle thread notifies postfix to release the overtime mail, the encapsulation information corresponding to the overtime mail is deleted from the hashmap, and the state information corresponding to the overtime mail is modified to timeout-forward, where the state is timeout-forward and indicates that the mail is released overtime, and the third idle thread may store the state information of the mail in the database, so that the user may know the information of the mail that has been released overtime through the database.
The mail processing method provided by the invention can enable the mails which do not receive the matching result for a long time to be released in time, thereby avoiding the situation that the mails are accumulated and the user cannot receive the mails for a long time, and improving the operation efficiency of the system and the satisfaction degree of the user.
Optionally, in an embodiment of the present invention, the method may further include:
step E1: and calling a fourth idle thread to acquire the number of the mails of which the current time state information is incoming.
In the embodiment of the present invention, the mail filtering process calls a fourth idle thread to obtain the number of mails of which the current time status information is incoming, where the fourth idle thread may be a predetermined thread in the mail filtering process, which is specially used for checking whether mails to be processed are stacked.
In the embodiment of the invention, after the first idle thread generates uuid for the mail, the state information of the mail is set as incoming, the state information of the mail is packaged into the packaging information, and the first idle thread also inserts the packaging information into a hashmap and stores the packaging information into a database.
And traversing the hashmap by the fourth idle thread, and acquiring the number of the mails of which the current time state information is incoming from the packaging information inserted by the first idle thread in the hashmap, or acquiring the number of the mails of which the current time state information is incoming from the packaging information stored in the database.
Step E2: and judging whether the number of the mails of which the state information is incoming exceeds a first preset number.
And the fourth idle thread acquires the number of the mails of which the current state information is incoming, compares the number with a preset first preset number, and judges whether the number of the mails of which the state information is incoming exceeds the first preset number. If the number of idle threads exceeds the threshold number, step E3 is executed, and if the number of idle threads does not exceed the threshold number, step E1 is executed after the fourth idle thread sleeps for 1 minute.
Step E3: and if the number of the mails exceeds the preset number, the fourth idle thread informs postfix to release the mails to be processed with the second preset number.
And if the fourth idle thread judges that the number of the mails of which the state information is incomings exceeds the first preset number, informing postfix to release the mails to be processed of the second preset number, and optionally informing postfix to release the mails of which the current state information of the second preset number with the earliest acquisition time is incomings.
After the fourth idle thread executes step E3, the fourth idle thread loops to execute step E1.
The mail processing method provided by the invention can realize that partial mails are released when the mails in the mail filtering process are excessively accumulated, thereby avoiding the situation that the mails cannot be received by a user for a long time due to the accumulation of the mails and improving the operation efficiency of the system and the satisfaction degree of the user.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently depending on the embodiment of the invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Example two
Referring to fig. 2, a schematic structural diagram of a mail processing apparatus according to an embodiment of the present invention is shown, which may specifically include:
the first invoking module 210 is configured to, when the to-be-processed email is received, invoke a first idle thread to receive email content corresponding to the to-be-processed email, and send the email content to the policy matching process.
And the matching module 220 is configured to match the mail content according to a preset filtering policy through a policy matching process to obtain a matching result.
Optionally, the matching module 220 is specifically configured to receive a preset filtering policy issued by the management platform through the policy matching process, match the mail content according to the preset filtering policy, and determine a matching result.
And a second calling module 230, configured to call a second idle thread to receive the matching result.
And the processing module 240 is configured to perform corresponding processing on the mail to be processed according to the matching result.
Optionally, the processing module 240 includes:
a mail blocking sub-module, configured to block receiving/sending the to-be-processed mail when the matching result is a result of successful matching;
and the mail processing submodule is used for receiving/sending the mail to be processed when the matching result is the result of failed matching.
Optionally, the mail processing apparatus further includes a releasing module, configured to invoke the first space thread by the first invoking module 210 to receive the mail content to be processed, and release the first idle thread after sending the mail content to the policy matching process.
Optionally, the mail processing apparatus further includes:
the acquisition time recording module is used for recording the acquisition time corresponding to the mail content;
the current time obtaining module is used for calling a third idle thread to obtain the current time;
the absolute value calculation module is used for calling the third idle thread and calculating the absolute value of the difference between the current time and the acquisition time;
and the mail processing module is used for receiving/sending the mail to be processed under the condition that the absolute value of the difference is greater than the preset time length.
The mail processing device provided by the invention can improve the working efficiency of the mail filter, reduce the mail accumulation and improve the timeliness of e-mail transmission.
In addition, the mail processing device provided by the invention can continuously update the state information of the mails, can fully and timely record the state of the mails, and is beneficial to the statistical analysis of the mails, thereby improving the experience of users.
In addition, the mail processing device provided by the invention can enable the mails which do not receive the matching result for a long time to be released in time, and realize that partial mails are released when the mails in the mail filtering process are excessively accumulated, thereby avoiding the situation that the mails can not be received by the user for a long time due to the accumulation of the mails, and improving the operation efficiency of the system and the satisfaction degree of the user.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
Preferably, an embodiment of the present invention further provides a terminal, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, the computer program implements each process of the foregoing mail processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned mail processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminals (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create a system for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction system which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. The word "comprising", without limitation, means that the element so defined is not intended to exclude the presence of other elements in the process, method, article, or terminal which comprises the element.
The above detailed description is provided for a mail processing method and a mail processing apparatus, and the principle and the implementation of the present invention are explained in detail by applying specific examples, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A mail processing method applied to a mail filter is characterized by comprising the following steps:
when a mail to be processed is received, calling a first idle thread to receive mail content corresponding to the mail to be processed, sending the mail content to a strategy matching process, and calling the first idle thread to modify the state information of the mail to be processed;
matching the mail content according to a preset filtering strategy through the strategy matching process to obtain a matching result;
calling a second idle thread to receive the matching result;
and executing corresponding processing on the mail to be processed according to the matching result, and modifying the state information of the mail to be processed.
2. The method according to claim 1, wherein after invoking the first idle thread to receive the mail content corresponding to the mail to be processed and send the mail content to the policy matching process, further comprising:
releasing the first idle thread.
3. The method according to claim 1, wherein the matching the mail content according to a preset filtering policy through the policy matching process to obtain a matching result comprises:
receiving a preset filtering strategy issued by a management platform through the strategy matching process;
and matching the mail content according to the preset filtering strategy, and determining a matching result.
4. The method of claim 1, further comprising:
recording the acquisition time corresponding to the mail content;
calling a third idle thread to obtain the current time;
calling the third idle thread, and calculating the absolute value of the difference between the current time and the acquisition time;
and receiving/sending the mail to be processed under the condition that the absolute value of the difference is greater than the preset time length.
5. The method according to claim 1, wherein said performing corresponding processing on said mail to be processed according to said matching result comprises:
when the matching result is a result of successful matching, stopping receiving/sending the mail to be processed;
and receiving/sending the mail to be processed when the matching result is the result of failed matching.
6. A mail processing apparatus, for application to a mail filter, the apparatus comprising:
the system comprises a first calling module, a policy matching process and a second calling module, wherein the first calling module is used for calling a first idle thread to receive mail content corresponding to a mail to be processed when the mail to be processed is received, sending the mail content to the policy matching process and calling the first idle thread to modify the state information of the mail to be processed;
the matching module is used for matching the mail content according to a preset filtering strategy through the strategy matching process to obtain a matching result;
the second calling module is used for calling a second idle thread to receive the matching result;
and the processing module is used for executing corresponding processing on the mail to be processed according to the matching result and modifying the state information of the mail to be processed.
7. The apparatus of claim 6, further comprising:
and the release module is used for releasing the first idle thread after calling the first idle thread to receive the mail content corresponding to the mail to be processed and sending the mail content to the strategy matching process.
8. The apparatus of claim 6, wherein the matching module comprises:
the matching submodule is used for receiving a preset filtering strategy issued by the management platform through the strategy matching process; and matching the mail content according to the preset filtering strategy, and determining a matching result.
9. The apparatus of claim 6, further comprising:
the acquisition time recording module is used for recording the acquisition time corresponding to the mail content;
the current time obtaining module is used for calling a third idle thread to obtain the current time;
the absolute value calculation module is used for calling the third idle thread and calculating the absolute value of the difference between the current time and the acquisition time;
and the mail processing module is used for receiving/sending the mail to be processed under the condition that the absolute value of the difference is greater than the preset time length.
10. The apparatus of claim 6, wherein the processing module comprises:
a mail blocking sub-module, configured to block receiving/sending the to-be-processed mail when the matching result is a result of successful matching;
and the mail processing submodule is used for receiving/sending the mail to be processed when the matching result is the result of failed matching.
CN201910969571.9A 2019-10-12 2019-10-12 Mail processing method and device Active CN110535758B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910969571.9A CN110535758B (en) 2019-10-12 2019-10-12 Mail processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910969571.9A CN110535758B (en) 2019-10-12 2019-10-12 Mail processing method and device

Publications (2)

Publication Number Publication Date
CN110535758A CN110535758A (en) 2019-12-03
CN110535758B true CN110535758B (en) 2021-10-01

Family

ID=68671709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910969571.9A Active CN110535758B (en) 2019-10-12 2019-10-12 Mail processing method and device

Country Status (1)

Country Link
CN (1) CN110535758B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111464426B (en) * 2020-03-23 2022-04-26 论客科技(广州)有限公司 Method, device and storage medium for automatically adjusting mail delivery strategy
CN113595887B (en) * 2021-09-09 2023-03-24 北京天空卫士网络安全技术有限公司 Flow control method and device in mail system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101330473A (en) * 2007-06-18 2008-12-24 电子科技大学 Method and apparatus for filtrating network rubbish information supported by multiple protocols
CN102404169A (en) * 2011-11-15 2012-04-04 北京天融信科技有限公司 Device and method for realizing content inspection by content accelerating card
US8453235B1 (en) * 2006-12-15 2013-05-28 Oracle America, Inc. Controlling access to mail transfer agents by clients
CN103905289A (en) * 2012-12-26 2014-07-02 航天信息软件技术有限公司 Spam mail filtering method
CN107770039A (en) * 2016-08-23 2018-03-06 平安科技(深圳)有限公司 Processing method and mail the control server of mail
CN109039863A (en) * 2018-08-01 2018-12-18 北京明朝万达科技股份有限公司 A kind of mail security detection method, device and storage medium based on self study

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110221947A (en) * 2019-04-16 2019-09-10 中国平安人寿保险股份有限公司 Warning information method for inspecting, system, computer installation and readable storage medium storing program for executing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8453235B1 (en) * 2006-12-15 2013-05-28 Oracle America, Inc. Controlling access to mail transfer agents by clients
CN101330473A (en) * 2007-06-18 2008-12-24 电子科技大学 Method and apparatus for filtrating network rubbish information supported by multiple protocols
CN102404169A (en) * 2011-11-15 2012-04-04 北京天融信科技有限公司 Device and method for realizing content inspection by content accelerating card
CN103905289A (en) * 2012-12-26 2014-07-02 航天信息软件技术有限公司 Spam mail filtering method
CN107770039A (en) * 2016-08-23 2018-03-06 平安科技(深圳)有限公司 Processing method and mail the control server of mail
CN109039863A (en) * 2018-08-01 2018-12-18 北京明朝万达科技股份有限公司 A kind of mail security detection method, device and storage medium based on self study

Also Published As

Publication number Publication date
CN110535758A (en) 2019-12-03

Similar Documents

Publication Publication Date Title
CN106533805B (en) Micro-service request processing method, micro-service controller and micro-service architecture
CN110535758B (en) Mail processing method and device
CN109491788B (en) Method and device for realizing load balance of virtualization platform
CN106685894B (en) Risk identification method, device and system
CN107861799B (en) Task processing method and device based on multi-thread environment
CN107579854A (en) A kind of cluster alarm method, device, equipment and computer-readable recording medium
CN107172112B (en) Computer file transmission method and device
CN109831521B (en) Cache instance management method and device, computer equipment and storage medium
CN109408251B (en) Message sending method and device and message receiving processing method and device
CN111949421B (en) SDK calling method, device, electronic equipment and computer readable storage medium
CN112995051B (en) Network traffic recovery method and device
CN114765584A (en) User behavior monitoring method and device, electronic equipment and storage medium
CN111190913A (en) Distributed lock implementation method and system
CN108830724B (en) Resource data packet processing method and terminal equipment
CN103607324B (en) Data processing method for Java message service, Java message client and server
CN107423454B (en) Method, device and equipment for processing file lock in distributed file system
CN109871280A (en) Background process management method and device
EP3148133A1 (en) Load control method and apparatus for notification messages
CN114039893A (en) API gateway speed limiting method and device
CN110417615B (en) Check switch control method, device and equipment and computer readable storage medium
CN112995114B (en) VoLTE call service processing method and device
CN113645103A (en) Method and device for detecting communication link abnormity between video monitoring platform and front-end equipment
CN112925659A (en) Message processing method, device, equipment and computer storage medium
CN114531257A (en) Network attack handling method and device
CN110968409A (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant