Sameer Vijay writes:
> 1. Why is the 'From: ' line not changed when the return-path and from
> lines show the changed address?
The -f option sets the envelope sender address only. It has nothing
to do with the From field of the message header.
> 2. Why are the mysterious quotes added in the address for 'From: '
> line? What could be the reason that those quotes are only added around
> '48]'? Is there any reason that the backslash be added before [ or ]?
I suspect this is a bug in qmail-inject. It seems that qmail-inject
blindly takes $QMAILHOST as TOKEN822_ATOM. In your case the type
should be, I think, TOKEN822_LITERAL.
> 3. Is there anything I can do to avoid the quotes in the address part?
You can replace qmail-inject with new-inject, an experimental new
version of qmail-inject, included in the mess822 package. new-inject
doesn't have the problem you described.
Alternatively, you can apply my _untested_ patch attached below.
This seems to work, but I'm not sure whether this is the right way
to go. Use it at your own risk.
Of course, you could choose to avoid using domain literals in mail
addresses. Is it really necessary?
--
Tetsu Ushijima
*** qmail-inject.c.dist Mon Jun 15 19:53:16 1998
--- qmail-inject.c Tue Mar 23 00:35:38 1999
***************
*** 418,423 ****
--- 418,424 ----
void defaultfrommake()
{
char *fullname;
+ unsigned int mailhostlen;
fullname = env_get("QMAILNAME");
if (!fullname) fullname = env_get("MAILNAME");
if (!fullname) fullname = env_get("NAME");
***************
*** 446,454 ****
{
df.t[df.len].type = TOKEN822_AT;
++df.len;
! df.t[df.len].type = TOKEN822_ATOM;
! df.t[df.len].s = mailhost;
! df.t[df.len].slen = str_len(mailhost);
++df.len;
}
if (fullname && !flagnamecomment)
--- 447,465 ----
{
df.t[df.len].type = TOKEN822_AT;
++df.len;
! mailhostlen = str_len(mailhost);
! if (mailhostlen >= 2 && mailhost[0] == '[' && mailhost[mailhostlen-1] == ']')
! {
! df.t[df.len].type = TOKEN822_LITERAL;
! df.t[df.len].s = mailhost + 1;
! df.t[df.len].slen = mailhostlen - 2;
! }
! else
! {
! df.t[df.len].type = TOKEN822_ATOM;
! df.t[df.len].s = mailhost;
! df.t[df.len].slen = mailhostlen;
! }
++df.len;
}
if (fullname && !flagnamecomment)