how to use sendmail in 1.14.2
Vladimir Dronnikov
dronnikov at gmail.com
Mon Jul 6 11:02:02 UTC 2009
>
> Hmm. Considering this, makemime help is inadequate:
>
Thanks for fixing!
>
> It can be improved further. What is "sender" format? Is it an email (user at host)?
IIRC, a discussion was ago about sender format. Pity, don't recall the
details...
"sender" is what exactly will be fed to SMTP server via "MAIL
FROM:<%s>" command. If server likes it, good. If not -- SMTP session
is ended.
> Can we specify "null sender" (IIRC RFC822 has something like that)? How?
I guess we can afford that by -f "". Don't know the applications,
though. May be spam or mail-notifications?
In either case in order for SMTP session to succeed sendmail has to
issue MAIL FROM:<>. I keep my thoughts of how sender can be guessed in
sendmail.c:
// set sender
// N.B. we have here a very loosely defined algotythm
// since sendmail historically offers no means to specify secrets on cmdline.
// 1) server can require no authentication ->
// we must just provide a (possibly fake) reply address.
// 2) server can require AUTH ->
// we must provide valid username and password along with a (possibly
fake) reply address.
// For the sake of security username and password are to be read
either from console or from a secured file.
// Since reading from console may defeat usability, the solution is
either to read from a predefined
// file descriptor (e.g. 4), or again from a secured file.
// got no sender address? -> use system username as a resort
// N.B. we marked -f as required option!
//if (!G.user) {
// // N.B. IMHO getenv("USER") can be way easily spoofed!
// G.user = xuid2uname(getuid());
// opt_from = xasprintf("%s@%s", G.user, domain);
//}
//if (ENABLE_FEATURE_CLEAN_UP)
// free(domain);
smtp_checkp("MAIL FROM:<%s>", opt_from, 250);
constantly hesitating whether to delete these lines (), or leave them
so far... Again, right now -f specifies the bare string to be used in
MAIL FROM:<> command to SMTP server. I put it clear that sender has
very little to do with the generic From: header in the resulting mail
message. I know servers that add From: headers based on MAIL FROM:<>
command. And I know servers that don't. From: headers are subject to
mail message composers, like makemime, e.g.
--
Vladimir
More information about the busybox
mailing list