On Mon, Feb 27, 2006 at 12:06:39PM -0600, Lindsay Haisley wrote:
> Thus spake Vincent on Mon, Feb 27, 2006 at 07:05:40AM CST
> > On Fri, Feb 24, 2006 at 12:55:06PM -0600, Lindsay Haisley wrote:
> You might also look into using ssmtp an intermediary in the smtp process,
> although this would be a per-client solution and would only work on Linux
> clients, so it may not be ideal for you. Local MUAs would then need to
> contain appropriate configs to rewrite the body From header based on the
> destination address.
> On the other hand, ssmtp is a very simple smtp tool which works as a
> sendmail interface, so it's an outbound-only smtp client, and would work
> with any CLI tools which effectively invoke /usr/sbin/sendmail or equiv. It
> contains the following config option:
> # Set this to never rewrite the "From:" line (unless not given) and to
> # use that address in the "from line" of the envelope.
> ssmtp will then talk to whatever your outbound smpt server is, which should
> preserve the envelope from address.
> I've not come across any facility in courier which can do this, but courier
> contains many corners which I haven't visited.
> Of course, there's always something along the lines of a classic Unix hack
> which involves renaming /usr/sbin/sendmail to sendmail.real or something
> similar, and replacing /usr/sbin/sendmail with a perl or python (or awk/sed)
> script which will do the appropriate header rewriting and pass the mail on
> to ssmtp in some fashion. You wouldn't need to configure your individual
> MUAs in this case. My guess is that you don't want to go there ;-)
I would prefer not to :-). I appreciate the suggestions and
I have actually dealt with this very issue for years with various MTA's
including sendmail (which was always a nightmare to work with). I am
always in a situation, either in the work place or at home, where I need
send email between individual hosts on a LAN with the hostname after the
'@' in the from line and, at the same time, be able to send mail to the
outside with only the domain after the '@' in the from line. It has
always been a problem. I find it impossible to believe that it has not
been an ongoing problem for others as well, causing a lot more custom
administration, setting up separate internal mail servers, etc to
accomplish it. This is something that should be as simple as giving the
MTA a simple rule to rewrite the from line with your domain _only_ when
it is not addressed to a machine on the LAN. It is an over site in the
MTA's that I have never understood.
At the moment I am still evaluating exim, so I have uninstalled courier,
but I ran another test with postfix on my workstation just to verify.
Sure enough, since I have masquerading turned on, even when I change the
"From" line in mutt before sending to another host on the LAN, postfix
rewrites the header anyway if the from line contains a host on the same
domain. I have posted to the postfix list before about it and got the
same basic answer, "Postfix does not do destination based masquerading".
Scanning over the exim docs again, it looks like it has very flexible
header rewriting controls. So, for now, I am going to continue