{
list_item item;
+ if(opt_get_bool(BOOL_ADD_EMAIL_PREVENT_DUPLICATES)) {
+ int search_fields[] = { EMAIL, -1 };
+ if(find_item(email, 0, search_fields) >= 0) {
+ if(!quiet)
+ printf("Address %s already in addressbook\n",
+ email);
+ return 0;
+ }
+ }
+
if(!quiet) {
FILE *in = fopen("/dev/tty", "r");
char c;
{ "use_ascii_only", OT_BOOL, BOOL_USE_ASCII_ONLY, FALSE },
+ { "add_email_prevent_duplicates", OT_BOOL, BOOL_ADD_EMAIL_PREVENT_DUPLICATES, FALSE },
+
{ NULL }
};
BOOL_SHOW_ALL_EMAILS,
BOOL_MUTT_RETURN_ALL_EMAILS,
BOOL_USE_ASCII_ONLY,
+ BOOL_ADD_EMAIL_PREVENT_DUPLICATES,
BOOL_MAX
};
# use ASCII characters only
set use_ascii_only=false
+set add_email_prevent_duplicates=false