Sahil Tandon wrote:
> On Sun, 22 Mar 2009, Stephen Rodgers wrote:
> 
>> I'm having some difficulty getting mailman to work with virtual
>> addresses under postfix. Posts to my test domain: mail...@ohnosec.org
>> are bounced and when I go in to /var/log/maillog to see why, postfix is
>> converting the address to mail...@sh.qrvc.com. sh.qrvc.com is the host
>> name of the host running postfix and mailman and handling the test
>> domain ohnosec.org. In other words, it is intended to host virtual
>> domain ohnosec.org for use by mailman.
>>
>> In /var/log/maillog there is one puzzling entry:
> 
> Not puzzling at all!
>  
>> Mar 21 23:46:39 sh postfix/smtp[18702]: B6694A817F:
>> to=<mail...@sh.qrvc.com>, orig_to=<mail...@ohnosec.org>, relay=none,
>> delay=0.3, delays=0.22/0.01/0.07/0, dsn=5.4.6, status=bounced (mail for
>> sh.qrvc.com loops back to myself)
> 
> Your virtual_alias_maps entry directs mail for mail...@ohnosec.org ->
> mail...@sh.qrvc.com.  Because you exclude this domain from $mydestination,
> Postfix does not accept mail for it, and the message loops.
>  
>> The orig_to entry is particularly concerning.
> 
> Not at all; it makes sense based on your configuration.
> 
>> I don't need to handle mail for domain sh.qrvc.com even though that is
>> the DNS host name for the host running Postfix.  I would like to
>> understand why postfix is changing the domain from ohnosec.com to
>> sh.qrvc.com given my configuration, and the complete maillog
>> of the transaction posted below in this message.
> 
> Because mail...@ohnosec.org points to 'mailman', and the result of a
> virtual(5) mapping is subject to address rewriting.  Specifically, when
> 'append_at_myorigin=yes', Postfix appends '@$myorigin' to addresses without
> '@domain'.  All of this is documented in the virtual(5) man page.  And
> because '$myorigin=$myhostname' by default, your alias to 'mailman' is
> rewritten to 'mail...@sh.qrvc.com'.
> 
>> *** postconf -n ***
>>
>> [r...@sh ~]# postconf -n
>> alias_database = hash:/etc/aliases
>> alias_maps = hash:/etc/aliases, hash:/etc/mailman/aliases
>> command_directory = /usr/sbin
>> config_directory = /etc/postfix
>> daemon_directory = /usr/libexec/postfix
>> debug_peer_level = 2
>> debug_peer_list = 68.99.120.0/24
>> html_directory = no
>> inet_interfaces = all
>> mail_owner = postfix
>> mailq_path = /usr/bin/mailq.postfix
>> manpage_directory = /usr/share/man
>> mydestination =
>> mydomain = qrvc.com
>> myhostname = sh.qrvc.com
>> newaliases_path = /usr/bin/newaliases.postfix
>> queue_directory = /var/spool/postfix
>> readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
>> recipient_delimiter = +
>> sample_directory = /usr/share/doc/postfix-2.3.3/samples
>> sendmail_path = /usr/sbin/sendmail.postfix
>> setgid_group = postdrop
>> unknown_local_recipient_reject_code = 550
>> virtual_alias_domains = ohnosec.org,limeylinux.org
>> virtual_alias_maps =
>> hash:/etc/postfix/virtual,hash:/etc/mailman/virtual-mailman
>>
>> *** /var/log/maillog with peer debug enabled ***
> 
> Please don't provide verbose/debug logging unless specifically requested.
> 
> [...]
> 
>> Mar 21 23:46:38 sh postfix/smtpd[18697]: maps_find: virtual_alias_maps:
>> hash:/etc/mailman/virtual-mailman(0,lock|fold_fix): mail...@ohnosec.org
>> = mailman
>> Mar 21 23:46:38 sh postfix/smtpd[18697]: mail_addr_find:
>> mail...@ohnosec.org -> mailman
> 


All of the above now makes sense. In fact, If I add the ohnosec.org
domain to $mydesination, and specify $myorigin as ohonsec.org, mailman
works as intended.

I have one final question with regard to the append of $myorigin to a
virtual mapping result. The on-line documentation states that
append_my_origin defaults to yes, and that it should not be turned off.
In my case, I want to avoid specifying $myorigin and leave it as the
default. as I want to handle the additional domains in a virtual manner.

The question is, how does one override this behavior so that rewrite
stays within the original domain while leaving the default setting for
$myorigin in place?




Reply via email to