#include <lib-lib/lib-lib.h>
#include <signal.h>
-#include <sys/utsname.h>
#include <lib-lua/lib-lua.h>
#include <lib-sys/exit.h>
#include <lib-ui/curses.h>
#include <lib-mx/mx.h>
-#include <lib-crypt/crypt.h>
-
#include "mutt.h"
#include "handler.h"
+#include "crypt.h"
#include "recvattach.h"
#include "copy.h"
#include "pager.h"
#include "charset.h"
#include "mutt_idna.h"
-
-#ifdef USE_LIBESMTP
-# include "mutt_libesmtp.h"
-#endif /* USE_LIBESMTP */
+#include "send_smtp.h"
#ifdef USE_NNTP
#include <nntp/nntp.h>
if ((option (OPTMIMEFORWDECODE) || option (OPTFORWDECRYPT)) &&
(hdr->security & ENCRYPT)) {
- if (!crypt_valid_passphrase (hdr->security))
- return (NULL);
}
fp = m_tempfile(buffer, sizeof(buffer), NONULL(MCore.tmpdir), NULL);
}
if (mode == 0 && !privacy && option (OPTXMAILER) && !has_agent) {
- const char *os;
-
- if (OperatingSystem != NULL) {
- os = OperatingSystem;
+ if (MCore.operating_system) {
+ fprintf(fp, "User-Agent: %s (%s)\n", mutt_make_version(),
+ MCore.operating_system);
} else {
- struct utsname un;
- os = (uname(&un) == -1) ? "UNIX" : un.sysname;
+ fprintf(fp, "User-Agent: %s\n", mutt_make_version());
}
- /* Add a vanity header */
- fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version(), os);
}
return (ferror (fp) == 0 ? 0 : -1);
}
}
-const char *mutt_fqdn (short may_hide_host)
+const char *mutt_fqdn(short may_hide_host)
{
char *p = NULL, *q;
- if (Fqdn && Fqdn[0] != '@') {
- p = Fqdn;
+ if (MCore.hostname && MCore.hostname[0] != '@') {
+ p = MCore.hostname;
if (may_hide_host && option (OPTHIDDENHOST)) {
- if ((p = strchr (Fqdn, '.')))
+ if ((p = strchr(MCore.hostname, '.')))
p++;
/* sanity check: don't hide the host if
the fqdn is something like detebe.org. */
- if (!p || !(q = strchr (p, '.')))
- p = Fqdn;
+ if (!p || !(q = strchr(p, '.')))
+ p = MCore.hostname;
}
}
const char *fqdn;
if (!(fqdn = mutt_fqdn(0)))
- fqdn = NONULL(Hostname);
+ fqdn = NONULL(MCore.shorthost);
mutt_gen_localpart(localpart, sizeof(localpart), MsgIdFormat);
snprintf(buf, sizeof(buf), "<%s@%s>", localpart, fqdn);
return m_strdup(buf);
}
-static RETSIGTYPE alarm_handler (int sig __attribute__ ((unused)))
+static void alarm_handler (int sig __attribute__ ((unused)))
{
SigAlrm = 1;
}
struct stat st;
if (!stat(childout, &st) && st.st_size > 0)
- mutt_do_pager(_("Output of the delivery process"), childout, 0,
- NULL);
+ mutt_pager(_("Output of the delivery process"), childout, 0, NULL);
}
}
} else {
if (!option (OPTNEWSSEND))
#endif
if (SmtpHost)
- return mutt_libesmtp_invoke (from, to, cc, bcc, msg, eightbit);
+ return send_smtp_invoke (from, to, cc, bcc, msg, eightbit);
#endif
return mutt_invoke_sendmail (from, to, cc, bcc, msg, eightbit);
rfc2047_encode_adrlist(env->reply_to, "Reply-To");
if (env->subject)
-#ifdef USE_NNTP
- if (!option (OPTNEWSSEND) || option (OPTMIMESUBJECT))
-#endif
- {
- rfc2047_encode_string (&env->subject);
- }
+ rfc2047_encode_string (&env->subject);
encode_headers (env->userhdrs);
}
/* We need to add a Content-Length field to avoid problems where a line in
* the message body begins with "From "
*/
- if (f.magic == M_MMDF || f.magic == M_MBOX) {
+ if (f.magic == M_MBOX) {
tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
if (!tempfp) {
mutt_error(_("Could not create temporary file"));