Hopefully I have improved my question-asking now. :)

I'm using smtp.gmail.com with Postfix. It is working and all emails are
delivered.
All my config info is at the bottom of this message.
The account I use to sign in to gmail is me-at-example.com (as shown in
config below).
I want to check my emails using the gmail web client for me-at-example.com.
(All this basic functionality is working.)

I want to correct my email addressing, as I will try to describe below.

In this message I globally replaced @ with -at- so it will be easier to read
in some clients (like Nabble) that obfuscate email addresses as "n...@..."

Here's the first example of email addressing that I want to fix/modify.

subject: DenyHosts Report
from: nobody-at-localhost
to: root-at-localhost

I want this to be from me-at-example.com (or root-at-example.com) to
me-at-example.com.
The message does not appear in my sent mail folder at example.com (but I
want it to).

>From the headers you will see that I am now aliasing root-at-localhost as
myname-at-otherdomain2.net. And I am forwarding all email from
myname-at-otherdomain2.net to me-at-example.com. That's the only way (so
far) I could get email intended for root-at-localhost to appear in the inbox
of me me-at-example.com.

I want mail now intended for root-at-localhost to instead go directly to
me-at-example.com (and appear in both sent-mail and inbox, as it would if I
sent it from a normal client with those to/from addresses). I tried, without
success, to do this on my own.

Delivered-To: me-at-example.com
Received: by 10.229.91.201 with SMTP id oooooooooom;
        Tue, 27 Jan 2009 08:43:20 -0800 (PST)
Received: by 10.114.14.8 with SMTP id mmmmmm.76.1233074599667;
        Tue, 27 Jan 2009 08:43:19 -0800 (PST)
Return-Path: <myname+caf_=me=example.com-at-otherdomain2.net>
Received: from wf-out-1314.google.com (wf-out-1314.google.com[209.85.200.172])
        by mx.google.com with ESMTP id nnnnnnnnnof.27.2009.01.27.08.43.18;
        Tue, 27 Jan 2009 08:43:19 -0800 (PST)
Received-SPF: neutral (google.com: 209.85.200.172 is neither permitted nor
denied by best guess record for domain of myname+caf_=me=
example.com-at-otherdomain2.net) client-ip=209.85.200.172;
Authentication-Results: mx.google.com; spf=neutral (google.com:
209.85.200.172 is neither permitted nor denied by best guess record for
domain of myname+caf_=me=example.com-at-otherdomain2.net)
smtp.mail=myname+caf_=me=example.com-at-otherdomain2.net
Received: by wf-out-1314.google.com with SMTP id 2ssssssssssssa.27
        for <me-at-example.com>; Tue, 27 Jan 2009 08:43:18 -0800 (PST)
Received: by 10.142.169.4 with SMTP id rrrrrrrrrrre.262.1233074598389;
        Tue, 27 Jan 2009 08:43:18 -0800 (PST)
X-Forwarded-To: me-at-example.com
X-Forwarded-For: myname-at-otherdomain2.net me-at-example.com
Delivered-To: myname-at-otherdomain2.net
Received: by 10.143.62.8 with SMTP id pppppppppppk;
        Tue, 27 Jan 2009 08:43:18 -0800 (PST)
Received: by 10.100.207.14 with SMTP id eeeeeeeeeeeeeee.60.1233074597413;
        Tue, 27 Jan 2009 08:43:17 -0800 (PST)
Return-Path: <nobody-at-localhost>
Received: from MyHostName.example.com (myhost.com [xxx.xxx.xxx.345])
        by mx.google.com with ESMTP id nnnnnnnnnna.37.2009.01.27.08.43.16;
        Tue, 27 Jan 2009 08:43:17 -0800 (PST)
Received-SPF: neutral (google.com: xxx.xxx.xxx.345 is neither permitted nor
denied by best guess record for domain of nobody-at-localhost)
client-ip=xxx.xxx.xxx.345;
Authentication-Results: mx.google.com; spf=neutral (google.com:
xxx.xxx.xxx.345 is neither permitted nor denied by best guess record for
domain of nobody-at-localhost) smtp.mail=nobody-at-localhost
Received: by MyHostName.example.com (Postfix)
    id 5081C12B70; Tue, 27 Jan 2009 11:43:16 -0500 (EST)
Delivered-To: root-at-localhost
Received: from example.com (localhost [127.0.0.1])
    by MyHostName.example.com (Postfix) with ESMTP id 4444444444
    for <root-at-localhost>; Tue, 27 Jan 2009 11:43:16 -0500 (EST)
From: DenyHosts <nobody-at-localhost>
To: root-at-localhost
Subject: DenyHosts Report
Date: Tue, 27 Jan 2009 11:43:16 -0500
Message-Id: <20090127164316.xxxxxxxxE5-at-MyHostName.example.com>

Added the following hosts to /etc/hosts.deny:

210.51.1.21 (unknown)

-----------------------------------------------------------------------------------------------------------

Test Email 1 (while logged in as myuseracct)

to: root-at-localhost
from: myuseracct-at-example.com

I want it to be addressed from me-at-example.com (or
myuseracct-at-example.com) and addressed to me-at-example.com. The message
does not appear in sent-mail and I think it should.

Delivered-To: me-at-example.com
Received: by 10.229.91.201 with SMTP id nnnnnnnnnnm;
        Tue, 27 Jan 2009 08:43:57 -0800 (PST)
Received: by 10.220.98.70 with SMTP id nnnnnnnnnnnnn.13.1233074636356;
        Tue, 27 Jan 2009 08:43:56 -0800 (PST)
Return-Path: <myname+caf_=me=example.com-at-otherdomain2.net>
Received: from rn-out-0910.google.com (rn-out-0910.google.com[64.233.170.184])
        by mx.google.com with ESMTP id nnnnnnnnn.25.2009.01.27.08.43.56;
        Tue, 27 Jan 2009 08:43:56 -0800 (PST)
Received-SPF: neutral (google.com: 64.233.170.184 is neither permitted nor
denied by best guess record for domain of myname+caf_=me=
example.com-at-otherdomain2.net) client-ip=64.233.170.184;
Authentication-Results: mx.google.com; spf=neutral (google.com:
64.233.170.184 is neither permitted nor denied by best guess record for
domain of myname+caf_=me=example.com-at-otherdomain2.net)
smtp.mail=myname+caf_=me=example.com-at-otherdomain2.net
Received: by rn-out-0910.google.com with SMTP id kkkkkkkkkkkkrnd.7
        for <me-at-example.com>; Tue, 27 Jan 2009 08:43:55 -0800 (PST)
Received: by 10.143.33.19 with SMTP id lnnnnnnnnnnnnnn.30.1233074635346;
        Tue, 27 Jan 2009 08:43:55 -0800 (PST)
X-Forwarded-To: me-at-example.com
X-Forwarded-For: myname-at-otherdomain2.net me-at-example.com
Delivered-To: myname-at-otherdomain2.net
Received: by 10.143.62.8 with SMTP id pppppppppppk;
        Tue, 27 Jan 2009 08:43:55 -0800 (PST)
Received: by 10.100.105.9 with SMTP id dddddddddddddd.142.1233074634715;
        Tue, 27 Jan 2009 08:43:54 -0800 (PST)
Return-Path: <myuseracct-at-example.com>
Received: from MyHostName.example.com (myhost.com [xxx.xxx.xxx.345])
        by mx.google.com with ESMTP id nnnnnnnnnnd.14.2009.01.27.08.43.53;
        Tue, 27 Jan 2009 08:43:54 -0800 (PST)
Received-SPF: neutral (google.com: xxx.xxx.xxx.345 is neither permitted nor
denied by best guess record for domain of myuseracct-at-example.com)
client-ip=xxx.xxx.xxx.345;
Authentication-Results: mx.google.com; spf=neutral (google.com:
xxx.xxx.xxx.345 is neither permitted nor denied by best guess record for
domain of myuseracct-at-example.com) smtp.mail=myuseracct-at-example.com
Received: by MyHostName.example.com (Postfix)
    id 95C0D123E5; Tue, 27 Jan 2009 11:43:53 -0500 (EST)
Delivered-To: root-at-localhost
Received: by MyHostName.example.com (Postfix, from userid 2000)
    id 834C712B70; Tue, 27 Jan 2009 11:43:53 -0500 (EST)
Subject: test 1
Message-Id: <20090127164353.nnnnnnnnnn-at-MyHostName.example.com>
Date: Tue, 27 Jan 2009 11:43:35 -0500 (EST)
From: myuseracct-at-example.com (My User)
To: undisclosed-recipients:;

sendmail root-at-localhost


-----------------------------------------------------------------------------------------------------------

Test Email 2
from: myuser-at-example.com
to:  me-at-example.com

instead of the sender showing up as MyHostName.example.com, I want it to be
just example.com.
This email does not appear in my inbox at me-at-example.com. Does appear in
my sent-mail folder at me-at-example.com.
I want it to appear in both inbox and sent-mail, just as email sent from the
gmail webclient does.

With the addressing (and smtp account) I'm using, why does some email appear
only in the sent-mail folder and other email appears only in the inbox?

Return-Path: <me-at-example.com>
Received: from MyHostName.example.com (myhost.com [xxx.xxx.xxx.345])
        by mx.google.com with ESMTPS id
nnnnnnnnnnnnnnnn.1.2009.01.27.08.44.21
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Tue, 27 Jan 2009 08:44:21 -0800 (PST)
Received: by MyHostName.example.com (Postfix, from userid 2000)
    id 3B36C12B70; Tue, 27 Jan 2009 11:44:20 -0500 (EST)
Subject: test 2
 sendmail me-at-example.com
Message-Id: <20090127164420.nnnnnnnnnn-at-MyHostName.example.com>
Date: Tue, 27 Jan 2009 11:44:05 -0500 (EST)
From: My User <me-at-example.com>
To: undisclosed-recipients:;

-----------------------------------------------------------------------------------------------------------

subject: unattended-upgrades result
from: root-at-example.com
to: myname-at-otherdomain.com

The from-address is fine. I want the to-address to be
me-at-example.cominstead of
myname-at-otherdomain.com. How do I change this?
I have no idea why this email is addressed to myname-at-otherdomain.com (or
where I may have set that at one time). I realize this is a dumb question,
but I hope you can give me an intelligent answer :)
I'm hoping for a step-by-step solution to changing these email addresses.

I also want this email to appear in the sent-mail folder for
me-at-example.com (because this is the account used to send it). What change
is required to affect this result?

I'll continue with other specific examples, because I do not yet see the
pattern for how email gets addressed by my system. Each case I present below
seems unique and I have specific questions about addressing for each
example.

-----------------------------------------------------------------------------------------------------------


 postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
delay_warning_time = 0h
disable_dns_lookups = no
disable_vrfy_command = yes
inet_interfaces = 127.0.0.1
inet_protocols = all
invalid_hostname_reject_code = 554
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
maps_rbl_domains = multi.uribl.com,            dsn.rfc-ignorant.org,
dul.dnsbl.sorbs.net,            list.dsbl.org,
sbl-xbl.spamhaus.org,            bl.spamcop.net,
dnsbl.sorbs.net,
cbl.abuseat.org,            ix.dnsbl.manitu.net,
combined.rbl.msrbl.net,            rabl.nuclearelephant.com
maximal_queue_lifetime = 1d
multi_recipient_bounce_reject_code = 554
mydestination = /etc/postfix/local-host-names
myhostname = MyHostName.example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
non_fqdn_reject_code = 554
readme_directory = no
recipient_delimiter = +
relay_domains_reject_code = 554
relayhost =
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_cert_file = /etc/postfix/FOO-cert.pem
smtp_tls_key_file = /etc/postfix/FOO-key.pem
smtp_tls_loglevel = 1
smtp_tls_per_site = hash:/etc/postfix/tls_per_site
smtp_tls_session_cache_database = btree:/var/run/smtp_tls_session_cache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_helo_required = yes
smtpd_recipient_restrictions =
permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = no
smtpd_sasl_local_domain = $myhostname
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/postfix/FOO-cert.pem
smtpd_tls_key_file = /etc/postfix/FOO-key.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:/var/run/smtpd_tls_session_cache
smtpd_use_tls = yes
strict_rfc821_envelopes = yes
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_address_reject_code = 554
unknown_client_reject_code = 554
unknown_hostname_reject_code = 554
unknown_local_recipient_reject_code = 554
unknown_relay_recipient_reject_code = 554
unknown_virtual_alias_reject_code = 554
unknown_virtual_mailbox_reject_code = 554
unverified_recipient_reject_code = 554
unverified_sender_reject_code = 554


cat /etc/aliases
root: myname-at-otherdomain2.net

generic is empty

$ cat transport
example.com smtp:[smtp.gmail.com]:587


only change in master.cf is this (based on this list's feedback yesterday)
127.0.0.1:smtp      inet  n       -       -       -       -       smtpd

$ cat local-host-names
localhost

$ cat sasl_passwd
[smtp.gmail.com]:587 m...@example.com:mypassword

Reply via email to