<tbody>
<row>
<entry>
- <literal>attach_keyword</literal>
+ <literal>abort_noattach_regex</literal>
</entry>
<entry>regular expression</entry>
<entry>
# no attachments added. This is meant to ensure that the user does not forget
# to attach a file after promising to do so in the mail.
-# Ask if the user wishes to abort sending if $attach_keyword is found in the
+# Ask if the user wishes to abort sending if $abort_noattach_regex is found in the
# body, but no attachments have been added
# It can be set to:
# "yes" : always abort
set abort_noattach = no
<emphasis role="comment"># Search for the following regular expression in the body of the email
# English: attach, attached, attachment, attachments</emphasis>
-set attach_keyword = "\\<attach(|ed|ments?)\\>"
+set abort_noattach_regex = "\\<attach(|ed|ments?)\\>"
<emphasis role="comment"># Nederlands:
-# set attach_keyword = "\\<(bijvoegen|bijgevoegd|bijlage|bijlagen)\\>"
+# set abort_noattach_regex = "\\<(bijvoegen|bijgevoegd|bijlage|bijlagen)\\>"
# Deutsch:
-# set attach_keyword = "\\<(anhängen|angehängt|anhang|anhänge|hängt an)\\>"
+# set abort_noattach_regex = "\\<(anhängen|angehängt|anhang|anhänge|hängt an)\\>"
# Français:
-# set attach_keyword = "\\<(attaché|attachés|attache|attachons|joint|jointe|joints|jointes|joins|joignons)\\>"
+# set abort_noattach_regex = "\\<(attaché|attachés|attache|attachons|joint|jointe|joints|jointes|joins|joignons)\\>"
# vim: syntax=neomuttrc</emphasis>
</screen>
</sect2>
WHERE char *AttributionLocale;
WHERE char *AttachCharset;
WHERE char *AttachFormat;
-WHERE struct Regex *AttachKeyword;
WHERE char *ComposeFormat;
WHERE char *ConfigCharset;
WHERE char *ContentType;
#endif
/* These variables are backing for config items */
+WHERE struct Regex *AbortNoattachRegex;
WHERE struct Regex *GecosMask;
WHERE struct Regex *Mask;
WHERE struct Regex *QuoteRegex;
{ "abort_noattach", DT_QUAD, R_NONE, UL &AbortNoattach, MUTT_NO },
/*
** .pp
- ** If set to \fIyes\fP, when composing messages containing the regular expression
- ** specified by $attach_keyword and no attachments ** are given, composition
- ** will be aborted. If set to \fIno\fP, composing ** messages as such will never
- ** be aborted.
+ ** If set to \fIyes\fP, when composing messages containing the regular
+ ** expression specified by $$abort_noattach_regex and no attachments are
+ ** given, composition will be aborted. If set to \fIno\fP, composing messages
+ ** as such will never be aborted.
** .pp
** Example:
** .ts
- ** set attach_keyword = "\\<attach(|ed|ments?)\\>"
+ ** set abort_noattach_regex = "\\<attach(|ed|ments?)\\>"
** .te
*/
+ { "abort_noattach_regex", DT_REGEX, R_NONE, UL &AbortNoattachRegex, UL "\\<(attach|attached|attachments?)\\>" },
+ /*
+ ** .pp
+ ** Specifies a regular expression to match against the body of the message, to
+ ** determine if an attachment was mentioned but mistakenly forgotten. If it
+ ** matches, $$abort_noattach will be consulted to determine if message sending
+ ** will be aborted.
+ ** .pp
+ ** Like other regular expressions in NeoMutt, the search is case sensitive
+ ** if the pattern contains at least one upper case letter, and case
+ ** insensitive otherwise.
+ */
{ "abort_nosubject", DT_QUAD, R_NONE, UL &AbortNosubject, MUTT_ASKYES },
/*
** .pp
** .pp
** For an explanation of ``soft-fill'', see the $$index_format documentation.
*/
- { "attach_keyword", DT_REGEX, R_NONE, UL &AttachKeyword, UL "\\<(attach|attached|attachments?)\\>" },
- /*
- ** .pp
- ** If $abort_noattach is not set to no, then the body of the message
- ** will be scanned for this regular expression, and if found, you will
- ** be prompted if there are no attachments.
- */
{ "attach_sep", DT_STRING, R_NONE, UL &AttachSep, UL "\n" },
/*
** .pp
** (DEPRECATED) Equivalent to setting $$wrap with a negative value.
*/
+ { "abort_noattach_regexp", DT_SYNONYM, R_NONE, UL "abort_noattach_regex", 0 },
+ { "attach_keyword", DT_SYNONYM, R_NONE, UL "abort_noattach_regex", 0 },
{ "edit_hdrs", DT_SYNONYM, R_NONE, UL "edit_headers", 0 },
{ "envelope_from", DT_SYNONYM, R_NONE, UL "use_envelope_from", 0 },
{ "forw_decode", DT_SYNONYM, R_NONE, UL "forward_decode", 0 },
msgstr "променя кодирането на приложението"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "Edita la codificació de transferència d’una adjunció."
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "Žádné přílohy, zrušit odeslání?"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
-msgstr "Zpráva obsahuje text odpovídající „$attach_keyword“. Neodesílám."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
+msgstr "Zpráva obsahuje text odpovídající „$abort_noattach_regex“. Neodesílám."
#: send.c:2005 smtp.c:189
msgid "Sending message..."
msgstr "ret brevdelens indkodning"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "Keine Anhänge vorhanden, Senden abbrechen?"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
-"Nachricht enthält, der \"$attach_keyword\" entspricht. Versand abgebrochen."
+"Nachricht enthält, der \"$abort_noattach_regex\" entspricht. Versand abgebrochen."
#: send.c:2005 smtp.c:189
msgid "Sending message..."
msgstr "επεξεργασία της κωδικοποίησης-μεταφοράς της προσάρτησης"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "No attachments, cancel sending?"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
-msgstr "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
+msgstr "Message contains text matching \"$abort_noattach_regex\". Not sending."
#: send.c:2005 smtp.c:189
msgid "Sending message..."
msgstr "redakti kodadon de parto"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "editar la codificación del archivo adjunto"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
-"El mensaje contiene texto que coincide con \"$attach_keyword\". No se envía."
+"El mensaje contiene texto que coincide con \"$abort_noattach_regex\". No se envía."
#: send.c:2005 smtp.c:189
msgid "Sending message..."
msgstr "toimeta lisa kodeeringut"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "gehigarriaren transferentzi kodifikazioa editatu"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "éditer le transfer-encoding de l'attachement"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "cuir transfer-encoding an iatáin in eagar"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "edita-lo \"transfer-encoding\" do adxunto"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "melléklet átviteli-kódolás szerkesztése"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "edit transfer-encoding dari lampiran"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "modifica il transfer-encoding dell'allegato"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "添付ファイルの content-trasfer-encoding を編集"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "첨부물 전송 부호화 방법 편집"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "Nėra priedų, atšaukti siuntimą?"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "bewerk de transport-codering van een bijlage"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "Brak załącznika, zaniechać wysyłania?"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "Sem anexos, cancelar envio?"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
-"Mensagem contém texto coincidindo com \"$attach_keyword\". Envio cancelado."
+"Mensagem contém texto coincidindo com \"$abort_noattach_regex\". Envio cancelado."
#: send.c:2005 smtp.c:189
msgid "Sending message..."
msgstr "изменить транспортную кодировку для вложения"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "upraviť kódovanie dát prílohy"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "redigera transportkodning för bilagan"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "ek iletim kodlamasını (transfer-encoding) düzenle"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "змінити спосіб кодування додатку"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
msgstr "编辑附件的传输编码"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
-msgstr "信件内容匹配 \"$attach_keyword\". 没有发送"
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
+msgstr "信件内容匹配 \"$abort_noattach_regex\". 没有发送"
#: send.c:2005 smtp.c:189
msgid "Sending message..."
msgstr "編輯附件的傳輸編碼"
#: send.c:1944
-msgid "Message contains text matching \"$attach_keyword\". Not sending."
+msgid "Message contains text matching \"$abort_noattach_regex\". Not sending."
msgstr ""
#: send.c:2005 smtp.c:189
mutt_list_find(&orig->env->in_reply_to, reply->env->message_id);
}
-static int search_attach_keyword(char *filename)
+static bool search_attach_keyword(char *filename)
{
- /* Search for the regex in AttachKeyword within a file */
- if (!AttachKeyword || !AttachKeyword->regex || !QuoteRegex || !QuoteRegex->regex)
- return 0;
+ /* Search for the regex in AbortNoattachRegex within a file */
+ if (!AbortNoattachRegex || !AbortNoattachRegex->regex || !QuoteRegex || !QuoteRegex->regex)
+ return false;
FILE *attf = mutt_file_fopen(filename, "r");
if (!attf)
- return 0;
+ return false;
char *inputline = mutt_mem_malloc(LONG_STRING);
- int found = 0;
+ bool found = false;
while (!feof(attf))
{
fgets(inputline, LONG_STRING, attf);
if (regexec(QuoteRegex->regex, inputline, 0, NULL, 0) != 0 &&
- regexec(AttachKeyword->regex, inputline, 0, NULL, 0) == 0)
+ regexec(AbortNoattachRegex->regex, inputline, 0, NULL, 0) == 0)
{
- found = 1;
+ found = true;
break;
}
}
}
#endif
- if (AbortNoattach != MUTT_NO && !msg->content->next &&
+ if (!(flags & SENDBATCH) &&
+ (AbortNoattach != MUTT_NO) && !msg->content->next &&
+ (msg->content->type == TYPETEXT) &&
+ (mutt_str_strcasecmp (msg->content->subtype, "plain") == 0) &&
search_attach_keyword(msg->content->filename) &&
query_quadoption(AbortNoattach, _("No attachments, cancel sending?")) != MUTT_NO)
{
if (AbortNoattach == MUTT_YES)
{
mutt_error(_(
- "Message contains text matching \"$attach_keyword\". Not sending."));
+ "Message contains text matching \"$abort_noattach_regex\". Not sending."));
}
goto main_loop;
}