← Commit list

4e03d4134

Kaarle Ritvanen
Kaarle Ritvanen
2014-02-09
SUCCESS Duration: 150s

Subject

sendmail: use FQDN in default envelope sender

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

mailutils/sendmail.c+4 -2
@@ -326,7 +326,6 @@ int sendmail_main(int argc UNUSED_PARAM, char **argv)
// we should start with modern EHLO
if (250 != smtp_checkp("EHLO %s", host, -1))
smtp_checkp("HELO %s", host, 250);
- free(host);
// perform authentication
if (opts & OPT_a) {
@@ -353,8 +352,11 @@ int sendmail_main(int argc UNUSED_PARAM, char **argv)
// got no sender address? use auth name, then UID username as a last resort
if (!opt_from) {
- opt_from = G.user ? G.user : xuid2uname(getuid());
+ opt_from = xasprintf("%s@%s",
+ G.user ? G.user : xuid2uname(getuid()),
+ xgethostbyname(host)->h_name);
}
+ free(host);
smtp_checkp("MAIL FROM:<%s>", opt_from, 250);