aboutsummaryrefslogtreecommitdiff
path: root/mailutils/sendmail.c
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-02-09 09:49:36 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2014-02-09 09:49:36 +0100
commit4e03d4134202b117a29ecf5933a7a55e2a8532a4 (patch)
treedc0dcb3fcd39600f6c7c6c9f795ef3ac00ade2f9 /mailutils/sendmail.c
parent744ee5db1c2d6c34c1988343728b2fc37a908f83 (diff)
downloadbusybox-w32-4e03d4134202b117a29ecf5933a7a55e2a8532a4.tar.gz
busybox-w32-4e03d4134202b117a29ecf5933a7a55e2a8532a4.tar.bz2
busybox-w32-4e03d4134202b117a29ecf5933a7a55e2a8532a4.zip
sendmail: use FQDN in default envelope sender
RFC 5321 requires the return path to be supplied with a proper domain name. Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'mailutils/sendmail.c')
-rw-r--r--mailutils/sendmail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mailutils/sendmail.c b/mailutils/sendmail.c
index 824109d99..9455b4e7a 100644
--- a/mailutils/sendmail.c
+++ b/mailutils/sendmail.c
@@ -326,7 +326,6 @@ int sendmail_main(int argc UNUSED_PARAM, char **argv)
326 // we should start with modern EHLO 326 // we should start with modern EHLO
327 if (250 != smtp_checkp("EHLO %s", host, -1)) 327 if (250 != smtp_checkp("EHLO %s", host, -1))
328 smtp_checkp("HELO %s", host, 250); 328 smtp_checkp("HELO %s", host, 250);
329 free(host);
330 329
331 // perform authentication 330 // perform authentication
332 if (opts & OPT_a) { 331 if (opts & OPT_a) {
@@ -353,8 +352,11 @@ int sendmail_main(int argc UNUSED_PARAM, char **argv)
353 352
354 // got no sender address? use auth name, then UID username as a last resort 353 // got no sender address? use auth name, then UID username as a last resort
355 if (!opt_from) { 354 if (!opt_from) {
356 opt_from = G.user ? G.user : xuid2uname(getuid()); 355 opt_from = xasprintf("%s@%s",
356 G.user ? G.user : xuid2uname(getuid()),
357 xgethostbyname(host)->h_name);
357 } 358 }
359 free(host);
358 360
359 smtp_checkp("MAIL FROM:<%s>", opt_from, 250); 361 smtp_checkp("MAIL FROM:<%s>", opt_from, 250);
360 362