curs_main.o edit.o editmsg.o enter.o envelope.o filter.o \
flags.o from.o group.o handler.o hdrline.o \
header.o help.o history.o hook.o init.o keymap.o main.o \
- mbox.o menu.o mh.o muttlib.o mutt_address.o \
+ mbox.o menu.o mh.o muttlib.o \
mutt_socket.o tags.o mx.o \
newsrc.o nntp.o pager.o parse.o pattern.o pop.o \
pop_auth.o pop_lib.o postpone.o query.o recvattach.o recvcmd.o \
- rfc1524.o rfc2047.o rfc2231.o rfc3676.o address.o \
+ rfc1524.o rfc2047.o rfc2231.o rfc3676.o \
safe_asprintf.o score.o send.o sendlib.o sidebar.o mutt_signal.o \
resize.o smtp.o sort.o state.o status.o system.o thread.o url.o \
version.o
###############################################################################
# libmutt
LIBMUTT= libmutt.a
-LIBMUTTOBJS= mutt/base64.o mutt/buffer.o mutt/charset.o mutt/date.o \
- mutt/debug.o mutt/exit.o \
+LIBMUTTOBJS= mutt/address.o mutt/base64.o mutt/buffer.o mutt/charset.o \
+ mutt/date.o mutt/debug.o mutt/exit.o \
mutt/file.o mutt/hash.o mutt/idna.o mutt/list.o \
mutt/mapping.o mutt/mbyte.o mutt/md5.o \
mutt/memory.o mutt/message.o mutt/mime.o mutt/parameter.o \
cmp -s git_ver.h.tmp git_ver.h || mv git_ver.h.tmp git_ver.h; \
rm -f git_ver.h.tmp
-hcache/hcversion.h: $(SRCDIR)/mutt.h $(SRCDIR)/address.h \
+hcache/hcversion.h: $(SRCDIR)/mutt.h $(SRCDIR)/mutt/address.h \
$(SRCDIR)/mutt/list.h $(SRCDIR)/mutt/buffer.h \
$(SRCDIR)/mutt/parameter.h $(SRCDIR)/body.h \
$(SRCDIR)/envelope.h $(SRCDIR)/header.h \
$(SRCDIR)/hcache/hcachever.sh \
$(PWD)/hcache
( echo '#include "config.h"'; echo '#include "mutt.h"'; \
- echo '#include "address.h"'; echo '#include "mutt/list.h"'; \
+ echo '#include "mutt/address.h"'; echo '#include "mutt/list.h"'; \
echo '#include "mutt/buffer.h"'; echo '#include "mutt/parameter.h"'; \
echo '#include "body.h"'; echo '#include "envelope.h"'; \
echo '#include "header.h"';) | $(CPP) $(CFLAGS) - | \
#include <stdlib.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "format_flags.h"
#include "globals.h"
#include "mutt/mutt.h"
#include "mutt.h"
#include "alias.h"
-#include "address.h"
#include "envelope.h"
#include "globals.h"
#include "mutt_curses.h"
#include "mutt/mutt.h"
#include "conn/conn.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "body.h"
#include "buffy.h"
#include "mutt/mutt.h"
#include "conn/conn.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "attach.h"
#include "body.h"
#include "mutt/mutt.h"
#include "mutt.h"
#include "copy.h"
-#include "address.h"
#include "body.h"
#include "context.h"
#include "envelope.h"
#include <string.h>
#include <sys/stat.h>
#include "mutt/mutt.h"
-#include "address.h"
#include "alias.h"
#include "body.h"
#include "context.h"
#include <stddef.h>
#include "mutt/mutt.h"
#include "envelope.h"
-#include "address.h"
#include "protos.h"
/**
#include <stdlib.h>
#include "mutt/mutt.h"
#include "group.h"
-#include "address.h"
#include "globals.h"
#include "protos.h"
#include <sys/time.h>
#include <unistd.h>
#include "mutt/mutt.h"
-#include "address.h"
#include "backend.h"
#include "body.h"
#include "envelope.h"
#include <time.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "body.h"
#include "context.h"
#include "envelope.h"
#include <unistd.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "envelope.h"
#include "globals.h"
#include "header.h"
#include "mutt/mutt.h"
#include "mutt.h"
#include "init.h"
-#include "address.h"
#include "alias.h"
#include "context.h"
#include "envelope.h"
#include "mutt/mutt.h"
#include "conn/conn.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "body.h"
#include "buffy.h"
#include <utime.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "body.h"
#include "buffy.h"
#include "context.h"
* | mutt_addr_valid_msgid() | Is this a valid Message ID?
* | mutt_addr_write() | Write an Address to a buffer
* | mutt_addr_write_single() | Write a single Address to a buffer
+ * | mutt_addrlist_to_intl() | Convert an Address list to Punycode
+ * | mutt_addrlist_to_local() | Convert an Address list from Punycode
*/
#include "config.h"
#include <stdio.h>
#include <string.h>
-#include "mutt/mutt.h"
#include "address.h"
+#include "idna2.h"
+#include "memory.h"
+#include "string2.h"
/**
* AddressSpecials - Characters with special meaning for email addresses
*pbuf = 0;
return pbuf - buf;
}
+
+/**
+ * mutt_addrlist_to_intl - Convert an Address list to Punycode
+ * @param[in] a Address list to modify
+ * @param[out] err Pointer for failed addresses
+ * @retval 0 Success, all addresses converted
+ * @retval -1 Error, err will be set to the failed address
+ */
+int mutt_addrlist_to_intl(struct Address *a, char **err)
+{
+ char *user = NULL, *domain = NULL;
+ char *intl_mailbox = NULL;
+ int rc = 0;
+
+ if (err)
+ *err = NULL;
+
+ for (; a; a = a->next)
+ {
+ if (!a->mailbox || mutt_addr_is_intl(a))
+ continue;
+
+ if (mutt_addr_mbox_to_udomain(a->mailbox, &user, &domain) == -1)
+ continue;
+
+ intl_mailbox = mutt_idna_local_to_intl(user, domain);
+ if (!intl_mailbox)
+ {
+ rc = -1;
+ if (err && !*err)
+ *err = mutt_str_strdup(a->mailbox);
+ continue;
+ }
+
+ mutt_addr_set_intl(a, intl_mailbox);
+ }
+
+ return rc;
+}
+
+/**
+ * mutt_addrlist_to_local - Convert an Address list from Punycode
+ * @param a Address list to modify
+ * @retval 0 Always
+ */
+int mutt_addrlist_to_local(struct Address *a)
+{
+ char *user = NULL, *domain = NULL;
+ char *local_mailbox = NULL;
+
+ for (; a; a = a->next)
+ {
+ if (!a->mailbox || mutt_addr_is_local(a))
+ continue;
+
+ if (mutt_addr_mbox_to_udomain(a->mailbox, &user, &domain) == -1)
+ continue;
+
+ local_mailbox = mutt_idna_intl_to_local(user, domain, 0);
+ if (local_mailbox)
+ mutt_addr_set_local(a, local_mailbox);
+ }
+
+ return 0;
+}
*
* | File | Description |
* | :--------------- | :----------------- |
+ * | mutt/address.c | @subpage address |
* | mutt/base64.c | @subpage base64 |
* | mutt/buffer.c | @subpage buffer |
* | mutt/charset.c | @subpage charset |
#ifndef _MUTT_MUTT_H
#define _MUTT_MUTT_H
+#include "address.h"
#include "base64.h"
#include "buffer.h"
#include "charset.h"
+++ /dev/null
-/**
- * @file
- * Representation of an email address
- *
- * @authors
- * Copyright (C) 1996-2000,2011-2013 Michael R. Elkins <me@mutt.org>
- * Copyright (C) 2017 Richard Russon <rich@flatcap.org>
- *
- * @copyright
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation, either version 2 of the License, or (at your option) any later
- * version.
- *
- * 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/>.
- */
-
-#include "config.h"
-#include <stdio.h>
-#include "mutt/mutt.h"
-#include "address.h"
-
-/**
- * mutt_addrlist_to_intl - Convert an Address list to Punycode
- * @param[in] a Address list to modify
- * @param[out] err Pointer for failed addresses
- * @retval 0 Success, all addresses converted
- * @retval -1 Error, err will be set to the failed address
- */
-int mutt_addrlist_to_intl(struct Address *a, char **err)
-{
- char *user = NULL, *domain = NULL;
- char *intl_mailbox = NULL;
- int rc = 0;
-
- if (err)
- *err = NULL;
-
- for (; a; a = a->next)
- {
- if (!a->mailbox || mutt_addr_is_intl(a))
- continue;
-
- if (mutt_addr_mbox_to_udomain(a->mailbox, &user, &domain) == -1)
- continue;
-
- intl_mailbox = mutt_idna_local_to_intl(user, domain);
- if (!intl_mailbox)
- {
- rc = -1;
- if (err && !*err)
- *err = mutt_str_strdup(a->mailbox);
- continue;
- }
-
- mutt_addr_set_intl(a, intl_mailbox);
- }
-
- return rc;
-}
-
-/**
- * mutt_addrlist_to_local - Convert an Address list from Punycode
- * @param a Address list to modify
- * @retval 0 Always
- */
-int mutt_addrlist_to_local(struct Address *a)
-{
- char *user = NULL, *domain = NULL;
- char *local_mailbox = NULL;
-
- for (; a; a = a->next)
- {
- if (!a->mailbox || mutt_addr_is_local(a))
- continue;
-
- if (mutt_addr_mbox_to_udomain(a->mailbox, &user, &domain) == -1)
- continue;
-
- local_mailbox = mutt_idna_intl_to_local(user, domain, 0);
- if (local_mailbox)
- mutt_addr_set_local(a, local_mailbox);
- }
-
- return 0;
-}
#include "mutt/mutt.h"
#include "mutt.h"
#include "mutt_lua.h"
-#include "address.h"
#include "globals.h"
#include "mailbox.h"
#include "mbtable.h"
#include <wchar.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "body.h"
#include "envelope.h"
#include "mutt/mutt.h"
#include "mutt.h"
#include "mx.h"
-#include "address.h"
#include "body.h"
#include "buffy.h"
#include "context.h"
#include <time.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "body.h"
#include "content.h"
#include <unistd.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "body.h"
#include "crypt.h"
#include "mutt/mutt.h"
#include "mutt.h"
#include "pgp.h"
-#include "address.h"
#include "body.h"
#include "crypt.h"
#include "cryptglue.h"
#include <string.h>
#include <unistd.h>
#include "mutt/mutt.h"
-#include "address.h"
#include "filter.h"
#include "format_flags.h"
#include "globals.h"
#include "mutt/mutt.h"
#include "mutt.h"
#include "pgpkey.h"
-#include "address.h"
#include "body.h"
#include "crypt.h"
#include "filter.h"
#include "mutt/mutt.h"
#include "mutt.h"
#include "smime.h"
-#include "address.h"
#include "alias.h"
#include "body.h"
#include "copy.h"
#include <time.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "body.h"
#include "envelope.h"
#include "globals.h"
#include "conn/conn.h"
#include "mutt.h"
#include "pattern.h"
-#include "address.h"
#include "body.h"
#include "context.h"
#include "copy.h"
#include "mutt/mutt.h"
#include "conn/conn.h"
#include "mutt.h"
-#include "address.h"
#include "globals.h"
#include "mutt_account.h"
#include "mutt_socket.h"
#include <sys/types.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "envelope.h"
#include "filter.h"
#include <string.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "attach.h"
#include "body.h"
#include "mutt/mutt.h"
#include "mutt.h"
#include "remailer.h"
-#include "address.h"
#include "envelope.h"
#include "filter.h"
#include "format_flags.h"
*/
#include "config.h"
+#include "mutt/address.h"
#include "mutt/charset.h"
#include "mutt/rfc2047.h"
-#include "address.h"
#include "globals.h"
#include <string.h>
#include <unistd.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "alias.h"
#include "body.h"
#include "context.h"
#include <unistd.h>
#include "mutt/mutt.h"
#include "mutt.h"
-#include "address.h"
#include "body.h"
#include "buffy.h"
#include "content.h"
#include "mutt/mutt.h"
#include "conn/conn.h"
#include "mutt.h"
-#include "address.h"
#include "globals.h"
#include "mutt_account.h"
#include "mutt_curses.h"
#include <string.h>
#include "mutt/mutt.h"
#include "sort.h"
-#include "address.h"
#include "body.h"
#include "context.h"
#include "envelope.h"
#include "mutt/mutt.h"
#include "mutt.h"
#include "url.h"
-#include "address.h"
#include "envelope.h"
#include "globals.h"
#include "protos.h"