Re: (mailx) How can I alter "From" header

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Chris Smith
Date: Monday, October 25, 2010 - 8:25 am

On Mon, Oct 25, 2010 at 7:13 AM, Dmitrij Czarkoff <czarkoff@gmail.com> wrote:

If you can find the sendmail equivalents here's some possibly helpful
notes from my postfix setup.

main.cf    (postfix's main configuration file) has (among much more):
=========================================
relayhost = [smtp.comcast.net]:587     # points to my ISP's mail server
sender_dependent_relayhost_maps = hash://etc/postfix/relay_map
#sender dependent override for above default
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd    #the db of
user / password pairs
=========================================

The relay_map file is something like:
=========================================
@chrissmith.org		[smtp.gmail.com]:587
@domalias1.com	[smtp.gmail.com]:587
@domalias2.com	[smtp.gmail.com]:587
...
@gmail.com                [smtp.gmail.com]:587
=========================================
Basically, if the post isn't for local delivery (Cyrus in this case)
Postfix delivers via the relayhost path unless there's a sender match
in this relay_map file, then it uses that path. So only email sent
from my Google Apps/Gmail accounts go through Gmail's servers (that
way the sent messages show up in the web interface as well).

The sasl_passwd file is pretty straightforward as well:
=========================================
me@chrissmith.org                   me@chrissmith.org:mypasswd
alias1@chrissmith.org		me@chrissmith.org:mypasswd
alias2@chrissmith.org		me@chrissmith.org:mypasswd
me@aliasdomain.org	        me@chrissmith.org:mypasswd
...
me@gmail.com		                me@gmail.com:mypasswd
[smtp.comcast.net]:587		myusername:mypasswd
=========================================
Notice that when sending via a Google Apps validated name or domain
alias that the authentication remains with the actual mailbox account
and will indeed be the "envelope sender"  - but not the "sender" or
"from:" address, which is determined by your email client unless your
local smtp server is rewriting the "from:" addresses (I'm not doing
that).

As I'm using Google Apps with both user and domain aliases it's a
little more complicated then just having one default.

main.cf also contains other parameters - you do need to use auth to
send via gmail's servers:
=========================================
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous, noplaintext
smtp_sasl_tls_security_options = noanonymous
=========================================
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
(mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Sun Oct 24, 1:04 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Philip Guenther, (Sun Oct 24, 1:17 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Chris Smith, (Sun Oct 24, 1:18 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Sun Oct 24, 2:06 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Jamie Paul Griffin, (Sun Oct 24, 3:50 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Sun Oct 24, 3:58 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Sun Oct 24, 4:06 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Jamie Paul Griffin, (Sun Oct 24, 4:10 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Sun Oct 24, 4:59 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Claus Assmann, (Sun Oct 24, 5:25 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Claus Assmann, (Sun Oct 24, 5:27 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Vijay Sankar, (Sun Oct 24, 5:34 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Chris Smith, (Sun Oct 24, 6:21 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Mon Oct 25, 3:58 am)
Re: (mailx) How can I alter &quot;From&quot; header, Tomas Bodzar, (Mon Oct 25, 4:05 am)
Re: (mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Mon Oct 25, 4:13 am)
Re: (mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Mon Oct 25, 4:28 am)
Re: (mailx) How can I alter "From" header, Chris Smith, (Mon Oct 25, 8:25 am)
Re: (mailx) How can I alter &quot;From&quot; header, Chris Smith, (Mon Oct 25, 8:28 am)
Re: (mailx) How can I alter &quot;From&quot; header, Chris Bennett, (Mon Oct 25, 12:32 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Jan Stary, (Mon Oct 25, 1:22 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Vadim Zhukov, (Mon Oct 25, 2:58 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Chris Smith, (Mon Oct 25, 7:13 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Chris Smith, (Mon Oct 25, 7:56 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Wed Oct 27, 12:19 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Chris Smith, (Wed Oct 27, 12:36 pm)
Re: (mailx) How can I alter &quot;From&quot; header, Dmitrij Czarkoff, (Wed Oct 27, 3:12 pm)