invocation.
.PP
.B Spost
+puts the
+.RI ` Default-From '
+profile entry in the `From:' line of the message.
+If `Default-From' is not set,
+.B spost
constructs the `From:' line of the
message from the user's login name and the full name from the GECOS field
of the passwd file.
If you specify a `From:'
line manually in the message draft.
It will be used as provided.
-However, a `Sender:' header with the user's
+A `Sender:' header with the user's
.B real
-address will be added.
+address will be added, if the `From' line don't contain a address
+from the user
+.RI ` Alternate-Mailboxes '.
.PP
Note that this applies equally to `Resent\-From:' lines
in messages sent with
.SH "PROFILE COMPONENTS"
.fc ^ ~
.nf
-.ta \w'ExtraBigFileName 'u
+.ta 3.5i
+.ta \w'ExtraBigProfileName 'u
^Aliasfile:~^For default alias files
+^Default\-From:~^The default From header
+^Alternate\-Mailboxes:~^The user's addresses
.fi
.SH "SEE ALSO"
#define MVIS 0x0008 /* we've seen sighted addrs */
#define MINV 0x0010 /* we've seen blind addrs */
#define MRDT 0x0020 /* we've seen a Resent-Date: */
+#define MFMM 0x0040 /* The Mail is From a Alternative-Mailbox Addresse */
struct headers {
char *value;
** -- meillo@marmaro.de 2012-02
*/
+ if (hdr->set & MFRM) {
+
+ struct mailname *mp = NULL;
+
+ /* This is need because the addresse parser hold global state */
+ ismymbox(NULL);
+
+ while ((cp = getname(str)) != NULL) {
+ mp = getm(cp, NULL, 0, AD_NAME, NULL);
+ if (ismymbox(mp)) {
+ msgflags |= MFMM;
+ }
+ }
+ }
+
if (hdr->flags & HSUB) {
subject = getcpy(str);
}
fprintf(out, "%sDate: %s\n", resentstr, dtimenow());
}
- snprintf(from, sizeof(from), "%s@%s", getusername(), LocalName());
- if ((cp = getfullname()) && *cp) {
- snprintf(signature, sizeof(signature), "%s <%s>", cp, from);
+ if ((cp = context_find("Default-From")) != NULL) {
+ snprintf(signature, sizeof(signature), "%s", cp);
} else {
- snprintf(signature, sizeof(signature), "%s", from);
+ snprintf(from, sizeof(from), "%s@%s", getusername(), LocalName());
+ if ((cp = getfullname()) && *cp) {
+ snprintf(signature, sizeof(signature), "%s <%s>", cp, from);
+ } else {
+ snprintf(signature, sizeof(signature), "%s", from);
+ }
}
if (!(msgflags & MFRM)) {
fprintf(out, "%sFrom: %s\n", resentstr, signature);
** Add a Sender: header because the From: header could
** be fake or contain multiple addresses.
*/
- fprintf(out, "%sSender: %s\n", resentstr, from);
+ if (!(msgflags & MFMM)) {
+ fprintf(out, "%sSender: %s\n", resentstr, signature);
+ }
}
if (!(msgflags & MVIS)) {
fprintf(out, "%sBcc: undisclosed-recipients:;\n", resentstr);