> I think the following header is written out by amavisd-new It is.
> 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 <u...@somewhere.com>; > 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. Here is a complete breakdown of component fields that make up the Received header field, as generated by amavisd. It closely follows the RFC 2821 'Trace Information' syntax and semantics (now RFC 5321). > Received: from mail.example.com ([127.0.0.1]) ^^^^^^^^^^^^^^^^ mail.example.com is whatever your Postfix presented to amavisd in its EHLO command while handing the message over to amavisd > Received: from mail.example.com ([127.0.0.1]) ^^^^^^^^^^^ 127.0.0.1 is the source IP address from which amavisd received the TCP connection > by localhost (diamond.example.com [127.0.0.1]) (amavisd-new, port 10024) ^^^^^^^^^ localhost is your $localhost_name setting, it is a member of policy banks. > by localhost (diamond.example.com [127.0.0.1]) (amavisd-new, port 10024) ^^^^^^^^^^^^^^^^^^^ diamond.example.com is the $myhostname setting, member of policy banks > by localhost (diamond.example.com [127.0.0.1]) (amavisd-new, port 10024) ^^^^^^^^^ 127.0.0.1 is the IP address of amavisd socket that received a connection > by localhost (diamond.example.com [127.0.0.1]) (amavisd-new, port 10024) ^^^^^^^^^^^ amavisd-new is the $myproduct_name setting > by localhost (diamond.example.com [127.0.0.1]) (amavisd-new, port 10024) ^^^^^ dst socket port number on which the connection was received by amavisd > with ESMTP id 26IWMZMJeY2B for <u...@somewhere.com>; ^^^^^ ESMPT is derived from the session type (smtp/lmtp, authenticated or not, ...) > with ESMTP id 26IWMZMJeY2B for <u...@somewhere.com>; ^^^^^^^^^^^^ 26IWMZMJeY2B is the mail_id (also available as macro %i), i.e. a unique identification of this SMTP transaction. It is commonly used in the quarantine name template, in notifications and in the log > Tue, 13 Oct 2009 17:11:50 -0400 (EDT) The date/time corresponds to the moment at which the SMTP transaction was opened (the MAIL FROM command) > 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?). Yes, it is the $myhostname. Actually the 'myhostname' key from the currently loaded policy bank. > 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?). It's what Postfix provided when introducing itself with EHLO. Configurable through 'smtp_helo_name' Postfix option (global or per-service). > 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? Yes, through policy banks. > I am additionally trying to understand how to forward back to postfix > on a different port depending on this domain. Again, through policy banks, key 'forward_method'. > 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: > Hmm, is $mydomain off limits in policy banks? Here is how I defined it: > $policy_bank{'OTHER'} = { > mydomain => 'other.com', > notify_method => 'smtp:[127.0.0.1]:10023', > forward_method => 'smtp:[127.0.0.1]:10023', > }; Wrong variable. What you need is 'myhostname'. The $mydomain is just a convenience variable which you can use in the config file to more consistently define other settings and to provide a default for them, such as @local_domains_maps. It is not a member of policy banks, in fact it is not used by amavisd at all (with one tiny exception). Mark ------------------------------------------------------------------------------ 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/