Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Masquerading and Postfix 1

Status
Not open for further replies.

CyberMartyr

IS-IT--Management
Nov 9, 2005
7
US
No matter what mail client or what user is being used when mail is sent with the email address set as alias@domain.com the receiver sees unixusername@serverdomain.com. How do I fix this?
 
Thank you for your help but none of these options are working.
 
What is mydomain set to in main.cf? myorigin?

Post some excerpts from your maillog. If nothing interesting is in there, turn up the debugging.

You mention that no changes you made based on the address rewriting readme had any effect. Are you using a smarthost? Is that smarthost also configured to rewrite addresses?
 
I'll do even better, here is my config file...

soft_bounce = no

command_directory = /usr/local/sbin

daemon_directory = /usr/local/libexec/postfix

myhostname = MaskeProductions.com

mydomain = MaskeProductions.com

myorigin = MaskeProductions.com

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, ftp.$mydomain, definitionofhate.com, fearfactoryfans.com, fearfactoryforums.com, blinkieblast.com, bonescraper.com, blinkieblast.com, babykinsx2.com, naturallyofcourse.com, maskeproductions.com, maske.org, vaderfans.com

local_recipient_maps =

unknown_local_recipient_reject_code = 550

mynetworks = xxx.xxx.xxx.xxx
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,reject_unauth_destination, permit
relay_domains = $mydestination,xxx.xxx.xxx.xxx

local_header_rewrite_clients = permit_inet_interfaces

alias_maps = hash:/etc/aliases

canonical_maps = hash:/usr/local/etc/postfix/canonical

debug_peer_level = 2

debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/local/sbin/sendmail

newaliases_path = /usr/local/bin/newaliases

mailq_path = /usr/local/bin/mailq

setgid_group = maildrop

html_directory = no

manpage_directory = /usr/local/man

sample_directory = /usr/local/etc/postfix

readme_directory = no
queue_directory = /var/spool/postfix
mail_owner = postfix

I've stripped out the private IP's
 
What does your canonical file look like and did you remember to run postmap after updating it?
 
Looks like this...

# Domain.com
alias@domain.com unixusername

Yes I ran postmap.
 
# Domain.com
alias@domain.com unixusername

Err... am I missing something here? You're using canonical mapping to rewrite alias@domain.com as unixusername, then complaining that the recipients see unixusername?
 
This is how I understand it.

If email is sent to blah@blah.com but the username on the server is nobody the server will accept mail as blah@blah.com but put it into unixusername's mailbox.

I want this to happen and that is working but when that user sends out email it's rewritting it to username@systemdomain.com which I don't want to happen.

So how do I get aliases to work without the rewrite taking place on the way out?
 
Almost! Now it does this...

I sent mail from my client, alias@domain.com it no longer changes domain.com alias to unixusername but it still changes the hostname from domain.com to serverdomain.com

so alias@domain.com becomes alias@serverdomain.com

Here is the change I made.

< canonical_maps = hash:/usr/local/etc/postfix/canonical

> recipient_canonical_maps = hash:/usr/local/etc/postfix/canonical
 
I'll be honest and say I don't know why you've having this problem. Logfiles would certainly be helpful.

That said, an easy fix to this, I think, would be to use sender_canonical_maps.
 
These options fixed it, I would not of done it without your help...

append_dot_mydomain = no
swap_bangpath = no
append_at_myorigin = no
allow_percent_hack = no
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top