Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
From postfix, using gmail as a relayhost, bad from field
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
saluk
n00b
n00b


Joined: 25 Aug 2004
Posts: 34

PostPosted: Mon Feb 06, 2006 4:08 am    Post subject: From postfix, using gmail as a relayhost, bad from field Reply with quote

I have finally gotten my postfix configuration to authenticate with gmail, after much pain and suffering :) Now, my only problem is that any email I send arrives at its destination as if it had come from gmail instead of my local ip. This is not exactly what I want. What I want is for the from field to contain my local domain, but be relayed over gmail. I've been playing around with the settings in postfix, but I'm wondering if maybe this is something gmail enforces? The docs I read to help set it up were using a gmail account to recieve and send, and wanted this behavior. Here are the relevant pieces of information:

email header:
Code:

X-Gmail-Received: 901f88ab4f0a23c569c1acbe8c377682f0355ded
Return-Path: <****@gmail.com>  #<-------Want to change this to ****@$mydomain.com
Received: from mail.$mydomain.com ( [$myip])
        by mx.gmail.com with ESMTP id g3sm7060530wra.2006.02.05.18.54.54;
        Sun, 05 Feb 2006 18:54:55 -0800 (PST)
Received: by mail.$mydomain.com (Postfix, from userid 1000)
   id 15BF0151DC1; Sun,  5 Feb 2006 19:14:22 -0800 (PST)
Date: Sun, 5 Feb 2006 19:14:22 -0800
To: ****@gmail.com
Subject: testing
Message-ID: <20060206031422.GC30567@$myhostname.$mydomain.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.11
From: ****@gmail.com    #<-------Want to change this to ****@$mydomain.com


postconf -n:
Code:

alias_database = hash:/etc/mail/aliases
alias_maps = mysql:/etc/postfix/mysql-aliases.cf
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 5
debug_peer_list = 127.0.0.1
default_destination_concurrency_limit = 20
home_mailbox = .maildir/
html_directory = /usr/share/doc/postfix-2.2.8/html
inet_interfaces = all
local_destination_concurrency_limit = 2
local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname
local_transport = local
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = ****.com
myhostname = mail.****.com
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.8/readme
relayhost = smtp.gmail.com:587   #have tried both [smtp.gmail.com]:587 and without brackets, same behavior
relocated_maps = mysql:/etc/postfix/mysql-relocated.cf
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_enforce_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/saslpass
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_cert_file = /etc/postfix/newcert.pem
smtp_tls_enforce_peername = no
smtp_tls_key_file = /etc/postfix/newreq.pem
smtp_tls_loglevel = 3
smtp_tls_per_site = hash:/etc/postfix/tls_per_site
smtp_tls_session_cache_database = btree:/var/run/postfix/smtp_tls_session_cache
smtp_use_tls = yes
smtpd_sasl_application_name = smtpd
smtpd_sasl_auth_enable = no
smtpd_sasl_local_domain = $myhostname
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_key_file = /etc/postfix/newreq.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:/var/run/postfix/smtpd_tls_session_cache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf
virtual_gid_maps = static:100
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = ****.com,      mail.****.com
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf
virtual_minimum_uid = 1000
virtual_transport = virtual
virtual_uid_maps = static:1008


It could be a configuration setting problem, since I modified a lot of things trying to get the authentication to work. Any ideas?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum