> > > > > I am trying to see if it's possible when hosting mail for multiple 

> domains 
> 
> > 
> > 
> > > if 
> > > 
> > > > it's possible to get the actual domain to which the message belongs in 
> > > > all 
> 
> > the 
> > > 
> > > > email headers instead of always having it fall back to the "main" 
> > > > domain/hostname.
> > > > >
> > > > > I think the following header is written out by amavisd-new (please 
> correct 
> > 
> > > me 
> > > > if I'm wrong):
> > > > 
> > > > inbound, or outbound?
> > > 
> > > In this case, outbound, but I'm not sure it matters, at least when amavis 
> > > is 
> 
> > > used as a content_filter in postfix - you can use that in both scenarios 
> > > and 
> 
> > I'm 
> > > sure the functionality differs, at least with mostly default settings.
> > > 
> > > > and, munging the names/ip's can mess things up, since, amavisd, 
> > > > postfix, 
> > > > x-forward all some into play here.
> > > > 
> > > > (as an example, its hard to tell what part is munged, and what part to 
> > > > help you on)
> > > 
> > > That's why I specifically pointed out the issues (#1, #2, #3).  Please 
> re-read 
> > 
> > > what I wrote.  To reiterate, "diamond.example.com" is the local hostname. 
> > >  
> The 
> > 
> > > machine is also known as "mail.example.com".  I host another domain on 
> > > the 
> > > machine called "other.com."  I DO NOT want the two "example.com" parts in 
> the 
> > > header.  I am looking for a way to replace them with "other.com" (when 
> > > the 
> > > sender sends from that domain, in which case postfix's myhostname and 
> mydomain 
> > 
> > > are "mail.other.com"/"other.com").  
> > > 
> > > The ONLY things of importance that I munged were the domain names, but 
> > > they 
> > are 
> > > consistent with my explanations/questions.
> > > 
> > > I am additionally trying to understand how to forward back to postfix on 
> > > a 
> > > different port depending on this domain.
> > > 
> > > > mung the user name, ok, maybe not the domain, what can it hurt?
> > > > 
> > > > your ip/dns names, internal ip's all show up in the headers to this 
> > > > email anyway.
> > > > 
> > > > all you do is make it harder for people to look at it and help.  Like I 
> > > > said, we don't know what amavis or postfix munged, and what you munged.
> > > 
> > > I don't think it's rocket science.  I'm only needing to change the domain 
> > names 
> > > that show up in the header amavis spits out.
> > > 
> > > > > Received: from mail.example.com ([127.0.0.1])
> > > > >         by localhost (diamond.example.com [127.0.0.1]) (amavisd-new, 
> port 
> > > > 10024)
> > > > >         with ESMTP id 26IWMZMJeY2B for ;
> > > > >         Tue, 13 Oct 2009 17:11:50 -0400 (EDT)
> > > > >
> > > > > In my case, the local machine hostname is "diamond.example.com" and 
> > > > > it 
> is 
> > > also 
> > > > my mail server, "mail.example.com".  But in this case, the message is 
> being 
> > > sent 
> > > > by a user in a domain called, say, "other.com".  I have a Postfix 
> > > configuration 
> > > > where its headers are added using "other.com", but this header is the 
> > problem.
> > > > >
> > > > > It seems that "diamond.example.com" in this header is just caused by 
> > amavis 
> > > > grabbing the local machine hostname (problem #1 - is this possible to 
> > > change?).
> > > > >
> > > > > But as for how amavis got "mail.example.com", I am not entirely sure, 
> > since 
> > > > the handoff came from a Postfix instance where its mydomain is 
> > > > "other.com" 
> 
> > and 
> > > 
> > > > its myhostname is "mail.other.com" (problem #2 - where does this come 
> > > > from 
> 
> > and 
> > > 
> > > > can I change it?).
> > > > > \
> > > > >  
> > > > 
> > > > > Problem #3 is in regard to the handoff back to Postfix.  Is is 
> > > > > possible 
> to 
> > 
> > > > determine the mydomain from what Postfix is using and then change the 
> > > > $notify_method and $forward_method according to that domain?
> > > > >
> > > > >  
> > > > use policy banks, different ports to listen to, or different ip's.
> > > 
> > > I'm happy to read about how to do this, but not sure where to look.  Are 
> > > you 
> 
> > > saying it's possible to run ONE instance of amavis listening on more than 
> one 
> > > port, and that I can apply different configuration values depending on 
> > > that 
> > > port?  That'd be the easiest and best way to do this, but it seems to me 
> that 
> > > I'd have to run multiple instances of amavis, which is not desirable in 
> > > this 
> 
> > > case.
> > 
> > "policy banks" was the keyword I needed.  The document I also needed was:
> > 
> > http://amavisd.de.postfix.org/amavisd-new-docs.html#pbanks
> > 
> > Oh, and to listen on multiple ports with a single instance, the example's 
> right 
> > there in the configuration file:
> > 
> > $inet_socket_port = [10022,10024];
> > 
> > I have successfully redefined the re-injection method (port) using a 
> port-based 
> > policy bank.  Great start!  However, I also tried to re-define $mydomain 
> > therein, but it does not seem to work:
> > 
> > X-Virus-Scanned: amavisd-new at example.com
> > 
> > However, if I set $mydomain in the main, top-level configuration to 
> "other.com", 
> > I successfully get:
> > 
> > X-Virus-Scanned: amavisd-new at other.com
> > 
> > Hmm, is $mydomain off limits in policy banks?  Here is how I defined it:
> 
> I see.  The original value for $mydomain is used to build any other 
> configuration setting that uses it (such as $virus_admin = 
> "virusale...@$mydomain";)  That means it's too late to just change $mydomain 
> by 
> the time my new policy bank is used.  So I had to redefine X_HEADER_LINE 
> instead:
> 
> $policy_bank{'OTHER'} = {
>   mydomain => 'other.com',
>   notify_method  => 'smtp:[127.0.0.1]:10023',
>   forward_method => 'smtp:[127.0.0.1]:10023',
>   X_HEADER_LINE => "$myproduct_name at other.com",
>   insert_received_line => 0,
> };

But it does look like $mydomain is off limits for policy banks.  When sending 
emails, I see this in my maillog:

(!)loading policy bank "YTFO": unknown field "mydomain"

I didn't really need "mydomain" in my policy bank, so I just commented it out.

> > Please note that this does NOT address the problem of the Received header I 
> > mentioned above (problem #1 and #2), which I don't know how to change.
> 
> I cannot find any configuration settings that seem to deal with how this 
> Received header is constructed by amavis.  So, unfortunately, it looks like 
> the 
> only choice I have is to override the value for $insert_received_line in my 
> policy bank so the header is removed entirely (see above).  If there are ways 
> to 
> actually change how the Received header is built, I'd love to know.
> 
> Thanks



      

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 
 AMaViS-HowTos:http://www.amavis.org/howto/ 

Reply via email to