PDA

View Full Version : postfix rewrite headers


leblanc
14th November 2007, 07:46
my mail is being rejected from remote smtp servers since they can't verify my domain name enclosed in the mail headers.

"Sender address rejected: Domain not found "

heres an envelop:

-
X-Original-To: me@mixhacks.com
Delivered-To: me@mixhacks.com
Date: Wed, 14 Nov 2007 00:25:57 -0600
From: root <root@linux-server.robust>
To: me@mixhacks.com
Subject: root to me
User-Agent: Mutt/1.5.16 (2007-06-09)



since i'm using an account on my box to send email I am getting
root@`hostname -f`

i changed my hostname to mixhacks.com but the old hostname must be in the config somewhere.

postconf | grep robust
reveals nothing.

postfix stop
postfix start
postfix reload

doesn't update the hostname attached to root account when mailing.

1)

how can i map a user to a specific domain?

meaning root user sends:
root@mixhacks.com
me user is sent as:
me@robusthaven.com



linux-server:/var/spool/mail # postconf | grep my
append_at_myorigin = yes
append_dot_mydomain = yes
lmtp_lhlo_name = $myhostname
local_transport = local:$myhostname
milter_macro_daemon_name = $myhostname
mydestination = mail1.mixhacks.com, mixhacks.com, localhost
mydomain = mixhacks.com
myhostname = mail1.mixhacks.com
mynetworks = 127.0.0.0/8 [::1]/128
mynetworks_style = subnet
myorigin = mixhacks.com
parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,perm it_mx_backup_networks,qmqpd_authorized_clients,rel ay_domains,smtpd_access_maps
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
relay_domains = $mydestination
smtp_helo_name = $myhostname
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_event_limit_exceptions = ${smtpd_client_connection_limit_exceptions:$mynetw orks}
smtpd_proxy_ehlo = $myhostname
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination

falko
15th November 2007, 14:14
Which distribution are you using?

leblanc
15th November 2007, 15:20
I am using opensuse 10.3

i finally can receive emails from external sources.

i just haven't figured out how to rewrite the envelop so that it uses a real domain instead of my old hostname.
until i do that i can't send as i'm seen as a spammer since domain cannot be resolved.


current configuration

inet_protocols = all
inet_interfaces = all
biff = no
mail_spool_directory = /var/mail
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
myhostname = mail1.mixhacks.com
mydestination = mail1.mixhacks.com, mixhacks.com, localhost
myorigin = mixhacks.com
program_directory = /usr/lib/postfix
disable_dns_lookups = no
strict_8bitmime = no
disable_mime_output_conversion = no
smtpd_helo_required = no
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
strict_rfc821_envelopes = no
smtp_sasl_auth_enable = no
smtpd_sasl_auth_enable = no
smtpd_use_tls = no
smtp_use_tls = no
alias_maps = hash:/etc/aliases
mailbox_size_limit = 0
message_size_limit = 10240000


virtual_alias_maps = hash:/etc/postfix/hash/valias_maps
append_at_myorigin = yes
mynetworks_style = subnet
proxy_interfaces = mail1.mixhacks.com





postfix on my system: find / -name postfix


/var/spool/postfix
/var/adm/backup/postfix
/var/adm/SuSEconfig/md5/etc/postfix
/usr/share/doc/packages/postfix
/usr/share/SuSEfirewall2/services/postfix
/usr/sbin/postfix
/usr/lib/postfix
/usr/lib/scpm/resource_types/service/get_deps/postfix
/etc/sysconfig/postfix
/etc/permissions.d/postfix
/etc/postfix
/etc/init.d/postfix

falko
16th November 2007, 17:18
You can change the hostname in YaST. Just run yast to start it.

leblanc
16th November 2007, 22:23
yeah i've already done that.

but postfix still uses linux-server.robust
i've grep postconf | grep robust
and don't see anything.

i'm thinking the problem is with
postfix masquerading

the from address on outbound email keep user@linux-server.robust
also the email id generated is timestamp.linux-server.robust

so close but yet so far away.


today i'm going generate an email from an external client and see if it will rewrite correctly.. to bad i can't fix this locally.

with all these postfix tutorials.. wished there was just a simple virtual hosting with flat files non db.

falko
17th November 2007, 19:02
What's the output of telnet localhost 25?

leblanc
18th November 2007, 05:06
ha i learned a lot about postfix in these last few days..

problem was my mutt mail client.

instead of using a client .. i should have kept it all within postfix:
#sendmail -v me@tamu.edu
#sendmail -v me@mixhacks.com

postfix was already setup fine...it doesn't generate
linux-server.robust


mutt client has a from field you can set:
ESC f allows you to edit the from: field
on per message basis

you can set it statically in
vi /home/username/.muttrc
my_hdr FROM:Leblanc Meneses <me@mixhacks.com>
... wonder how you add multiple domain support ... me@robusthaven.com?

i still don't know how set the message-id which still appends linux-server.robust

but at least i know what the real problem is.

anyways thanks everyone.