How to keep several Postfix installations in step with each other?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How to keep several Postfix installations in step with each other?

Chris Green-11
I run postfix on my main desktop machine both for sending mail (via my
hosting provider 'smarthost') and for receiving mail.

I want to use postfix to provide /usr/bin/sendmail on a laptop and
some other machines.  These machines won't be receiving E-Mail.

I've considered the 'send only' programs such as esmtp and msmtp but
having to maintain *different* configurations is a downside with these
and I'm already (fairly) familiar with postfix.

So, is there an easy way to copy my existing postfix configuration
(in /etc/postfix) to other machines?  What actually needs to be
different on each machine for it to work?  Does *anything* need to be
different?

--
Chris Green
Reply | Threaded
Open this post in threaded view
|

Re: How to keep several Postfix installations in step with each other?

Julian Kippels
Am Sun, 6 Dec 2020 15:10:12 +0000
schrieb Chris Green <[hidden email]>:

> I run postfix on my main desktop machine both for sending mail (via my
> hosting provider 'smarthost') and for receiving mail.
>
> I want to use postfix to provide /usr/bin/sendmail on a laptop and
> some other machines.  These machines won't be receiving E-Mail.
>
> I've considered the 'send only' programs such as esmtp and msmtp but
> having to maintain *different* configurations is a downside with these
> and I'm already (fairly) familiar with postfix.
>
> So, is there an easy way to copy my existing postfix configuration
> (in /etc/postfix) to other machines?  What actually needs to be
> different on each machine for it to work?  Does *anything* need to be
> different?
>

Might be a bit overkill for your use case, but I'd have a look at
keeping your configuration(s) in sync using Ansible or something
similar.

--
---------------------------------------------------------
| | Julian Kippels
| | M.Sc. Informatik
| |
| | Zentrum für Informations- und Medientechnologie
| | Heinrich-Heine-Universität Düsseldorf
| | Universitätsstr. 1
| | Raum 25.41.O1.32
| | 40225 Düsseldorf / Germany
| |
| | Tel: +49-211-81-14920
| | mail: [hidden email]
---------------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: How to keep several Postfix installations in step with each other?

Chris Green-11
On Sun, Dec 06, 2020 at 04:18:13PM +0100, Julian Kippels wrote:

> Am Sun, 6 Dec 2020 15:10:12 +0000
> schrieb Chris Green <[hidden email]>:
>
> > I run postfix on my main desktop machine both for sending mail (via my
> > hosting provider 'smarthost') and for receiving mail.
> >
> > I want to use postfix to provide /usr/bin/sendmail on a laptop and
> > some other machines.  These machines won't be receiving E-Mail.
> >
> > I've considered the 'send only' programs such as esmtp and msmtp but
> > having to maintain *different* configurations is a downside with these
> > and I'm already (fairly) familiar with postfix.
> >
> > So, is there an easy way to copy my existing postfix configuration
> > (in /etc/postfix) to other machines?  What actually needs to be
> > different on each machine for it to work?  Does *anything* need to be
> > different?
> >
>
> Might be a bit overkill for your use case, but I'd have a look at
> keeping your configuration(s) in sync using Ansible or something
> similar.
>
Yes, but I still need to know which bits are the same on all systems
and which bits are different don't I?

--
Chris Green
Reply | Threaded
Open this post in threaded view
|

Re: How to keep several Postfix installations in step with each other?

PGNet Dev
fyi,

http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client

"A null client is a machine that can only send mail. It receives no mail from the network, and it does not deliver any mail locally. A null client typically uses POP, IMAP or NFS for mailbox access."
Reply | Threaded
Open this post in threaded view
|

Re: How to keep several Postfix installations in step with each other?

Jeff Abrahamson
In reply to this post by Chris Green-11
On 06/12/2020 16:44, Chris Green wrote:

> On Sun, Dec 06, 2020 at 04:18:13PM +0100, Julian Kippels wrote:
>> Am Sun, 6 Dec 2020 15:10:12 +0000
>> schrieb Chris Green <[hidden email]>:
>>
>>> I run postfix on my main desktop machine both for sending mail (via my
>>> hosting provider 'smarthost') and for receiving mail.
>>>
>>> I want to use postfix to provide /usr/bin/sendmail on a laptop and
>>> some other machines.  These machines won't be receiving E-Mail.
>>>
>>> I've considered the 'send only' programs such as esmtp and msmtp but
>>> having to maintain *different* configurations is a downside with these
>>> and I'm already (fairly) familiar with postfix.
>>>
>>> So, is there an easy way to copy my existing postfix configuration
>>> (in /etc/postfix) to other machines?  What actually needs to be
>>> different on each machine for it to work?  Does *anything* need to be
>>> different?
>>>
>> Might be a bit overkill for your use case, but I'd have a look at
>> keeping your configuration(s) in sync using Ansible or something
>> similar.
>>
> Yes, but I still need to know which bits are the same on all systems
> and which bits are different don't I?

Seconded on using a config management package.  Saltstack is a good
choice, too.  (Your case is simple enough, though, that shell scripts
that copy from a private git repo is also reasonable.  That avoids the
learning curve of something like salt/ansible/puppet/etc.)

You have one config (on your desktop) that receives and passes to an MDA
and that also sends to a smarthost.
You have on config (maybe on multiple machines) that sends to a
smarthost but doesn't receive, not even if you cc yourself.

So I'd start by copying your config to your laptop, then just ask
yourself what you need to change so that mail to "local" users is sent
to the smarthost.  Once mail to yourself goes to smarthost, you're
probably almost there.

--
Jeff Abrahamson
+33 6 24 40 01 57
+44 7920 594 255

http://p27.eu/jeff/
http://transport-nantes.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to keep several Postfix installations in step with each other?

Chris Green-11
On Sun, Dec 06, 2020 at 05:24:39PM +0100, Jeff Abrahamson wrote:
> On 06/12/2020 16:44, Chris Green wrote:
> > On Sun, Dec 06, 2020 at 04:18:13PM +0100, Julian Kippels wrote:
> >> Am Sun, 6 Dec 2020 15:10:12 +0000
> >> schrieb Chris Green <[hidden email]>:
[snip]

> >> Might be a bit overkill for your use case, but I'd have a look at
> >> keeping your configuration(s) in sync using Ansible or something
> >> similar.
> >>
> > Yes, but I still need to know which bits are the same on all systems
> > and which bits are different don't I?
>
> Seconded on using a config management package.  Saltstack is a good
> choice, too.  (Your case is simple enough, though, that shell scripts
> that copy from a private git repo is also reasonable.  That avoids the
> learning curve of something like salt/ansible/puppet/etc.)
>
OP here, I use mercurial rather than git but the point stands.


> You have one config (on your desktop) that receives and passes to an MDA
> and that also sends to a smarthost.
> You have one config (maybe on multiple machines) that sends to a
> smarthost but doesn't receive, not even if you cc yourself.
>
Exactly! :-)


> So I'd start by copying your config to your laptop, then just ask
> yourself what you need to change so that mail to "local" users is sent
> to the smarthost.  Once mail to yourself goes to smarthost, you're
> probably almost there.
>
Yes, and then I guess the laptop's configuration should work for the
others without any change.

Thanks.

--
Chris Green
Reply | Threaded
Open this post in threaded view
|

Re: How to keep several Postfix installations in step with each other?

Wietse Venema
In reply to this post by Chris Green-11
Chris Green:

> I run postfix on my main desktop machine both for sending mail (via my
> hosting provider 'smarthost') and for receiving mail.
>
> I want to use postfix to provide /usr/bin/sendmail on a laptop and
> some other machines.  These machines won't be receiving E-Mail.
>
> I've considered the 'send only' programs such as esmtp and msmtp but
> having to maintain *different* configurations is a downside with these
> and I'm already (fairly) familiar with postfix.
>
> So, is there an easy way to copy my existing postfix configuration
> (in /etc/postfix) to other machines?  What actually needs to be
> different on each machine for it to work?  Does *anything* need to be
> different?

Non-MTA machines can have identical configuration. You need a
relayhost:

    # [] to disable MX record lookups
    relayhost = [smtp.example.com]

And presumably, SASL configuration:

    smtp_sasl_password_maps = map with plaintext passwords
    smtp_tls_security_level = may
    smtp_sasl_auth_enable = yes
    smtp_sasl_tls_security_options = noanonymous

And this will almost never need to be updated.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: How to keep several Postfix installations in step with each other?

Chris Green-11
On Sun, Dec 06, 2020 at 12:09:06PM -0500, Wietse Venema wrote:

> Chris Green:
> > I run postfix on my main desktop machine both for sending mail (via my
> > hosting provider 'smarthost') and for receiving mail.
> >
> > I want to use postfix to provide /usr/bin/sendmail on a laptop and
> > some other machines.  These machines won't be receiving E-Mail.
> >
> > I've considered the 'send only' programs such as esmtp and msmtp but
> > having to maintain *different* configurations is a downside with these
> > and I'm already (fairly) familiar with postfix.
> >
> > So, is there an easy way to copy my existing postfix configuration
> > (in /etc/postfix) to other machines?  What actually needs to be
> > different on each machine for it to work?  Does *anything* need to be
> > different?
>
> Non-MTA machines can have identical configuration. You need a
> relayhost:
>
>     # [] to disable MX record lookups
>     relayhost = [smtp.example.com]
>
> And presumably, SASL configuration:
>
>     smtp_sasl_password_maps = map with plaintext passwords
>     smtp_tls_security_level = may
>     smtp_sasl_auth_enable = yes
>     smtp_sasl_tls_security_options = noanonymous
>
> And this will almost never need to be updated.
>
Excellent, thank you Wietse, I think you have set me on my way.

--
Chris Green