Summary of the invention
In order to solve the problems of the technologies described above, the embodiment of the invention provides a kind of method and apparatus of withholding mail, can withhold the mail of issuing other mailbox that is of little use by a mailbox commonly used.
The embodiment of the invention discloses following technical scheme:
A kind of method of withholding mail comprises:
What receive that the Mail Clients of the first account sends is the instruction of withholding that the second account is withheld mail;
Obtain the address of the mail server of the second account;
Setting up TCP according to the address of the mail server of described the second account with the mail server of the second account is connected;
Connect the mail that from the mail server of described the second account, obtains the second account by the described TCP that sets up;
The mail of the second account of obtaining is sent to the Mail Clients of the first account.
Preferably, what send at the Mail Clients that receives the first account is that the second account is withheld withholding before the instruction of mail, also comprises:
Receive the request message of withholding of the accounts information that carries the second account that the Mail Clients of the first account sends;
Obtain the address of the mail server of the second account;
Setting up TCP according to the address of the mail server of described the second account with the server of the second account is connected;
Connect the authentication request message that sends the accounts information that carries described the second account to the mail server of the second account by the described TCP that sets up, so that the mail server of described the second account authenticates the accounts information of described the second account;
When checking was passed through, response message was passed through in the authentication that receives the mail server transmission of described the second account;
Mail Clients transmission to the first account accepts to withhold response message.
Further preferred, also comprise:
After response message is passed through in the authentication that the mail server that receives described the second account sends, preserve the accounts information of described the second account;
Then, before from the mail server of described the second account, obtaining the mail of the second account by the described TCP connection of setting up, also comprise:
Connect the authentication request message that sends the accounts information of described second account of carrying preservation to the mail server of described the second account by the described TCP that sets up, so that the mail server of described the second account is verified the accounts information of described the second account;
When checking was passed through, response message was passed through in the authentication that receives the mail server transmission of described the second account.
Preferably, in the described address that also carries the mail server of the second account in the request message of withholding that the Mail Clients of the first account sends;
The described address that obtains the mail server of the second account then comprises:
From the described address of extracting the mail server of the second account the request message of withholding.
Preferably, the described address that obtains the mail server of the second account comprises:
The address of from the mail server of each account of self preserving, extracting the mail server of the second account.
Preferably, also comprise:
The mail of the second account of obtaining is saved in the mail server of the first account.
Further preferred, before the mail of the second account that will obtain is saved in the mail server of the first account, also comprise:
For the mail of the second account of obtaining adds sign;
The mail of the second account that then will obtain is saved in the mail server of the first account and is specially:
The mail of the second account after the sign is saved in the mail server of the first account.
Preferably, after from the mail server of described the second account, obtaining the mail of the second account by the described TCP connection of setting up, also comprise:
Keep the mail copy in the mail server of the second account.
Preferably, after from the mail server of described the second account, obtaining the mail of the second account by the described TCP connection of setting up, also comprise:
Delete the mail copy in the mail server of the second account.
Preferably, the described mail that obtains the second account by the described TCP connection of setting up from the mail server of described the second account comprises:
Connect the mail that from the mail server of the second account, obtains the second all accounts by the described TCP that sets up;
Perhaps,
The described mail that obtains the second account by the described TCP connection of setting up from the mail server of described the second account comprises:
Connect the mail that from the mail server of the second account, obtains the second all accounts by the described TCP that sets up;
From the mail of the second all account of obtaining, filter out and meet pre-conditioned mail.
A kind of device of withholding mail comprises:
Withhold the command reception unit, for the Mail Clients transmission that receives the first account is the instruction of withholding of withholding mail of the second account;
The first address acquisition unit is for the address of the mail server that obtains the second account;
First connects and to set up the unit, is used for setting up TCP according to the address of the mail server of described the second account with the mail server of the second account and is connected;
The mail acquiring unit is used for connecting the mail that obtains the second account from the mail server of described the second account by the described TCP that sets up;
Mailing List unit is for the Mail Clients that the mail that obtains is sent to the first account.
Preferably, also comprise:
Withhold the request message receiving element, be used for the first receiving element receive withhold instruction before, receive the request message of withholding of the accounts information that carries the second account that the Mail Clients of the first account sends;
The second address acquisition unit is for the address of the mail server that obtains the second account;
Second connects and to set up the unit, is used for setting up TCP according to the address of the mail server of described the second account with the server of the second account and is connected;
The first authentication request message transmitting element, be used for connecting the authentication request message that sends the accounts information that carries described the second account to the mail server of the second account by the described TCP that sets up, so that the mail server of described the second account authenticates the accounts information of described the second account;
The first authentication response message receiving element passes through response message for the authentication that the mail server that receives described the second account sends;
Withhold the response message transmitting element, be used for sending acceptance to the Mail Clients of the first account and withhold response message.
Further preferred, also comprise:
The first storage unit is used for preserving the accounts information of described the second account after response message is passed through in the checking that the mail server that receives described the second account sends;
The second authentication request message transmitting element, be used for before the mail acquiring unit obtains the mail of the second account, connect the authentication request message that sends the accounts information of described second account of carrying preservation to the mail server of described the second account by the described TCP that sets up, so that the mail server of described the second account is verified the accounts information of described the second account;
The second authentication response message receiving element is used for when checking is passed through, and response message is passed through in the authentication that receives the mail server transmission of described the second account.
Preferably, when described address of withholding the mail server that also carries the second account in the request message that the Mail Clients of the first account sends;
Then described the first address acquisition unit comprises:
First extracts subelement, is used for the address of withholding the mail server of request message extraction the second account from described;
Then described the second address acquisition unit comprises:
Second extracts subelement, is used for the address of withholding the mail server of request message extraction the second account from described.
Preferably, described the first address acquisition unit comprises:
The 3rd extracts subelement, is used for the address of extracting the mail server of the second account from the mail server of each account of self preserving;
Described the second address acquisition unit comprises:
The 4th extracts subelement, is used for the address of extracting the mail server of the second account from the mail server of each account of self preserving.
Preferably, also comprise:
The second storage unit, the mail that is used for the second account that will obtain is saved in the mail server of the first account.
Preferably, also comprise:
Indexing unit was used for before the mail of the second account that the second storage unit will be obtained is saved in the mail server of the first account, for the mail of the second account of obtaining adds sign;
The second storage unit then, the mail of the second account after being used for identifying is saved in the mail server of the first account.
Preferably, also comprise:
Stick unit is used for connecting after the mail server of described the second account obtains the mail of the second account by the described TCP that sets up at the mail acquiring unit, keeps the mail copy in the mail server of the second account.
Preferably, also comprise:
Delete cells is used for connecting after the mail server of described the second account obtains the mail of the second account by the described TCP that sets up at the mail acquiring unit, deletes the mail copy in the mail server of the second account.
Preferably, described mail acquiring unit comprises:
First obtains subelement, is used for connecting the mail that obtains the second all accounts from the mail server of the second account by the described TCP that sets up;
Perhaps,
Described mail acquiring unit comprises:
First obtains subelement, is used for connecting the mail that obtains the second all accounts from the mail server of the second account by the described TCP that sets up;
The screening subelement is used for filtering out from the mail of the second all account of obtaining and meets pre-conditioned mail.
As can be seen from the above-described embodiment, compared with prior art, the invention has the advantages that:
The user only need to login an email accounts, just can utilize the Mail Clients of this email accounts to withhold other a plurality of not mails of the email accounts of login, for some email accounts that is of little use, the user can in time check mail equally under the state of not logining, be very easy to the user for the mail treatment of a plurality of email accounts.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, below in conjunction with accompanying drawing the embodiment of the invention is described in detail.
Embodiment one
See also Fig. 2, it is a kind of flow chart of withholding the method for mail that the embodiment of the invention one discloses, and the method may further comprise the steps:
Step 201: what receive that the Mail Clients of the first account sends is the instruction of withholding that the second account is withheld mail;
Need to prove, in technical solution of the present invention, " the first account " is the account of withholding that is in logging status, " the second account " is and is in not the quilt of logging status and withholds account, the Mail Clients of the first account also is the mail that the second account is withheld the second account except being that the first account receives the mail of the first account.
After the Mail Clients of the first account signs in to the mail server of the first account, can be according to system's setting, regularly withhold instruction to one of the mail server transmission of the first account, perhaps, also can whenever receive a triggering command (as, the user is in a instruction that the Mail Clients of the first account triggers) after, send this to the mail server of the first account and withhold instruction.
Step 202: the address that obtains the mail server of the second account;
The mail server of the first account can some accounts of pre-save the address of mail server, such as the address for the mail server of some accounts commonly used, can in advance the address of the mail server of these accounts commonly used be saved in the first mail server by service provider.
Step 203: set up TCP according to the address of the mail server of described the second account with the mail server of the second account and be connected;
Step 204: connect the mail that from the mail server of described the second account, obtains the second account by the described TCP that sets up;
E-mail system as shown in Figure 1 for the mail recipient, after the mail transport agent of recipient receives the mail that the mail transport agent of outbox side sends, can be saved in this mail among the mail delivery agency of recipient.When the mail transport agent of recipient receives the request message of a reception mail, from the mail delivery agency of recipient, read mail again.
Based on above-mentioned art methods, in technical scheme of the present invention, the mail server of the first account connects by TCP, mail transport agent to the second account sends the mail reception request message first, the mail transport agent of the second account is after receiving this mail reception request message, read the mail of the second account from the mail delivery agency of the second account, the mail of second account that will read again connects the mail server that sends to the first account by TCP.
When the mail server of the first account obtains the mail of the second account, can from the mail server of the second account, obtain the mail of the second all accounts, that is, withhold the mail of the second all accounts.In addition, also can from the mail server of the second account, obtain first the mail of the second all accounts, therefrom filter out again and meet pre-conditioned a part of mail.Pre-conditioned unread mail, interior mail or interior unread mail of time period of time period of comprising." time period " refers to a nearest time period or middle time period.
As, take the mail that obtains the second account in nearest month as example, namely, obtain later mail on March 23rd, 2013, the mail server of the second account is from a nearest envelope mail, one front cover feud sends to the mail of the second account the mail server of the first account, whenever the mail server of the first account receives an envelope mail, just check the time of this envelope mail, if the time is later than on March 23rd, 2013, just keep this mail, continue to receive next envelope mail, otherwise, just abandon this mail, no longer continue to receive mail.
For the mail of the second account in time period in the middle of obtaining (as, obtain the mail in January 1 to January 31 in 2013), also can adopt said method to realize.Certainly, except said method, can also adopt the binary chop algorithm to search the mail of envelope time within this time period, and then search successively according to the method described above mail before this envelope mail and after 1 day January in 2013, and search successively the mail after this envelope mail and before 31 days January in 2013.
Step 205: the mail of the second account that will obtain sends to the Mail Clients of the first account.
For the Mail Clients that makes the first account when logining next time, still can obtain the mail of the second account, as shown in Figure 3, the mail server of the first account sends to the Mail Clients of the first account except the mail of the second account that will obtain, also the mail of the second account of obtaining will be saved in the mail server of the first account.
Need to prove, technical solution of the present invention does not limit the execution sequence of step 305 and step 306, can any one step carry out first, perhaps, can two steps carry out simultaneously yet.
Further, for the Mail Clients that makes the first account when logining next time, not only can obtain the mail of the second account, these mails that can also identify acquisition are the mails of the second account, rather than the mail of the first account, as shown in Figure 4, before the mail of the second account that the mail server of the first account will obtain is saved in the mail server of the first account, mail for the second account of obtaining adds sign first, and the mail of the second account after will identifying again is saved in the mail server of the first account.
As shown in Figure 5, when the mail server of the first account has obtained the mail of the second account from the mail server of the second account after, can also delete the mail copy in the mail server of the second account.In the case, even the Mail Clients of the second account has been logined the mail server of the second account, also can't get access to the mail of the second account.
Need to prove, technical solution of the present invention does not limit the execution sequence of step 505 and step 506, can any one step carry out first, perhaps, can two steps carry out simultaneously yet.
As a kind of substitute mode, and also be that a kind of better implementation is, keep the mail copy in the mail server of the second account.In the case, in case the Mail Clients of the second account has been logined the mail server of the second account, just can from the mail server of the second account, obtain the mail copy of the second account.
As can be seen from the above-described embodiment, compared with prior art, the invention has the advantages that:
The user only need to login an email accounts, just can utilize the Mail Clients of this email accounts to withhold other a plurality of not mails of the email accounts of login, for some email accounts that is of little use, the user can in time check mail equally under the state of not logining, be very easy to the user for the mail treatment of a plurality of email accounts.
Embodiment two
The present embodiment two is with the difference of embodiment one, before instruction is withheld in the Mail Clients transmission of the first account, also need Authority Verification that the Mail Clients of the first account is withheld, checking by the time, just allow the Mail Clients of the first account to withhold the mail of the second account.See also shown in Figure 6ly, it is a kind of flow chart of withholding the method for mail that the embodiment of the invention two discloses, and may further comprise the steps:
Step 601: the request message of withholding that receives the accounts information that carries the second account that the Mail Clients of the first account sends;
Wherein, " accounts information " comprises account and password.
Step 602: the address that obtains the mail server of the second account;
The mail server of the first account can self some account of pre-save the address of mail server, as, for the address of the mail server of some accounts commonly used, can in advance the address of the mail server of these accounts commonly used be saved in the first mail server by service provider.
And for the address of the mail server of some inactive accounts, in the situation that service provider can't know in advance, can before withholding mail, the address of the mail server of these inactive accounts be sent to by the Mail Clients of the first account the mail server of the first account, namely, add mail server to the second account by the Mail Clients of the first account, preserved by the mail server of the first account again.A kind of implementation is, send to the withholding in the request message of mail server of the first account at the Mail Clients of the first account, except carrying accounts information, also carry the address of the mail server of the second account, the mail server of the first account is withheld the address of the mail server that extracts the second account the request message from this.
Step 603: set up TCP according to the address of the mail server of described the second account with the mail server of the second account and be connected;
Step 604: connect the authentication request message that sends the accounts information that carries described the second account to the mail server of the second account by the described TCP that sets up, so that the mail server of described the second account authenticates the accounts information of described the second account;
Step 605: when checking was passed through, response message was passed through in the authentication that receives the mail server transmission of described the second account;
Step 606: the Mail Clients transmission to the first account accepts to withhold response message;
Step 607: what receive that the Mail Clients of the first account sends is the instruction of withholding that the second account is withheld mail;
Step 608: the address that obtains the mail server of the second account;
Step 609: set up TCP according to the address of the mail server of described the second account with the mail server of the second account and be connected;
Step 610: connect the mail that from the mail server of described the second account, obtains the second account by the described TCP that sets up;
Step 611: the mail of the second account that will obtain sends to the Mail Clients of the first account.
Need to prove, the concrete implementation of above-mentioned steps 607-611 can be referring to the step 201-206 among the embodiment one, and the present embodiment repeats no more this.
As can be seen from the above-described embodiment, compared with prior art, the invention has the advantages that:
The user only need to login an email accounts, just can utilize the Mail Clients of this email accounts to withhold other a plurality of not mails of the email accounts of login, for some email accounts that is of little use, the user can in time check mail equally under the state of not logining, be very easy to the user for the mail treatment of a plurality of email accounts.
And, also added and withheld authentication mechanism, further guaranteed in withholding process, to be withheld the fail safe of account.
Embodiment three
The present embodiment three is with the difference of embodiment two, before the mail server of the first account obtains the mail of the second account from the mail server of the second account, carry out again Authority Verification one time, when checking is passed through, just allow the mail server of the first account to obtain mail.See also shown in Figure 7ly, it is a kind of flow chart of withholding the method for mail that the embodiment of the invention three discloses, and may further comprise the steps:
Step 701: the request message of withholding that receives the accounts information that carries the second account that the Mail Clients of the first account sends;
Wherein, " accounts information " comprises account and password.
Step 702: the address that obtains the mail server of the second account;
The mail server of the first account can self some account of pre-save the address of mail server, as, for the address of the mail server of some accounts commonly used, can in advance the address of the mail server of these accounts commonly used be saved in the first mail server by service provider.
And for the address of the mail server of some inactive accounts, in the situation that service provider can't know in advance, can before withholding mail, the address of the mail server of these inactive accounts be sent to by the Mail Clients of the first account the mail server of the first account, namely, add mail server to the second account by the Mail Clients of the first account, preserved by the mail server of the first account again.A kind of implementation is, send to the withholding in the request message of mail server of the first account at the Mail Clients of the first account, except carrying accounts information, also carry the address of the mail server of the second account, the mail server of the first account is withheld the address of the mail server that extracts the second account the request message from this.
Step 703: set up TCP according to the address of the mail server of described the second account with the mail server of the second account and be connected;
Step 704: connect the authentication request message that sends the accounts information that carries described the second account to the mail server of the second account by the described TCP that sets up, so that the mail server of described the second account authenticates the accounts information of described the second account;
Step 705: when checking was passed through, response message was passed through in the authentication that receives the mail server transmission of described the second account;
Step 706: the Mail Clients transmission to the first account accepts to withhold response message;
Step 707: the accounts information of preserving described the second account;
Step 708: what receive that the Mail Clients of the first account sends is the instruction of withholding that the second account is withheld mail;
Step 709: the address that obtains the mail server of the second account;
Step 710: set up TCP according to the address of the mail server of described the second account with the mail server of the second account and be connected;
Step 711: connect the authentication request message that sends the accounts information of described second account of carrying preservation to the mail server of described the second account by the described TCP that sets up, so that the mail server of described the second account is verified the accounts information of described the second account;
Step 712: when checking was passed through, response message was passed through in the authentication that receives the mail server transmission of described the second account;
Step 713: connect the mail that from the mail server of described the second account, obtains the second account by the described TCP that sets up;
Step 714: the mail of the second account that will obtain sends to the Mail Clients of the first account.
As can be seen from the above-described embodiment, compared with prior art, the invention has the advantages that:
The user only need to login an email accounts, just can utilize the Mail Clients of this email accounts to withhold other a plurality of not mails of the email accounts of login, for some email accounts that is of little use, the user can in time check mail equally under the state of not logining, be very easy to the user for the mail treatment of a plurality of email accounts.
And, also added and withheld authentication mechanism, further guaranteed in withholding process, to be withheld the fail safe of account.
Embodiment four
Corresponding with above-mentioned a kind of method of withholding mail, the embodiment of the invention also provides a kind of device of withholding mail.See also Fig. 8, a kind of structure chart of withholding the device of mail that it discloses for the embodiment of the invention four, this device comprise that withholding command reception unit 801, the first address acquisition unit 802, first connects and set up unit 803, mail acquiring unit 804 and Mailing List unit 805.Operation principle below in conjunction with this device is further introduced its internal structure and annexation.
Withhold command reception unit 801, for the Mail Clients transmission that receives the first account is the instruction of withholding of withholding mail of the second account;
The first address acquisition unit 802 is for the address of the mail server that obtains the second account;
First connects and to set up unit 803, is used for setting up TCP according to the address of the mail server of described the second account with the mail server of the second account and is connected;
Mail acquiring unit 804 is used for connecting the mail that obtains the second account from the mail server of described the second account by the described TCP that sets up;
Mailing List unit 805 is for the Mail Clients that the mail that obtains is sent to the first account.
Preferably, mail acquiring unit 804 comprises: first obtains subelement, is used for connecting the mail that obtains the second all accounts from the mail server of the second account by the described TCP that sets up.
Scheme as an alternative, as shown in Figure 9, mail acquiring unit 804 comprises: first obtains subelement 8041 and screening subelement 8042,
First obtains subelement, is used for connecting the mail that obtains the second all accounts from the mail server of the second account by the described TCP that sets up;
The screening subelement is used for filtering out from the mail of the second all account of obtaining and meets pre-conditioned mail.
Preferably, as shown in figure 10, on apparatus structure basis shown in Figure 8, this device also comprises: withhold request message receiving element 806, the second address acquisition unit 807, second and connect and set up unit 808, the first authentication request message transmitting element 809, the first authentication response message receiving element 810 and withhold response message transmitting element 811, wherein
Withhold request message receiving element 806, be used for the first receiving element receive withhold instruction before, receive the request message of withholding of the accounts information that carries the second account that the Mail Clients of the first account sends;
The second address acquisition unit 807 is for the address of the mail server that obtains the second account;
Second connects and to set up unit 808, is used for setting up TCP according to the address of the mail server of described the second account with the server of the second account and is connected;
The first authentication request message transmitting element 809, be used for connecting the authentication request message that sends the accounts information that carries described the second account to the mail server of the second account by the described TCP that sets up, so that the mail server of described the second account authenticates the accounts information of described the second account;
The first authentication response message receiving element 810 passes through response message for the authentication that the mail server that receives described the second account sends;
Withhold response message transmitting element 811, be used for sending acceptance to the Mail Clients of the first account and withhold response message.
Further preferred, as shown in figure 11, on apparatus structure basis shown in Figure 10, this device also further comprises:
The first storage unit 812 is used for preserving the accounts information of described the second account after response message is passed through in the checking that the mail server that receives described the second account sends;
The second authentication request message transmitting element 813, be used for before the mail acquiring unit obtains the mail of the second account, connect the authentication request message that sends the accounts information of described second account of carrying preservation to the mail server of described the second account by the described TCP that sets up, so that the mail server of described the second account is verified the accounts information of described the second account;
The second authentication response message receiving element 814 is used for when checking is passed through, and response message is passed through in the authentication that receives the mail server transmission of described the second account.
Preferably, in Figure 10 or device shown in Figure 11, when described address of withholding the mail server that also carries the second account in the request message that the Mail Clients of the first account sends; The first address acquisition unit 802 comprises: first extracts subelement, is used for the address of withholding the mail server of request message extraction the second account from described; The second address acquisition unit 807 comprises: second extracts subelement, is used for the address of withholding the mail server of request message extraction the second account from described.
As a kind of alternative, preferably, in Fig. 8, Figure 10 and device shown in Figure 11, the first address acquisition unit 802 comprises: the 3rd extracts subelement, is used for the address of extracting the mail server of the second account from the mail server of each account of self preserving; The second address acquisition unit 807 comprises: the 4th extracts subelement, is used for the address of extracting the mail server of the second account from the mail server of each account of self preserving.
Preferably, as shown in figure 12, on architecture basics shown in Figure 8, this device also comprises: the second storage unit 815, the mail that is used for the second account that will obtain is saved in the mail server of the first account.
Further preferred, this device also comprises: indexing unit, be used for before the mail of the second account that the second storage unit will be obtained is saved in the mail server of the first account, and for adding, the mail of the second account of obtaining identifies; The second storage unit 815 then, the mail of the second account after being used for identifying is saved in the mail server of the first account.
Preferably, this device also comprises: stick unit, be used for connecting after the mail server of described the second account obtains the mail of the second account by the described TCP that sets up at the mail acquiring unit, and keep the mail copy in the mail server of the second account.Scheme as an alternative, stick unit can replace with delete cells, be used for connecting after the mail server of described the second account obtains the mail of the second account by the described TCP that sets up at the mail acquiring unit, delete the mail copy in the mail server of the second account.
As can be seen from the above-described embodiment, compared with prior art, the invention has the advantages that:
The user only need to login an email accounts, just can utilize the Mail Clients of this email accounts to withhold other a plurality of not mails of the email accounts of login, for some email accounts that is of little use, the user can in time check mail equally under the state of not logining, be very easy to the user for the mail treatment of a plurality of email accounts.
And, also added and withheld authentication mechanism, further guaranteed in withholding process, to be withheld the fail safe of account.
Need to prove, one of ordinary skill in the art will appreciate that all or part of flow process that realizes in above-described embodiment method, to come the relevant hardware of instruction to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process such as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
Above a kind of method and apparatus of withholding mail provided by the present invention is described in detail, used specific embodiment herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.