CN107104889B - Draft mail synchronization method, draft mail synchronization device and draft mail synchronization terminal based on IMAP protocol - Google Patents

Draft mail synchronization method, draft mail synchronization device and draft mail synchronization terminal based on IMAP protocol Download PDF

Info

Publication number
CN107104889B
CN107104889B CN201710546713.1A CN201710546713A CN107104889B CN 107104889 B CN107104889 B CN 107104889B CN 201710546713 A CN201710546713 A CN 201710546713A CN 107104889 B CN107104889 B CN 107104889B
Authority
CN
China
Prior art keywords
mail
draft
mobile terminal
folder
server
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
CN201710546713.1A
Other languages
Chinese (zh)
Other versions
CN107104889A (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.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications 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 Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201710546713.1A priority Critical patent/CN107104889B/en
Publication of CN107104889A publication Critical patent/CN107104889A/en
Application granted granted Critical
Publication of CN107104889B publication Critical patent/CN107104889B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • 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 application provides a draft mail synchronization method, a draft mail synchronization device and a draft mail synchronization terminal based on an IMAP protocol, wherein when a draft mail in a state to be uploaded in a mobile terminal is uploaded to a mail server, a mail identifier of the draft mail returned by the mail server is stored in a first list; storing the mail identifier of the draft mail stored in the mail server in a second list; then determining the target mail identifiers stored in the second list but not stored in the first list; and downloading the draft mail corresponding to the target mail identifier from the mail server to the mobile terminal. Therefore, the draft mails in the mobile terminal can be uploaded to the mail server synchronously, and the draft mails in other terminal equipment can be downloaded to the mobile terminal synchronously, so that the downloaded draft mails can be checked or edited continuously, and the user experience is improved.

Description

Draft mail synchronization method, draft mail synchronization device and draft mail synchronization terminal based on IMAP protocol
Technical Field
The present application relates to the field of electronic mail, and in particular, to a method, an apparatus, and a terminal for synchronizing a draft mail based on an IMAP protocol.
Background
With the wide popularization of mobile terminal devices such as smart phones and tablet computers, email service based on mobile terminals is also widely applied. The user of the electronic mailbox can finish the check, reading, writing, replying and forwarding of the electronic mail on the mobile terminal equipment, thereby greatly improving the working and living efficiency of the user.
Fig. 1 is a schematic diagram of a network system structure of a typical email. As shown in fig. 1, the network system of the electronic mail includes a plurality of mail servers and a plurality of terminal devices (such as a PC, a mobile phone, and an ipad) connected to the respective mail servers. The terminal equipment can be a sending end of the mail and can also be a receiving end of the mail; the mail server can be used as a sending end server and can also be used as a receiving end server. The e-mail receiving and sending process comprises the following steps: the terminal device as the sending end sends the Mail to the sending end server through an SMTP Protocol (Simple Mail Transfer Protocol), the sending end server sends the Mail to the receiving end server through the SMTP Protocol, the PC terminal as the receiving end can read the Mail stored in the receiving end server through a POP Protocol or an IMAP Protocol (Internet Mail Access Protocol), or a Mail forwarding server (part of Mail forwarding servers in the figure are not shown) connected with the receiving end server pushes the Mail received by the receiving end server to a mobile terminal of the receiving end in real time through a pushmail (Mail push) technology, thereby realizing the sending and receiving of the electronic Mail.
At present, when an IMAP protocol is adopted by a mail client in a mobile terminal, only an email to be sent is generally synchronized into a cache of a mail server, and a draft mail cannot be synchronized between a terminal device and the mail server, thereby bringing about the following problems: the mobile terminal cannot upload the edited draft mails synchronously, and cannot download the draft mails in other terminal devices (such as web page version mailboxes, mail clients of other mobile terminals, and the like) synchronously for continuous processing, which undoubtedly causes great troubles to email users of the mobile terminal.
Disclosure of Invention
The application provides a draft mail synchronization method, a draft mail synchronization device and a draft mail synchronization terminal based on an IMAP protocol, which can synchronously upload draft mails in a mobile terminal to a mail server and synchronously download draft mails in other terminal equipment to the mobile terminal.
In a first aspect, the present application provides a draft mail synchronization method based on an IMAP protocol, which is applied to a mobile terminal, and the method includes:
when a draft mail in a state to be uploaded in a mobile terminal is uploaded to a mail server, storing a mail identifier of the draft mail returned by the mail server in a first list;
acquiring a mail identifier of a draft mail stored in a mail server, and storing the mail identifier in a second list;
determining a target mail identifier, the target mail identifier being stored in the second list but not in the first list;
and downloading the draft mail corresponding to the target mail identifier from the mail server to the mobile terminal.
In a second aspect, the present application further provides an apparatus for synchronizing a draft mail based on an IMAP protocol, which is applied to a mobile terminal, and the apparatus includes:
the first storage module is used for storing the mail identifier of the draft mail returned by the mail server into a first list when the draft mail in the state to be uploaded in the mobile terminal is uploaded to the mail server;
the second storage module is used for acquiring the mail identifier of the draft mail stored in the mail server and storing the mail identifier in a second list;
a determining module for determining a target mail identifier, said target mail identifier being stored in the second list but not in the first list;
and the synchronization module is used for downloading the draft mail corresponding to the target mail identifier from the mail server to the mobile terminal.
In a third aspect, the present application further provides a terminal device, where the terminal device includes the synchronization apparatus in the second aspect.
The beneficial effect of this application is as follows:
the application provides a draft mail synchronization method, a draft mail synchronization device and a draft mail synchronization terminal based on an IMAP protocol, wherein when a draft mail in a state to be uploaded in a mobile terminal is uploaded to a mail server, a mail identifier of the draft mail returned by the mail server is stored in a first list; storing the mail identifier of the draft mail stored in the mail server in a second list; then determining the target mail identifiers stored in the second list but not stored in the first list; and downloading the draft mail corresponding to the target mail identifier from the mail server to the mobile terminal. Therefore, the draft mails in the mobile terminal can be uploaded to the mail server synchronously, and the draft mails in other terminal equipment can be downloaded to the mobile terminal synchronously, so that the downloaded draft mails can be checked or edited continuously, and the user experience is improved.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a schematic diagram of a typical network architecture for email;
fig. 2 is a flowchart of a draft mail synchronization method based on an IMAP protocol according to an embodiment of the present application;
fig. 3 is a flowchart of a draft mail synchronization method based on an IMAP protocol according to a second embodiment of the present application;
fig. 4 is a schematic diagram of a draft box of a mail client according to a second embodiment of the present application;
fig. 5 is a flowchart of step S201 provided in the second embodiment of the present application;
fig. 6 is a flowchart of step S2013 provided in embodiment two of the present application;
fig. 7 is a flowchart of step S2011 according to the second embodiment of the present application;
fig. 8 is a flowchart of a method for creating a draft folder by a mobile terminal according to a second embodiment of the present application;
fig. 9 is a schematic structural diagram of a synchronization apparatus for draft mails based on IMAP protocol according to a third embodiment of the present application.
Detailed Description
The method for synchronizing the draft mails is established on the basis of an IMAP (Internet mail protocol), and communication between the mobile terminal and the mail server is realized by using related commands of the IMAP. The method can solve the technical problem that the draft mail of the mobile terminal cannot be synchronized with the mail server, so that the electronic mailbox user can operate the draft mail on different terminal devices. The following describes the synchronization method of the draft mail provided in the present application in detail with reference to the accompanying drawings.
Referring to fig. 2, a flowchart of a draft mail synchronization method based on an IMAP protocol according to an embodiment of the present application is provided. As can be seen from fig. 2, the method comprises the following steps:
step S101: when the draft mails in the state to be uploaded in the mobile terminal are uploaded to the mail server, mail identifiers of the draft mails returned by the mail server are stored in a first list.
When receiving the draft mails uploaded by the terminal equipment, the mail server creates a corresponding mail identifier (UID) for each draft mail and returns the mail identifier to the corresponding terminal equipment. Each mail identifier uniquely corresponds to a draft mail in the mail server, and the terminal equipment can identify the draft mail which is uploaded to the mail server according to the mail identifier. Therefore, the draft mails corresponding to the mail identifiers in the draft folder of the mobile terminal are all draft mails synchronized to the mail server. The mobile terminal stores the extracted mail identifier in a first list (Local message id Array list).
Step S102: mail identifiers of draft mails stored in the mail server are acquired, and the mail identifiers are stored in a second list.
The mail identifier SEARCH command (UID SEARCH command) in IMAP protocol is used for acquiring mail identifiers meeting matching conditions on the mail server, and if no matching mail exists, a SEARCH word without UID number is returned. The UID SEARCH command carries query condition parameters, which are typically keywords and values for an explicit query. In this embodiment, the mobile terminal may send a UID SEARCH command of the draft email to the email server, where the query condition parameter of the UID SEARCH command is a draft folder. After receiving the UID SEARCH command which is sent by the mobile terminal and carries the draft folder query condition parameters, the mail server returns the mail identifiers of all draft mails stored in the mail server to the mobile terminal. The mobile terminal stores the mail identifier of the received draft mail in the mail server in a second list (Remote message id Array list) of the local database.
In addition, in this embodiment, the trigger condition for the mobile terminal to send the mail identifier search command of the draft mail to the mail server may be a mail synchronization command received by the mobile terminal. The mail synchronization command may be a separately set query command embodied as a client for querying whether the email user needs to synchronize the draft mail of the mail server; or the mail synchronization command can be automatically generated when the email user opens the draft box of the client, and at the moment, the email user does not need to make judgment.
Step S103: a target mail identifier is determined.
By traversing the first list and the second list, the mail identifier stored in the second list but not stored in the first list can be found, and the present embodiment determines the mail identifier as the target mail identifier. The draft mail corresponding to the target mail identifier is the draft mail uploaded by other terminal devices except the mobile terminal in the mail server, that is, the draft mail required to be synchronously downloaded by the mobile terminal.
Step S104: and downloading the draft mail corresponding to the target mail identifier from the mail server to the mobile terminal.
The reading command (FETCH command) in the IMAP protocol is used to read the text information of the mail, and the FETCH command carries a message set parameter, which indicates the list of mail identifiers that are desired to be read. In this embodiment, the messageset parameter is a list of identifiers of the target mail. After receiving the FETCH command of the target mail identifier list, the mail server returns the draft mail corresponding to the target mail identifier to the mobile terminal, so that the electronic mail user can continue to operate the draft mail on the mobile terminal.
The embodiment can not only upload the draft mails in the mobile terminal to the mail server synchronously, but also download the draft mails in other terminal equipment to the mobile terminal synchronously, so that the downloaded draft mails can be checked or edited continuously, and the user experience is improved.
However, in some cases, the email user may repeatedly edit a piece of draft email on different terminal devices, for example, the email user creates a draft on the email client a, and selects the upload email server after editing, which is the initial version v1 of the piece of draft email; if the email user synchronizes the draft box on the email client B, synchronizes the draft of the v1 version to the local and then continues to edit the draft email, and uploads the version v2 as the original draft email to the email server after the editing is completed, the email server will store the draft email as a new draft email. If the email user continues to synchronize the draft boxes on mail client C, both the initial version v1 and version v2 of the draft mail are synchronized to the local database.
Based on the above situation, the second embodiment of the present application provides a synchronization method for a draft mail based on an IMAP protocol, and this embodiment performs aggregation processing on the received initial version v1 and version v2, so as to implement version tracing of the draft mail on different mail clients. Referring to fig. 3, a flowchart of a draft mail synchronization method based on the IMAP protocol according to the second embodiment of the present application is provided. As can be seen from fig. 3, the method comprises the following steps:
step S201: when the draft mails in the state to be uploaded in the mobile terminal are uploaded to the mail server, mail identifiers of the draft mails returned by the mail server are stored in a first list.
Step S202: mail identifiers of draft mails stored in the mail server are acquired, and the mail identifiers are stored in a second list.
Step S203: a target mail identifier is determined.
Step S204: and downloading the draft mail corresponding to the target mail identifier from the mail server to the mobile terminal.
Step S205: detecting whether at least two draft mails with the same theme exist in the mobile terminal. If at least two draft mails with the same subject exist in the mobile terminal, step S206 is executed.
Step S206: and storing the at least two pieces of draft mails with the same theme in a temporary folder according to the sequence of uploading time, wherein the temporary folder is named by the theme of the stored draft mails.
In this embodiment, in order to facilitate the email user to trace back different versions of the draft emails, the draft emails with the same subject are collected, that is, at least two draft emails with the same subject are stored in a certain temporary folder, and the temporary folder is embodied as one piece of email information named by the subject of the draft email on the email client. In addition, in order to facilitate searching and checking of the e-mail user, the draft mails in the temporary folder are stored according to the time sequence of uploading the draft mails to the mail server.
Please refer to fig. 4, which is a schematic diagram of a draft box of a mail client according to a second embodiment of the present application. In the draft mail list shown in fig. 4, the mail information in the black box on the left side actually contains two pieces of draft mails, which are a collection form of draft mails with the same subject. The black square part on the right side is an expanded form of the mail information, and an email user can optionally select one draft mail from the two draft mails for further processing. Of course, in other embodiments of the present application, only one piece of draft mail with the latest uploading time may be retained, so as to avoid that the draft mail with too many versions occupies the storage space of the terminal device when the storage space is limited.
Please refer to fig. 5, which is a flowchart of step S201 provided in the second embodiment of the present application. As can be seen from fig. 5, step S201 may further include the following steps:
step S2011: after the mobile terminal saves or updates the draft mails, the draft mails needing to be synchronized in the draft folder of the mobile terminal are set to be in a state to be uploaded.
The draft folder of the mobile terminal is a folder for storing the draft mails in the mobile terminal database, and in this embodiment, the draft folder of the mobile terminal is a synchronizable folder correspondingly set to the draft folder in the corresponding mail server. And only when the mobile terminal detects that the folder attribute of the draft folder of the mobile terminal is a synchronizable folder, allowing the mobile terminal to execute the synchronization operation of the folders and synchronizing the draft folder of the mobile terminal with the draft folder of the mail server.
In addition, the present embodiment may implement setting of the uploading status of the draft email by setting the uploading attribute of the draft email. The uploading attribute of the draft mail comprises a true type and a false type, when the mobile terminal detects that the uploading attribute of the draft mail is marked as true, the draft mail can be judged to be in a state to be uploaded, and the draft mail in the state to be uploaded is synchronized to a mail server through further synchronous operation; when the mobile terminal detects that the uploading attribute of the draft mail is marked as false, the mobile terminal can judge that the draft mail is in a non-uploading state, and the draft mail does not need to be synchronized.
In this embodiment, in order to distinguish the importance degree of the draft email, the mobile terminal may further distinguish the common draft email and the important draft email by the important identifier. The important identifier can be embodied at a mailbox client of the mobile terminal, and specifically can be a red flag, a star flag and other shape and form flags. The electronic mailbox user can determine the important draft mails according to actual needs, for example, the important draft mails in a to-be-uploaded state which need to be continuously edited or added with attachments at other clients, or the draft mails which have high confidentiality and can be edited only at a mobile terminal can be used.
Step S2012: and detecting whether at least one draft mail in a to-be-uploaded state exists in a draft folder of the mobile terminal according to a preset synchronization frequency. If at least one draft mail in the to-be-uploaded state exists in the draft folder of the mobile terminal, step S2073 is executed.
In this embodiment, the synchronization frequency is set to be real-time synchronization, that is, the uploading attribute of the draft email is continuously monitored, so as to shorten the synchronization period of the draft email. The biggest difference between the mobile terminal and the PC terminal in the application is that the mobile terminal is not on-line in real time. In general, a data service (e.g., GSM/GPRS service) is only activated when a user of a mobile terminal needs to access a network, and a draft mail stored in the mobile terminal is synchronized to a mail server, which undoubtedly requires that the mobile terminal is in an online state.
In a practical application scenario, an email user may edit a piece of draft mail outdoors using a mobile terminal, but needs to return indoors and add a large attachment to the file using a PC, and in such a case, the timeliness requirement for synchronization of the draft mail is not high. Therefore, in other embodiments of the present application, the mobile terminal may traverse the draft folder once every other period of time, detect the uploading attribute of each piece of draft mail, and open the data service to upload the draft mail when at least one piece of draft mail in the to-be-uploaded state exists. By the method, various problems caused by the real-time synchronization can be avoided to a certain extent. In addition, the above application scenarios are only illustrative examples and are not limited to this application scenario.
Step S2013: and sending a mail adding command to the mail server so as to synchronize the draft mail in the to-be-uploaded state to the mail server.
Before sending a mail adding command (APPEND command) to a mail server, the mobile terminal needs to establish a TCP connection with the mail server first, and then performs information interaction on the basis. The method includes that an APPEND command in the IMAP protocol allows a terminal device to upload a mail to a designated mail server folder, and the draft mail in a to-be-uploaded state in the mobile terminal is synchronized to a draft folder of a mail server through the APPEND command. The mail server receives the apend command sent by the mobile terminal, and then stores the above draft mail information contained in the apend command into a draft folder, and further the mobile terminal stores the draft mail to be downloaded into a local database for further editing or other processing, and finally completes synchronization of the draft mail at different terminals.
Step S2014: and setting the draft mail in the to-be-uploaded state as a non-uploaded state.
In this embodiment, the draft email that completes synchronization is set to be in a non-upload state, so as to avoid that step S2012 detects that the draft email is still in a to-be-uploaded state and triggers synchronization operation, which causes the draft email to be repeatedly uploaded, resulting in unnecessary waste of network resources.
In addition, when the electronic mailbox user filters the draft mails, the synchronized draft mails may be mistakenly selected as the draft mails needing synchronization due to reasons such as similar subjects, so that the same draft mail without any operation is uploaded for multiple times, and unnecessary network resources and storage space are occupied. In order to avoid the above situation, a second embodiment of the present application provides another draft email synchronization method based on the IMAP protocol. Referring to fig. 6, a flowchart of step S2013 provided in embodiment two of the present application is shown. As can be seen from fig. 6, step S2013 includes the steps of:
step S20131: and detecting whether a mail list contains a mail identifier corresponding to the draft mail in the to-be-uploaded state. If the mail list does not include a mail identifier uniquely corresponding to the draft mail in the to-be-uploaded state, step S20732 is performed.
After receiving the apend command sent by the mobile terminal, the mail server extracts effective information of the draft mail (attribute of the draft mail, creation date/creation time, mail size, specific mail data and the like) from the draft mail, and correspondingly stores the effective information of the draft mail in a draft folder of the mail server. Meanwhile, the mail server will create a corresponding mail identifier for each received draft mail, and return the corresponding mail identifier to the mobile terminal, so that the mobile terminal can identify the draft mail synchronized to the mail server. The mail identifier in this embodiment is a UID number of a mail, the UID number is generally a 32-bit certificate for uniquely identifying the mail in the mail system, and each mail in the mail server uniquely corresponds to one mail identifier for distinguishing other mails. After receiving the mail identifier returned by the mail server, the mobile terminal stores the mail identifier in a mail list, where the mail list is used to store mail information corresponding to each draft mail, and the mail information may include valid information of the draft mail and identification information (e.g., UID number) of the draft mail.
Further, whether the mail list contains a mail identifier corresponding to the draft mail in the to-be-uploaded state is detected, so that the synchronous record of the corresponding draft mail is determined.
Step S20132: and sending a mail adding command to the mail server.
If the mail list does not contain the mail identifier uniquely corresponding to the draft mail in the to-be-uploaded state, the fact that the draft mail is not uploaded to the mail server before is indicated, at the moment, a mail adding command is sent to the mail server, and therefore the same draft mail which is not subjected to any operation is not repeatedly uploaded.
Referring to fig. 7, a flowchart of step S2011 according to the second embodiment of the present application is shown. As can be seen from fig. 7, step S2011 includes the steps of:
step S20111: and when the mobile terminal is in a state of saving or updating the draft mail, detecting whether an instruction for synchronizing the draft mail to the mail server is received. If an instruction to synchronize the draft mail to the mail server is received, step S20112 is executed.
Step S20112: and setting the draft mail to be in a state to be uploaded.
In this embodiment, when the mobile terminal is in the state of saving or updating the draft mail, the uploading state of the draft mail is determined by detecting the synchronization command of the saved or updated draft mail. By determining the uploading state of the draft mail in the above mode, the problem that the draft mail which is not changed is repeatedly uploaded can be solved. In addition, the embodiment determines the uploading state while the draft mail is saved or updated, that is, the uploading state is determined when the draft mail is changed. The mobile terminal triggers the synchronization mechanism when detecting that the draft mail in the to-be-uploaded state exists in real time, so as to synchronize the draft mail to the mail server.
When a mail client is installed for the first time by a terminal device, a draft folder needs to be created in a local database of the terminal device, and a corresponding relation between the draft folder in the terminal device and the draft folder in a mail server is created, so that a draft mail in a state to be uploaded in the terminal device is synchronized to the mail server subsequently, and the draft mail in the mail server is downloaded to the local database for further processing. For the case that the mobile terminal uses the mail client for the first time, referring to fig. 8, a flowchart of a method for creating a draft folder for the mobile terminal provided in the second embodiment is specifically, before setting a draft mail that needs to be synchronized in the draft folder of the mobile terminal to a to-be-uploaded state in step S2011, the second embodiment may further include the following steps:
step S2001: and sending a column directory command to a corresponding mail server to acquire a folder list in the mail server.
A LIST directory command (LIST command) in the IMAP protocol is used for listing existing folders in a mail server, and specifically comprises two parameters, wherein the first parameter is a mailbox path parameter BASE which represents a user login directory; the second parameter is template, which indicates the folder name that is desired to be displayed. The LIST command may contain the starting path location and the characteristics to which the folder needs to be listed. In this embodiment, all folders included in the mail server may be listed through the LIST command, and in other embodiments, the draft folder may be directly screened out through the template parameter.
After the mail server receives the LIST command sent by the mobile terminal, a folder LIST in the mail server is returned to the mobile terminal, wherein the folder LIST comprises folder information corresponding to all folders in the mail server. The folder information may include information such as folder attributes, folder identifiers for uniquely identifying folders in the mail server, and storage paths of folders in the mail server.
Step S2002: and extracting the folder information of the draft folder in the mail server from the folder list.
The folder information includes a folder attribute, and the present embodiment can identify the draft folder with the folder attribute. Specifically, the folder attribute of the draft folder is identified as Drafts, and therefore, the folder whose folder attribute is Drafts can be determined as the draft folder, thereby extracting the folder information corresponding to the draft folder.
Step S2003: creating a draft folder for storing draft mails in the mobile terminal, wherein the draft folder comprises folder information of the draft folder in the mail server.
In this embodiment, through steps S2001 to S2003, a correspondence between the rough draft folder in the mobile terminal and the rough draft folder in the mail server is established, so that the subsequent synchronous operation of the terminal device and the mail server is facilitated.
The third embodiment of the application further provides a draft mail synchronization device based on the IMAP protocol, which is applied to a mobile terminal. Referring to fig. 9, a schematic structural diagram of a synchronization apparatus 300 for draft mails based on IMAP protocol according to a third embodiment of the present application is provided. As can be seen from fig. 9, the synchronization device 300 includes:
a first storage module 301, configured to store, when a draft mail in a to-be-uploaded state in a mobile terminal is uploaded to a mail server, a mail identifier of the draft mail returned by the mail server in a first list;
a second storage module 302, configured to obtain a mail identifier of a draft mail stored in the mail server, and store the mail identifier in a second list;
a determining module 303 for determining a target mail identifier, which is stored in the second list but not in the first list;
and a synchronization module 304, configured to download the draft mail corresponding to the target mail identifier from the mail server to the mobile terminal.
In addition, the application also provides a terminal device, and the terminal device comprises the synchronization device of the third embodiment.
In a specific implementation, the present invention further provides a computer storage medium, where the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments of the calling method provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of software products, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and include commands for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.

Claims (8)

1. A draft mail synchronization method based on IMAP protocol is applied to a mobile terminal, and is characterized in that the method comprises the following steps:
when a draft mail in a state to be uploaded in a mobile terminal is uploaded to a mail server, storing a mail identifier of the draft mail returned by the mail server in a first list, and identifying the draft mail uploaded to the mail server by the mobile terminal according to the mail identifier;
acquiring a mail identifier of a draft mail stored in a mail server, and storing the mail identifier in a second list;
determining a target mail identifier, the target mail identifier being stored in the second list but not in the first list;
and downloading the draft mail corresponding to the target mail identifier from the mail server to the mobile terminal.
2. The method of claim 1, wherein after downloading the draft mail corresponding to the target mail identifier from the mail server to a mobile terminal, the method further comprises:
detecting whether at least two draft mails with the same theme exist in the mobile terminal;
if at least two pieces of draft mails with the same theme exist in the mobile terminal, the draft mails with the same theme are stored in a temporary folder according to the sequence of uploading time, and the temporary folder is named by the theme of the stored draft mails.
3. The method according to claim 1, wherein uploading the draft mail in the to-be-uploaded state in the mobile terminal to a mail server specifically comprises:
after the mobile terminal stores or updates the draft mails, setting the draft mails needing to be synchronized in a draft folder of the mobile terminal to be in a state to be uploaded, wherein the draft folder in the mobile terminal is a synchronizable folder which is correspondingly set with the draft folder in the mail server;
if at least one draft mail in the to-be-uploaded state exists in a draft folder of the mobile terminal, sending a mail adding command to the mail server so as to synchronize the draft mail in the to-be-uploaded state to the mail server;
and setting the draft mail in the to-be-uploaded state as a non-uploaded state.
4. The method according to claim 3, wherein if at least one draft mail in the to-be-uploaded state exists in the draft folder of the mobile terminal, sending a mail adding command to the mail server specifically includes:
if at least one draft mail in the to-be-uploaded state exists in a draft folder of the mobile terminal, detecting whether a mail list contains mail identifiers corresponding to the draft mails in the to-be-uploaded state, wherein each mail identifier uniquely corresponds to one draft mail in a mail server, and the mail list is used for storing mail information corresponding to each draft mail;
and if the mail list does not contain a mail identifier uniquely corresponding to the draft mail in the to-be-uploaded state, sending a mail adding command to the mail server.
5. The method according to claim 3, wherein after the mobile terminal saves or updates the draft emails, the setting of the draft emails that need to be synchronized in the draft folder of the mobile terminal to a to-be-uploaded state specifically comprises:
when the mobile terminal is in a state of saving or updating the draft mail, detecting whether an instruction for synchronizing the draft mail to a mail server is received;
and if an instruction for synchronizing the draft mail to a mail server is received, setting the draft mail to be in a to-be-uploaded state.
6. The method of claim 3, wherein prior to the setting the draft mail in the draft folder of the mobile terminal that needs to be synchronized to the pending upload state, the method further comprises:
sending a column directory command to a corresponding mail server to acquire a folder list in the mail server, wherein the folder list comprises folder information corresponding to each folder in the mail server;
extracting folder information of the draft folder in the mail server from the folder list;
creating a draft folder for storing draft mails in the mobile terminal, wherein the draft folder comprises folder information of the draft folder in the mail server.
7. A synchronization device for draft mail based on IMAP protocol, which is applied to mobile terminal, characterized in that the device comprises:
the first storage module is used for storing the mail identifier of the draft mail returned by the mail server into a first list when the draft mail in the state to be uploaded in the mobile terminal is uploaded to the mail server;
the second storage module is used for acquiring the mail identifier of the draft mail stored in the mail server and storing the mail identifier in a second list;
a determining module for determining a target mail identifier, said target mail identifier being stored in the second list but not in the first list;
and the synchronization module is used for downloading the draft mail corresponding to the target mail identifier from the mail server to the mobile terminal.
8. A terminal device, characterized in that it comprises a synchronization apparatus according to claim 7.
CN201710546713.1A 2017-07-06 2017-07-06 Draft mail synchronization method, draft mail synchronization device and draft mail synchronization terminal based on IMAP protocol Active CN107104889B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710546713.1A CN107104889B (en) 2017-07-06 2017-07-06 Draft mail synchronization method, draft mail synchronization device and draft mail synchronization terminal based on IMAP protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710546713.1A CN107104889B (en) 2017-07-06 2017-07-06 Draft mail synchronization method, draft mail synchronization device and draft mail synchronization terminal based on IMAP protocol

Publications (2)

Publication Number Publication Date
CN107104889A CN107104889A (en) 2017-08-29
CN107104889B true CN107104889B (en) 2020-12-04

Family

ID=59663727

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710546713.1A Active CN107104889B (en) 2017-07-06 2017-07-06 Draft mail synchronization method, draft mail synchronization device and draft mail synchronization terminal based on IMAP protocol

Country Status (1)

Country Link
CN (1) CN107104889B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019071617A1 (en) * 2017-10-09 2019-04-18 华为技术有限公司 Method for synchronizing emails and terminal
CN108055346B (en) * 2017-12-26 2020-12-22 广东睿江云计算股份有限公司 Method for optimizing mail terminal link

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1569147B1 (en) * 2004-02-27 2006-08-23 Research In Motion Limited Method and system for synchronizing a drafts folder
CN102073723A (en) * 2011-01-11 2011-05-25 青岛海信移动通信技术股份有限公司 Method and device for managing mobile terminal mails
CN103207818A (en) * 2013-04-23 2013-07-17 互动在线(北京)科技有限公司 Vocabulary entry edition backup method based on draft box and draft box system
CN105812402A (en) * 2014-12-29 2016-07-27 腾讯科技(深圳)有限公司 File transmission method and device based on Internet of things

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571990B (en) * 2012-03-16 2014-09-24 北京彩云荣光软件有限公司 E-mail synchronization method and system for mobile terminal
US9503402B2 (en) * 2014-08-18 2016-11-22 Dropbox, Inc. Managing drafts of electronic documents across client devices
US10397160B2 (en) * 2015-08-19 2019-08-27 Blackberry Limited Method to pre-select folders to synchronize during initial email activation on a mobile device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1569147B1 (en) * 2004-02-27 2006-08-23 Research In Motion Limited Method and system for synchronizing a drafts folder
CN102073723A (en) * 2011-01-11 2011-05-25 青岛海信移动通信技术股份有限公司 Method and device for managing mobile terminal mails
CN103207818A (en) * 2013-04-23 2013-07-17 互动在线(北京)科技有限公司 Vocabulary entry edition backup method based on draft box and draft box system
CN105812402A (en) * 2014-12-29 2016-07-27 腾讯科技(深圳)有限公司 File transmission method and device based on Internet of things

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Qt的跨平台邮箱客户端的设计与实现;苏颖;《中国优秀硕士学位论文电子期刊》;20110930;全文 *

Also Published As

Publication number Publication date
CN107104889A (en) 2017-08-29

Similar Documents

Publication Publication Date Title
EP2783501B1 (en) Contact information synchronization system and method
CN108255915B (en) File management method and device and machine-readable storage medium
US10275742B2 (en) Methods and devices for managing emails
CN109818848B (en) Session display method and device, storage medium and electronic device
US20220342518A1 (en) Card-based information management method and system
CN107770229B (en) Cloud file sharing method and system and cloud server
CN102368746A (en) Picture information promotion method and apparatus thereof
WO2013030595A1 (en) Identifying data items
CN104092770A (en) Inner-enterprise address book management method and system based on cloud computing
CN104320325A (en) Information push method and device
WO2014106385A1 (en) Method and system for integrating information about each contact person and mobile terminal
CN106528688B (en) Analysis evidence obtaining method aiming at Twitter
CN103533169A (en) Method for positioning and linking field of electronic business card based on mobile terminal
CN107104889B (en) Draft mail synchronization method, draft mail synchronization device and draft mail synchronization terminal based on IMAP protocol
CN102118451B (en) Method and device for handling uploaded user resources
CN109213955B (en) Data processing method and related equipment
CN108762979B (en) Terminal information backup method and backup device based on matching tree
CN103220327B (en) user information storage method and device
CN115660591A (en) Process configuration method, system, electronic device and medium for business approval
CN114297211A (en) Data online analysis system, method, equipment and storage medium
CN104902542B (en) A kind of information sharing method and mobile communication terminal
CN109947892B (en) Analysis path determination method and system, interface and log tree construction method
CN113641742B (en) Data extraction method, device, equipment and storage medium
CN110990359A (en) Method and system for cleaning useless data in synchronous framework
CN112148342A (en) Component configuration method and device, electronic equipment and storage medium

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee after: Qingdao Hisense Mobile Communication Technology Co.,Ltd.

Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd.