POP network mailbox. More...
#include "config.h"
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "conn/lib.h"
#include "gui/lib.h"
#include "lib.h"
#include "bcache/lib.h"
#include "ncrypt/lib.h"
#include "context.h"
#include "hook.h"
#include "mutt_account.h"
#include "mutt_globals.h"
#include "mutt_header.h"
#include "mutt_logging.h"
#include "mutt_socket.h"
#include "muttlib.h"
#include "mx.h"
#include "progress.h"
#include <libintl.h>
#include "hcache/lib.h"
Go to the source code of this file.
Macros | |
#define | HC_FNAME "neomutt" /* filename for hcache as POP lacks paths */ |
#define | HC_FEXT "hcache" /* extension for hcache as POP lacks paths */ |
Functions | |
static const char * | cache_id (const char *id) |
Make a message-cache-compatible id. More... | |
static void | pop_adata_free (void **ptr) |
Free the private Account data - Implements Account::adata_free() More... | |
static struct PopAccountData * | pop_adata_new (void) |
Create a new PopAccountData object. More... | |
static void | pop_edata_free (void **ptr) |
Free the private Email data - Implements Email::edata_free() More... | |
static struct PopEmailData * | pop_edata_new (const char *uid) |
Create a new PopEmailData for an email. More... | |
static int | fetch_message (const char *line, void *data) |
write line to file - Implements pop_fetch_t More... | |
static int | pop_read_header (struct PopAccountData *adata, struct Email *e) |
Read header. More... | |
static int | fetch_uidl (const char *line, void *data) |
parse UIDL - Implements pop_fetch_t More... | |
static int | msg_cache_check (const char *id, struct BodyCache *bcache, void *data) |
Check the Body Cache for an ID - Implements bcache_list_t. More... | |
static void | pop_hcache_namer (const char *path, struct Buffer *dest) |
Create a header cache filename for a POP mailbox - Implements hcache_namer_t. More... | |
static struct HeaderCache * | pop_hcache_open (struct PopAccountData *adata, const char *path) |
Open the header cache. More... | |
static int | pop_fetch_headers (struct Mailbox *m) |
Read headers. More... | |
static void | pop_clear_cache (struct PopAccountData *adata) |
delete all cached messages More... | |
void | pop_fetch_mail (void) |
Fetch messages and save them in $spoolfile. More... | |
static struct Account * | pop_ac_find (struct Account *a, const char *path) |
Find an Account that matches a Mailbox path - Implements MxOps::ac_find() More... | |
static int | pop_ac_add (struct Account *a, struct Mailbox *m) |
Add a Mailbox to an Account - Implements MxOps::ac_add() More... | |
static int | pop_mbox_open (struct Mailbox *m) |
Open a Mailbox - Implements MxOps::mbox_open() More... | |
static int | pop_mbox_check (struct Mailbox *m) |
Check for new mail - Implements MxOps::mbox_check() More... | |
static int | pop_mbox_sync (struct Mailbox *m) |
Save changes to the Mailbox - Implements MxOps::mbox_sync() More... | |
static int | pop_mbox_close (struct Mailbox *m) |
Close a Mailbox - Implements MxOps::mbox_close() More... | |
static int | pop_msg_open (struct Mailbox *m, struct Message *msg, int msgno) |
Open an email message in a Mailbox - Implements MxOps::msg_open() More... | |
static int | pop_msg_close (struct Mailbox *m, struct Message *msg) |
Close an email - Implements MxOps::msg_close() More... | |
static int | pop_msg_save_hcache (struct Mailbox *m, struct Email *e) |
Save message to the header cache - Implements MxOps::msg_save_hcache() More... | |
enum MailboxType | pop_path_probe (const char *path, const struct stat *st) |
Is this a POP Mailbox? - Implements MxOps::path_probe() More... | |
static int | pop_path_canon (char *buf, size_t buflen) |
Canonicalise a Mailbox path - Implements MxOps::path_canon() More... | |
static int | pop_path_pretty (char *buf, size_t buflen, const char *folder) |
Abbreviate a Mailbox path - Implements MxOps::path_pretty() More... | |
static int | pop_path_parent (char *buf, size_t buflen) |
Find the parent of a Mailbox path - Implements MxOps::path_parent() More... | |
Variables | |
struct MxOps | MxPopOps |
POP Mailbox - Implements MxOps. More... | |
POP network mailbox.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file pop.c.
#define HC_FNAME "neomutt" /* filename for hcache as POP lacks paths */ |
#define HC_FEXT "hcache" /* extension for hcache as POP lacks paths */ |
|
static |
Make a message-cache-compatible id.
id | POP message id |
ptr | Sanitised string |
The POP message id may contain '/' and other awkward characters.
Definition at line 81 of file pop.c.
|
static |
Free the private Account data - Implements Account::adata_free()
The PopAccountData struct stores global POP data, such as the connection to the database. This function will close the database, free the resources and the struct itself.
Definition at line 96 of file pop.c.
|
static |
Create a new PopAccountData object.
ptr | New PopAccountData struct |
Definition at line 110 of file pop.c.
|
static |
Free the private Email data - Implements Email::edata_free()
Each email has an attached PopEmailData, which contains things like the tags (labels).
Definition at line 121 of file pop.c.
|
static |
Create a new PopEmailData for an email.
uid | Email UID |
ptr | New PopEmailData struct |
Definition at line 136 of file pop.c.
|
static |
write line to file - Implements pop_fetch_t
line | String to write |
data | FILE pointer to write to |
0 | Success |
-1 | Failure |
Definition at line 150 of file pop.c.
|
static |
Read header.
0 | Success |
-1 | Connection lost |
-2 | Invalid command or execution error |
-3 | Error writing to tempfile |
Definition at line 170 of file pop.c.
|
static |
parse UIDL - Implements pop_fetch_t
line | String to parse |
data | Mailbox |
0 | Success |
-1 | Failure |
Definition at line 252 of file pop.c.
|
static |
Check the Body Cache for an ID - Implements bcache_list_t.
Definition at line 305 of file pop.c.
|
static |
Create a header cache filename for a POP mailbox - Implements hcache_namer_t.
Definition at line 338 of file pop.c.
|
static |
Open the header cache.
adata | POP Account data |
path | Path to the mailbox |
ptr | Header cache |
Definition at line 349 of file pop.c.
|
static |
Read headers.
m | Mailbox |
0 | Success |
-1 | Connection lost |
-2 | Invalid command or execution error |
-3 | Error writing to tempfile |
Definition at line 372 of file pop.c.
|
static |
void pop_fetch_mail | ( | void | ) |
Fetch messages and save them in $spoolfile.
Definition at line 561 of file pop.c.
Find an Account that matches a Mailbox path - Implements MxOps::ac_find()
Definition at line 741 of file pop.c.
Add a Mailbox to an Account - Implements MxOps::ac_add()
Definition at line 762 of file pop.c.
|
static |
Open a Mailbox - Implements MxOps::mbox_open()
Fetch only headers
Definition at line 793 of file pop.c.
|
static |
Check for new mail - Implements MxOps::mbox_check()
Definition at line 870 of file pop.c.
|
static |
Save changes to the Mailbox - Implements MxOps::mbox_sync()
Update POP mailbox, delete messages from server
Definition at line 908 of file pop.c.
|
static |
Close a Mailbox - Implements MxOps::mbox_close()
Definition at line 995 of file pop.c.
Open an email message in a Mailbox - Implements MxOps::msg_open()
Definition at line 1022 of file pop.c.
Close an email - Implements MxOps::msg_close()
0 | Success |
EOF | Error, see errno |
Definition at line 1179 of file pop.c.
Save message to the header cache - Implements MxOps::msg_save_hcache()
Definition at line 1187 of file pop.c.
enum MailboxType pop_path_probe | ( | const char * | path, |
const struct stat * | st | ||
) |
Is this a POP Mailbox? - Implements MxOps::path_probe()
Definition at line 1204 of file pop.c.
|
static |
Canonicalise a Mailbox path - Implements MxOps::path_canon()
|
static |
Abbreviate a Mailbox path - Implements MxOps::path_pretty()
|
static |
Find the parent of a Mailbox path - Implements MxOps::path_parent()
struct MxOps MxPopOps |