[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: exim4: how to handle other addresses on my ISP?



On Wed, Nov 15, 2006 at 01:21:20AM -0600, Russell L. Harris wrote:
> The selection of the proper From: header for outgoing mail is the duty
> of your mail user agent (MUA); the MUA may be Mutt, Gnus, Balsa,
> Sylpheed, Thunderbird, etc.  Read the documentation concerning
> multiple send 'personas' or 'personalities'.  

I saw your post on the mutt users list where it was advised to set the
envelope_from in the MUA so the ISP wouldn't reject the mail. I think it
should be the MTA's job. Imagine, everytime a user changed their MUA
they would have to configure this everytime whereas if it was set in the
MTA then it would only have to be done *once* by the system
administrator. I was running Exim and it worked out of the box once you
had answered the debconf questions correctly *and* entered the users in
the /etc/email-addresses (I'm not sure if that is the correct name
because I am now trying postfix, which incidentally gained me about 1.1M
of disk space, and wiped all traces of exim off my hard disk.) file. It
is self documenting.

When I installed postfix guess what? Yep, my mail was rejected from my
ISP because it was still showing me@localdomain instead of
username@myisp. After a bit of reading of the copious documentation, I
found in ADDRESS_REWRITING_README.gz what I was looking for and so I
cd into /etc/postfix, created a file called generic with the following
line:
chrisb@localhost.localdomain      mockingbird@ihug.co.nz
and also added:
smtp_generic_maps = hash:/etc/postfix/generic
to /etc/postfix/main.cf as per instructions. Restarted postfix. Grumble
grumble, "postconf -n" still showed "smtp_generic_maps =" i.e. nothing.
Back to the documentation ... ahh ... in another completely separate
document I found the postmap command. YES!!, so I issued a 
postmap /etc/postfix/generic
and voila a generic.db file was created in the /etc/postfix directory.

It was about this time I saw your post in mutt-users and the replys
about setting envelope_from and thought 'strange, why would you set the
same thing in two places, this aint Windows'. 

About this time I tested my email again, NO!!!, it was rejected! I
thought lucky I saw your post to mutt-users and put:

set use_envelope_from=yes
set envelope_from_address="mockingbird@ihug.co.nz"

into my .muttrc and tested again and sure enough it worked.

BUT I still wasn't satisfied, it felt like a hack for reasons I
explained above. So I had a closer look at the rejected mail and it
wasn't chrisb@localhost.localdomain it was seeing but, chrisb@kan.
AHHH!!! why didn't I see that, duh.

So to cut a long story short :-) I deleted the /etc/postfix/generic.db
file, put chrisb@kan	mockingbird@ihug.co.nz into /etc/postfix/generic
ran "postmap /etc/postfix/generic" then ran "postfix reload" (according
to the documentation a "postfix stop" then "postfix start" does NOT
reload the configuration. Commented out "set use_envelope_from=yes" and 
"set envelope_from_address="mockingbird@ihug.co.nz"" from my .muttrc and
gave it another test. YES IT WORKED!!!

P.S. I have "alternates "mockingbird@ihug.co.nz"" in my .muttrc but Its
been in there since exim3. Also to get all the postfix documentation you
have to install postfix-doc which installs the documentation under
/usr/share/doc/postfix/ NOT /usr/share/doc/postfix-doc/.


> The sorting of incoming mail for multiple users or multiple
> personalities is the function of a mail delivery agent (MDA) such as
> maildrop.  Exim has no role to play with respect to incoming mail
> which originates outside the LAN.

Agreed.

-- 
Chris.
======
" ... the official version cannot be abandoned because the implication of
rejecting it is far too disturbing: that we are subject to a government
conspiracy of `X-Files' proportions and insidiousness."
Letter to the LA Times Magazine, September 18, 2005.



Reply to: