On Mon, Oct 25, 2010 at 7:13 AM, Dmitrij Czarkoff <czark...@gmail.com> wrote: > I wan't to send messages through smtp.gmail.com with "From: > czark...@gmail.com".
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: ========================================= m...@chrissmith.org m...@chrissmith.org:mypasswd ali...@chrissmith.org m...@chrissmith.org:mypasswd ali...@chrissmith.org m...@chrissmith.org:mypasswd m...@aliasdomain.org m...@chrissmith.org:mypasswd ... m...@gmail.com m...@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 =========================================