CN101499981B - E-mail gateway type systematic mail account maintaining method - Google Patents

E-mail gateway type systematic mail account maintaining method Download PDF

Info

Publication number
CN101499981B
CN101499981B CN200910071577.0A CN200910071577A CN101499981B CN 101499981 B CN101499981 B CN 101499981B CN 200910071577 A CN200910071577 A CN 200910071577A CN 101499981 B CN101499981 B CN 101499981B
Authority
CN
China
Prior art keywords
mail
information
hash table
hash
gateway
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.)
Expired - Fee Related
Application number
CN200910071577.0A
Other languages
Chinese (zh)
Other versions
CN101499981A (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.)
Harbin Engineering University
Original Assignee
Harbin Engineering University
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 Harbin Engineering University filed Critical Harbin Engineering University
Priority to CN200910071577.0A priority Critical patent/CN101499981B/en
Publication of CN101499981A publication Critical patent/CN101499981A/en
Application granted granted Critical
Publication of CN101499981B publication Critical patent/CN101499981B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a method for maintaining the e-mail accounts in systems such as an e-mail gateway and the like. The method detects the mail account information by using a POP3 protocol and an SMTP protocol, then stores the valid account information in a dynamic hash table, and maintains the validity of the information by a time sliding window, therefore, when mail delivery fails, the mail is discarded from the hash table, and the new accounts are detected after the waiting period of the sliding window. The hash structure is stored in a file system in a fixed period to avoid information loss and realize direct loading from the file system when accidental restart occurs. The advantages of the method includes: 1) the method can help to reduce the load on the gateway and improve the utilization rate of the gateway system by assisting to filter a large amount of invalid mail information; and 2) the method cuts down the deployment costs of the system by supporting the simultaneous management of a plurality of mail systems in one mail gateway.

Description

A kind of E-mail gateway type systematic mail account maintaining method
(1) technical field
What the present invention relates to is E-mail gateway type systematic mail account's maintaining method.
(2) background technology
That Email relies on is cheap, simply, advantage has become the important communication mode in people work and life efficiently, but people enjoy Email provide many convenient in, also the misery of having brought at the byproduct of standing it, be that on the Internet, spam overflows, and had in recent years the trend growing in intensity.
At present the improvement of spam is still concentrated on to dependence Spam filtering.And electronic mail filtering technology based on gateway becomes the effective ways of fundamentally containing spam.This technology, by all Emails through gateway are analyzed, judging whether delivery, can reduce spam in the shared bandwidth of transmission over networks.
But the electronic mail filtering product based on gateway class, due to itself and real e-mail system isolation, cannot obtain its mail account information, therefore to the effective means of the lack of control of email account at present.In addition, the spam method based on dictionary, sends spam by structure addresses of items of mail to a large amount of mail servers.Therefore, realize a kind of mail account maintenance technology based on gateway very important.
(3) summary of the invention
The object of the present invention is to provide a kind of method of E-mail gateway type systematic mail accounts maintenance.
The object of the present invention is achieved like this:
1) whether adopt smtp protocol and POP3 agreement to survey email account exists;
2) adopt hash structure and time linked list structure storage mail account information;
3) store hash structure into file through fixed cycle time;
4) support to load mail account information from file system;
5) whether email account there is decision method.
Described employing smtp protocol detection method is: the Email Information 1) gateway being received adopts smtp protocol to send to targeted mails system; 2), if delivered successfully, will prove that this email account exists, otherwise email account does not exist.Described employing POP3 agreement detection method is: the Email of 1) receiving from gateway, mention target account information username; 2) adopt POP3 agreement to send Userusername, if receive that user name does not exist information, email account does not exist; Otherwise email account exists.
The method of described employing hash structure and time linked list structure storage mail account information is: 1) will before email account "@" field, extract 2 bytes, if not enough in bit " 00000000 " polishing 2) in the information of extracting, remove first bit of each byte, the Bit String that formation is made up of 14 bits like this; 3) form the entrance of binary numerical value as hash table according to 14 bits; 4) in hash table, find last e-mail messages of this line, and address and temporal information are write in hash structure, and by this contact of follow-up pointed of previous contact, timing node end pointer also points to this node.
The described method that stores hash structure into file through fixed cycle time is: 1) from hash table, extract e-mail messages and temporal information according to time chain; 2) e-mail messages and temporal information are stored in a line in " SPAM.txt " file in assigned catalogue, and add at the end of new line, be i.e. " r n "; 3) use loop structure that all accounts informations are all stored in this file.
Whether described email account exists the method for judgement to be: 1) from the Email Information receiving, extract targeted mails address; 2) this addresses of items of mail is carried out to hash (ashing technique is as aforementioned identical); 3) in hash table, search it and whether exist, mail is normally delivered if exist, otherwise abandoned.
For above situation, the present invention, from the target account punishment of mail, has proposed the method for E-mail gateway type systematic mail accounts maintenance.
The present invention designs based on following problem:
Electronic mail filtering product based on gateway class, due to itself and real e-mail system isolation, cannot obtain its mail account information, therefore to the effective means of the lack of control of email account.In addition, the spam method based on dictionary, sends spam by structure addresses of items of mail to a large amount of mail servers.Therefore, realizing a kind of mail account maintenance technology tool based on gateway is of great significance.
Technical characteristics of the present invention is embodied in:
1) need to be by other special algorithm and agreement
From mailing system, obtain accounts information, generally need to adopt specific technology and extra agreement, account information is passed to gateway system, this technology adopts existing email protocol to carry out mail detection, does not need to carry out extra exploitation and design.
Concrete technology path is: 1. send SMTP message, whether test target email account exists; 2. whether send POP3 message test email account exists.
2) email account is surveyed and can automatically be pressed time real-time update
Concrete technology path: 1. added time chain information in the hash structure of setting up according to mail account information; 2) time chain, according to time order and function sequential organization, can reduce organizing the time of e-mail messages.
The invention has the advantages that: can be simultaneously for the accounts information of many mail servers manages; Filter the non-existent spam information of a large amount of destination addresses.
(4) brief description of the drawings
Fig. 1 hash table structure;
Fig. 2 time linked list structure;
Fig. 3 hash table and time linked list integrated structure
(5) embodiment
For example the present invention is described in more detail below in conjunction with accompanying drawing:
1) email account detection method
Electronic mail filtering product based on gateway class, due to itself and real e-mail system isolation, cannot obtain its mail account information, therefore to the effective means of the lack of control of email account.From mailing system, obtain accounts information, generally need to adopt specific technology and extra agreement, account information is passed to gateway system, this technology adopts existing email protocol to carry out mail detection, does not need to carry out extra exploitation and design.
● send SMTP message, whether test target email account exists; Be implemented as follows: 1) send " helo destination server " message, and be confirmed; 2) send " mail from: source address message ", and be confirmed; 3) send " rcpt to: destination address " message, if be subject to " 550no such user here ", prove that the account do not exist, otherwise exist.
● send POP3 message test email account and whether exist: be implemented as follows: 1) set up POP3 and connect, receive that "+OK...... " confirms; 2) send " User destination address " message, if receive that "+OK...... " proves account existence, otherwise do not exist.
2) mail account information management method
For mail account information, need to there is a kind of dynamic management approach efficiently.This method requires to adapt to the operation such as interpolation, deletion of account, and requirement Rapid matching process in the short period of time.
The method that this technology adopts hash table and time linked list structure to combine.Wherein: hash table structure as shown in Figure 1, time linked list structure as shown in Figure 2 with hash table structure and time linked list in conjunction with as shown in Figure 3.Hash table manages the addresses of items of mail with same Hash value.Time linked list structure couples together all address informations with time chain, guarantee information is managed in order, and these two kinds of methods, in conjunction with having reached the object that mail account information is organized, are supported Rapid matching, has realized again real-time email account and has upgraded.
Operation principle as shown in Figure 3, cross two-way hash table and organize by each addresses of items of mail information exchange, and each structure has been added again two time linked list pointers, can increase like this retrieval and knot adjustment ground efficiency.
Mainly the operation of hash table is divided into following several:
1. in hash table, add a node, be divided into the following steps: a) calculate the hash address at nodes X place, and find last node Y; B) point to X node with the consequent position indicator pointer of Y node, the preceding paragraph position indicator pointer of X node is pointed to Y node; C) with the consequent pointed X node of time of time tail pointer node Z, with the preceding paragraph time indicator sensing Z node of X node, and time bit pointer node is pointed to X node.
2. in hash table, remove a node, be divided into the following steps: the position that a) calculates deletion of node X place; B) the consequent node in position of the follow-up pointed X node of the position preceding paragraph node of use X node, and by the position preceding paragraph node of the preceding paragraph pointed X node of the consequent node in position of X node; C) the consequent node of time of the follow-up pointed X node of the time preceding paragraph node of use X node, and by the time preceding paragraph node of the preceding paragraph pointed X node of the consequent node of time of X node;
Update time node, be divided into following step: 1) in the time that the judgement time reaches time head pointer nodes X pointed, first judge that whether the address information that this node stores effective.2) if invalid, by this knot removal, carry out according to remove a node step in hash table; If effectively, time head pointer is pointed to the time subsequent node of X node, the time preceding paragraph pointed time tail node of X node is pointed to node Y, and by consequent the time of node Y pointed X node, time tail pointer is pointed to X node.
2) timed backup and restoration methods
Due to hash table complicated structure, if all regenerate hash table structure at every turn, can cause very large burden to system, therefore adopt the method for timed backup, by in the file system of the information timing storage in hash table, storage policy carries out according to time sequencing.File is for example called " SPAM.txt ":
webmaster@sina.com?2008-11-18?20:20:20
webmaster@163.com?2008-11-18?20.22.20
Address information in each record and temporal information are separated with space, and every information is separated with new line.Because filec descriptor in storing process is in open mode, exiting suddenly of program can cause information dropout, therefore in the process of backup, information is stored in temporary file, as " SPAM1.txt ", in, wait until that all information all preserves completely, to, by file " SPAM1.txt " overlay file " SPAM.txt ", finally " SPAM1.txt " file be deleted again.
In the time of system restart, from file, recover hash table structure, owing to adopting according to time sequencing storage, so step is carried out according to " adding a node in hash table " in mail account information management method in file.

Claims (3)

1. an E-mail gateway type systematic mail accounts maintenance method, is characterized in that:
1) whether adopt smtp protocol and POP3 agreement to survey email account exists;
2) adopt hash structure and time linked list structure storage mail account information;
3) store hash structure into file through fixed cycle time;
4) support to load mail account information from file system;
5) whether email account there is decision method.
Described employing smtp protocol detection method is: the Email Information 1) gateway being received adopts smtp protocol to send to targeted mails system; 2), if delivered successfully, judge that this email account exists, otherwise email account does not exist; Described employing POP3 agreement detection method is: the Email of 1) receiving from gateway, extracting target account information is username information; 2) adopt POP3 agreement to send User+ username information, if receive that user name does not exist information, judge that email account does not exist; Otherwise email account exists;
The method of described employing hash structure and time linked list structure storage mail account information is: 1) will before email account "@" field, extract 2 bytes, if not enough in bit " 00000000 " polishing; 2) in the information of extracting, remove first bit of each byte, the Bit String that formation is made up of 14 bits like this; 3) form the entrance of binary numerical value as hash table according to 14 bits; 4) in hash table, search the addresses of items of mail information of being expert in last addresses of items of mail message structure in hash table entry address, and addresses of items of mail information and temporal information are write in hash structure, and by the current addresses of items of mail message structure of the follow-up pointed hash table node of the hash table node at previous addresses of items of mail information place, timing node end pointer also points to current addresses of items of mail message structure hash table node;
Whether described email account exists the method for judgement to be: 1) from the Email Information receiving, extract targeted mails address; 2) this addresses of items of mail is carried out to hash; 3) in hash table, search it and whether exist, mail is normally delivered if exist, otherwise abandoned.
2. E-mail gateway type systematic mail accounts maintenance method according to claim 1, is characterized in that: the described method that stores hash structure into file through fixed cycle time is: 1) from hash table, extract e-mail messages and temporal information according to time chain; 2) e-mail messages and temporal information are stored in a line in " SPAM.txt " file in assigned catalogue, and add at the end of new line, " r \ n ";
3) use loop structure that all accounts informations are all stored in this file.
3. E-mail gateway type systematic mail accounts maintenance method according to claim 2, it is characterized in that: described support loads mail account information and is from file system: " SPAM.txt " 1) opens file, and therefrom obtain a line, taking " r \ n " as separator; 2) from the information extracting, isolate addresses of items of mail and temporal information, this line information is added in hash table; 3) whether adopt smtp protocol and POP3 agreement to survey email account exists.
CN200910071577.0A 2009-03-19 2009-03-19 E-mail gateway type systematic mail account maintaining method Expired - Fee Related CN101499981B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910071577.0A CN101499981B (en) 2009-03-19 2009-03-19 E-mail gateway type systematic mail account maintaining method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910071577.0A CN101499981B (en) 2009-03-19 2009-03-19 E-mail gateway type systematic mail account maintaining method

Publications (2)

Publication Number Publication Date
CN101499981A CN101499981A (en) 2009-08-05
CN101499981B true CN101499981B (en) 2014-10-22

Family

ID=40946866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910071577.0A Expired - Fee Related CN101499981B (en) 2009-03-19 2009-03-19 E-mail gateway type systematic mail account maintaining method

Country Status (1)

Country Link
CN (1) CN101499981B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136234B (en) * 2011-11-25 2017-05-24 腾讯科技(深圳)有限公司 Data processing method and data processing device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1434390A (en) * 2003-02-28 2003-08-06 上海蓝飞通信设备有限公司 Method for preventing rubbish E-mail
CN1564167A (en) * 2004-04-04 2005-01-12 俞盛 Method of dealing with refuse mail
CN101060421A (en) * 2006-04-19 2007-10-24 腾讯科技(深圳)有限公司 A garbage mail processing system and garbage mail sorting method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1434390A (en) * 2003-02-28 2003-08-06 上海蓝飞通信设备有限公司 Method for preventing rubbish E-mail
CN1564167A (en) * 2004-04-04 2005-01-12 俞盛 Method of dealing with refuse mail
CN101060421A (en) * 2006-04-19 2007-10-24 腾讯科技(深圳)有限公司 A garbage mail processing system and garbage mail sorting method

Also Published As

Publication number Publication date
CN101499981A (en) 2009-08-05

Similar Documents

Publication Publication Date Title
US8577982B2 (en) Method and apparatus for efficiently managing “messages sent” file and resending of messages from mobile wireless communication device
CN101335721B (en) Method and apparatus for creating predictive filters for messages
CN102164097B (en) Mail system and data storage server
CN102664950B (en) Data communication method between welding power sources and computers
CN103327039A (en) Method and device and system for pushing messages
CN104935735A (en) Information deletion method and information deletion system
CA2589522A1 (en) Method and apparatus for efficiently managing "messages sent" file and resending of messages from mobile wireless communication device
CN102986174B (en) Mail transmission system and Mail Gateway
CN101534483B (en) Method and system for realizing breakpoint transmission of multimedia message
CN101662847A (en) Automatic backup and recovery method, system and mobile terminal for mobile terminal address list
CN103685357A (en) Account multi-open message processing method and system
CN102547628A (en) Cellphone short message service software system
CN100411356C (en) Method for managing linkman at client end, and client end
CN101075979B (en) Method and system for associating instant telecommunication session record and e-mail
CN101499981B (en) E-mail gateway type systematic mail account maintaining method
CN102655483A (en) Method, client side and system for obtaining contact information by virtue of emails
CN102196374B (en) Short message forwarding method, system and short message gateway implementing method
US9252974B2 (en) Mail gateway, mail delivery method, and program
CN105069369A (en) Burn-after-reading method and device for document
CN104683213A (en) A mail sending method and device
CN101594301A (en) A kind of message processing method and device
US20130041935A1 (en) Expediting the distribution of data files between a server and a set of clients
US20080313285A1 (en) Post transit spam filtering
US20140297722A1 (en) Media message sending method, device and system
CN102868621B (en) A kind of method utilizing asynchronous mode to realize the fast literary sketch hardware of Large Copacity route

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20141022

Termination date: 20200319