NeoMutt  2024-04-25-97-g7d2481
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
maillist.c
Go to the documentation of this file.
1
30#include "config.h"
31#include <stdbool.h>
32#include <stdio.h>
33#include "mutt/lib.h"
34#include "address/lib.h"
35#include "email/lib.h"
36#include "maillist.h"
37#include "muttlib.h"
38#include "sort.h"
39
45bool mutt_is_mail_list(const struct Address *addr)
46{
49 return false;
50}
51
57bool mutt_is_subscribed_list(const struct Address *addr)
58{
61 {
63 }
64 return false;
65}
66
79bool check_for_mailing_list(struct AddressList *al, const char *pfx, char *buf, int buflen)
80{
81 struct Address *a = NULL;
82 TAILQ_FOREACH(a, al, entries)
83 {
85 {
86 if (pfx && buf && buflen)
87 snprintf(buf, buflen, "%s%s", pfx, mutt_get_name(a));
88 return true;
89 }
90 }
91 return false;
92}
93
103bool check_for_mailing_list_addr(struct AddressList *al, char *buf, int buflen)
104{
105 struct Address *a = NULL;
106 TAILQ_FOREACH(a, al, entries)
107 {
109 {
110 if (buf && buflen)
111 snprintf(buf, buflen, "%s", buf_string(a->mailbox));
112 return true;
113 }
114 }
115 return false;
116}
117
125bool first_mailing_list(char *buf, size_t buflen, struct AddressList *al)
126{
127 struct Address *a = NULL;
128 TAILQ_FOREACH(a, al, entries)
129 {
131 {
132 mutt_save_path(buf, buflen, a);
133 return true;
134 }
135 }
136 return false;
137}
Email Address Handling.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
struct RegexList SubscribedLists
List of header patterns to unignore (see)
Definition: globals.c:48
struct RegexList UnSubscribedLists
Definition: globals.c:54
struct RegexList UnMailLists
List of regexes to exclude false matches in SubscribedLists.
Definition: globals.c:52
struct RegexList MailLists
List of permitted fields in a mailto: url.
Definition: globals.c:40
Structs that make up an email.
bool mutt_is_mail_list(const struct Address *addr)
Is this the email address of a mailing list? - Implements addr_predicate_t -.
Definition: maillist.c:45
bool mutt_is_subscribed_list(const struct Address *addr)
Is this the email address of a user-subscribed mailing list? - Implements addr_predicate_t -.
Definition: maillist.c:57
bool check_for_mailing_list(struct AddressList *al, const char *pfx, char *buf, int buflen)
Search list of addresses for a mailing list.
Definition: maillist.c:79
bool check_for_mailing_list_addr(struct AddressList *al, char *buf, int buflen)
Check an address list for a mailing list.
Definition: maillist.c:103
bool first_mailing_list(char *buf, size_t buflen, struct AddressList *al)
Get the first mailing list in the list of addresses.
Definition: maillist.c:125
Handle mailing lists.
Convenience wrapper for the library headers.
bool mutt_regexlist_match(struct RegexList *rl, const char *str)
Does a string match any Regex in the list?
Definition: regex.c:200
void mutt_save_path(char *buf, size_t buflen, const struct Address *addr)
Turn an email address into a filename (for saving)
Definition: muttlib.c:628
Some miscellaneous functions.
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:725
const char * mutt_get_name(const struct Address *a)
Pick the best name to display from an address.
Definition: sort.c:134
Assorted sorting methods.
An email address.
Definition: address.h:36
struct Buffer * mailbox
Mailbox and host address.
Definition: address.h:38