Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Multiple GMail Smart Hosts (smarthosts)

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


djberen at gmail

Oct 19, 2009, 7:55 AM

Post #1 of 3 (685 views)
Permalink
Multiple GMail Smart Hosts (smarthosts)

Hi Everyone,

I'm a newbie when it comes to Exim, so please go easy.

I've been reading a few tutorials on how to set up multiple gmail
smarthosts, but can't figure it out.

I have two sites hosted on my server and they both need to send email. I've
set up google apps for domains and set up a donotreply [at] domain email
account.

I've got it currently set up perfectly where all email can come out of
domainX, but I want to make it so it reads the "From:" field then uses a
different set of authentication credentials based on that. - The server will
be smtp.gmail.com for both.

Has anyone seen any forum posts, blogs or tutorials about this, as I really
don't know where to start with the config.
--
View this message in context: http://www.nabble.com/Multiple-GMail-Smart-Hosts-%28smarthosts%29-tp25959752p25959752.html
Sent from the Exim Users mailing list archive at Nabble.com.


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


exim-users at spodhuis

Oct 20, 2009, 1:55 AM

Post #2 of 3 (649 views)
Permalink
Re: Multiple GMail Smart Hosts (smarthosts) [In reply to]

On 2009-10-19 at 07:55 -0700, Samuurai wrote:
>
> Hi Everyone,
>
> I'm a newbie when it comes to Exim, so please go easy.
>
> I've been reading a few tutorials on how to set up multiple gmail
> smarthosts, but can't figure it out.
>
> I have two sites hosted on my server and they both need to send email. I've
> set up google apps for domains and set up a donotreply [at] domain email
> account.
>
> I've got it currently set up perfectly where all email can come out of
> domainX, but I want to make it so it reads the "From:" field then uses a
> different set of authentication credentials based on that. - The server will
> be smtp.gmail.com for both.
>
> Has anyone seen any forum posts, blogs or tutorials about this, as I really
> don't know where to start with the config.

I wrote this, which uses recipient domain instead of From: header:
http://www.mail-archive.com/exim-users [at] exim/msg29852.html

It's not much work to change it to use From: instead; where my example
uses $domain; beware that From: header can contain multiple addresses,
so you might want to define a macro, something like:

FIRST_FROM=${reduce{${addresses:$h_from:}}{}{${if eq{$value}{}{$item}{$value}}}}

Then you can use ${domain:FIRST_FROM} instead of $domain.

Or you can use the SMTP envelope sender or whatever,
$sender_address_domain. Which is somewhat simpler.

Hrm, in a follow-up I also provided a simpler way to get the first
address, so:

FIRST_FROM=${sg{${addresses:$h_From:}}{:.*}{}}

I *think* that someone then posted a little later with their working
simplification based on From: headers. I'm not going to look for it
tonight though -- this should be enough to point you in the right
direction.

-Phil

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


djberen at gmail

Oct 20, 2009, 4:17 AM

Post #3 of 3 (641 views)
Permalink
Re: Multiple GMail Smart Hosts (smarthosts) [In reply to]

Wow, this is a little daunting.

Debian has broken my configuration up into many small files and it's also
created an update-exim4.conf file. Which one should I use?

I only want absolute minimum configuration, surely I don't need this much
config. My smtp relay doesn't receive mail from anything but localhost, so I
thought the config should be fairly lightweight..?

Thanks for the reply!

2009/10/20 Phil Pennock <exim-users [at] spodhuis>

> On 2009-10-19 at 07:55 -0700, Samuurai wrote:
> >
> > Hi Everyone,
> >
> > I'm a newbie when it comes to Exim, so please go easy.
> >
> > I've been reading a few tutorials on how to set up multiple gmail
> > smarthosts, but can't figure it out.
> >
> > I have two sites hosted on my server and they both need to send email.
> I've
> > set up google apps for domains and set up a donotreply [at] domain email
> > account.
> >
> > I've got it currently set up perfectly where all email can come out of
> > domainX, but I want to make it so it reads the "From:" field then uses a
> > different set of authentication credentials based on that. - The server
> will
> > be smtp.gmail.com for both.
> >
> > Has anyone seen any forum posts, blogs or tutorials about this, as I
> really
> > don't know where to start with the config.
>
> I wrote this, which uses recipient domain instead of From: header:
> http://www.mail-archive.com/exim-users [at] exim/msg29852.html
>
> It's not much work to change it to use From: instead; where my example
> uses $domain; beware that From: header can contain multiple addresses,
> so you might want to define a macro, something like:
>
> FIRST_FROM=${reduce{${addresses:$h_from:}}{}{${if
> eq{$value}{}{$item}{$value}}}}
>
> Then you can use ${domain:FIRST_FROM} instead of $domain.
>
> Or you can use the SMTP envelope sender or whatever,
> $sender_address_domain. Which is somewhat simpler.
>
> Hrm, in a follow-up I also provided a simpler way to get the first
> address, so:
>
> FIRST_FROM=${sg{${addresses:$h_From:}}{:.*}{}}
>
> I *think* that someone then posted a little later with their working
> simplification based on From: headers. I'm not going to look for it
> tonight though -- this should be enough to point you in the right
> direction.
>
> -Phil
>
--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.