12 messages in net.sourceforge.lists.courier-usersRe: [courier-users] destination based...
FromSent OnAttachments
VincentFeb 24, 2006 10:47 am 
Lindsay HaisleyFeb 24, 2006 10:55 am 
VincentFeb 27, 2006 5:06 am 
Lindsay HaisleyFeb 27, 2006 10:07 am 
Lindsay HaisleyFeb 27, 2006 10:31 am 
VincentMar 1, 2006 5:30 pm 
Gordon MessmerMar 2, 2006 11:59 am 
Jerry AmundsonMar 2, 2006 12:26 pm 
Sergiy ZhukMar 2, 2006 12:38 pm 
VincentMar 2, 2006 4:22 pm 
Francisco ReyesMar 2, 2006 8:55 pm 
Gordon MessmerMar 3, 2006 3:34 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] destination based domain masqueradingActions...
From:Lindsay Haisley (fmou@fmp.com)
Date:Feb 27, 2006 10:07:43 am
List:net.sourceforge.lists.courier-users

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:

This is pretty much a MUA issue, not a MTA issue. If you use a MUA such as mutt (for Linux) that's capable of such things, you can set the From line to anything you like. I use mutt or evolution for most of my email, and ssmtp on my local desktop system which can be told to set the envelope mail-from address to whatever the body from header address is (which is why this post appears to come from "fmouse-courier" instead of just "fmouse".

Ok. Thanks for the reply. I use mutt for my primary mailer also. I have also found no way to make the MTA rewrite the _From_ line based on destination on machines we have running postfix. It would be convenient to not have to customize every client on every machine for it. Also, we sometimes send mail from the command line or from a script using the standard _mail_ utility. I have not found any command line options to set the From line with mail.

I have also started researching exim. It appears that it has this ability, so I am going to evaluate it further as a possible choice of MTA also.

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. FromLineOverride=YES

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 ;-)