Re: [gentoo-user] Help with local mail, please

2024-02-16 Thread Peter Humphrey
On Friday, 16 February 2024 12:30:48 GMT J. Roeleveld wrote:
> On Friday, February 16, 2024 6:19:25 AM CET Peter Humphrey wrote:
> > On Wednesday, 14 February 2024 11:35:18 GMT J. Roeleveld wrote:
> > > I've been using postfix for longer than I can remember.
> > > The config entries I changed from default are:
> > > 
> > > --- main.cf ---
> > > myhostname = 
> > > mydomain = 
> > > myorigin = 
> > > mynetworks =  > > 192.168.1.0/24>
> > 
> > That's helpful - thanks Joost.
> 
> You're welcome. Was this enough to get it working?

I forgot to add that my system was already almost identical to yours, so I 
don't know whether to say yes or no.   :)

> > > smtpd_relay_restrictions = permit_mynetworks, 
permit_sasl_authenticated, reject_unauth_destination
> > 
> > No relaying here; all outgoing mail goes to my ISP.
> 
> If your mailserver (postfix) is sending emails to your ISP, that is (from
> the viewpoint of postfix) relaying by definition.

Er... outgoing mail doens't go through postfix at all; it goes direct from my 
KMail client to my ISP.

> > > Also, are all emails sent to "mydomain" or do you have additional
> > > domains configured?
> > > If the latter, did you set "virtual_alias_domains = hash:/etc/postfix/
> > > virtual_domains"
> > > Include all virtual domains the file and converted the file to a .db ?
> > 
> > Just the one "mydomain"

...so no need to set any virtual domains.

> If you have only 1 domain, keep that "virtual_alias_domains" empty.

No such setting in my main.cf so I assume it's empty.

Anyway, I looked at some of those mails that postfix was trying to forward, and 
they were old and unimportant, so I purged them.

Let's see what other problems I've made for myself...  :)

-- 
Regards,
Peter.






Re: [gentoo-user] Help with local mail, please

2024-02-16 Thread J. Roeleveld
On Friday, February 16, 2024 6:19:25 AM CET Peter Humphrey wrote:
> On Wednesday, 14 February 2024 11:35:18 GMT J. Roeleveld wrote:
> > I've been using postfix for longer than I can remember.
> > The config entries I changed from default are:
> > 
> > --- main.cf ---
> > myhostname = 
> > mydomain = 
> > myorigin = 
> > mynetworks =  > 192.168.1.0/24>
> 
> That's helpful - thanks Joost.

You're welcome. Was this enough to get it working?

> > smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated,
> > reject_unauth_destination
> 
> No relaying here; all outgoing mail goes to my ISP.

If your mailserver (postfix) is sending emails to your ISP, that is (from the 
viewpoint of postfix) relaying by definition.

> > Also, are all emails sent to "mydomain" or do you have additional domains
> > configured?
> > If the latter, did you set "virtual_alias_domains = hash:/etc/postfix/
> > virtual_domains"
> > Include all virtual domains the file and converted the file to a .db ?
> 
> Just the one "mydomain"

If you have only 1 domain, keep that "virtual_alias_domains" empty.

--
Joost





Re: [gentoo-user] Help with local mail, please

2024-02-15 Thread Peter Humphrey
On Wednesday, 14 February 2024 11:35:18 GMT J. Roeleveld wrote:

> I've been using postfix for longer than I can remember.
> The config entries I changed from default are:
> 
> --- main.cf ---
> myhostname = 
> mydomain = 
> myorigin = 
> mynetworks =  192.168.1.0/24>

That's helpful - thanks Joost.

> smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated,
> reject_unauth_destination

No relaying here; all outgoing mail goes to my ISP.

> Also, are all emails sent to "mydomain" or do you have additional domains
> configured?
> If the latter, did you set "virtual_alias_domains = hash:/etc/postfix/
> virtual_domains"
> Include all virtual domains the file and converted the file to a .db ?

Just the one "mydomain"

-- 
Regards,
Peter.






Re: [gentoo-user] Help with local mail, please

2024-02-14 Thread J. Roeleveld
On Tuesday, February 13, 2024 4:52:03 PM CET Peter Humphrey wrote:
> Hello list,
> 
> For years, I've been using postfix to accept mail from LAN hosts, and from
> the Internet via my ISP. This has never worked as I want it - it's just so
> complex to set up and understand. Well, it is for a bear of little brain
> like me.
> 
> Can someone tell me how to make postfix accept all mail addressed to any
> host or user on the LAN - and not forward any mail to anywhere at all? It's
> running on a single-homed host on the LAN, and all other hosts are also
> single homed. Any of four hosts can originate mail, and I have fetchmail
> running on the same host to collect POP3 mail from my ISP. Dovecot serves
> IMAP4 to KMail clients on the LAN.
> 
> At present, postfix is insisting on forwarding mail addressed to root on a
> LAN machine, but it's supposed to be acting on behalf of that machine. Two
> other hosts' mails never show up anywhere.
> 
> Or perhaps there's a more suitable MTA out there?

I've been using postfix for longer than I can remember.
The config entries I changed from default are:

--- main.cf ---
myhostname = 
mydomain = 
myorigin = 
mynetworks = 
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, 
reject_unauth_destination
---

Also, are all emails sent to "mydomain" or do you have additional domains 
configured?
If the latter, did you set "virtual_alias_domains = hash:/etc/postfix/
virtual_domains"
Include all virtual domains the file and converted the file to a .db ?

--
Joost





Re: [gentoo-user] Help with local mail, please

2024-02-13 Thread Arve Barsnes
On Tue, 13 Feb 2024 at 23:11, Peter Humphrey  wrote:
> On Tuesday, 13 February 2024 17:20:40 GMT Arve Barsnes wrote:
> I think those entries must be for sendmail.

Yes, that machine has sendmail from mail-mta/opensmtpd, not postfix,
not sure it matters.

> > In /etc/postfix/main.cf there is this, and I assume at least some of
> > this makes this all work:
> > myhostname = .lan
> > inet_interfaces = $myhostname, localhost
> > mydestination = $myhostname, localhost.$mydomain, localhost, 
>
> Isn't  the same as $myhostname?

No, $myhostname is .lan

Like you I've had some trouble in the past, so a lot of this is from
trying and failing, but it works as I want it now, so I'm happy-ish.

Regards,
Arve



Re: [gentoo-user] Help with local mail, please

2024-02-13 Thread Peter Humphrey
On Tuesday, 13 February 2024 17:20:40 GMT Arve Barsnes wrote:

> I'm not sure I quite understood where you're having problems, but I
> have a machine that accepts mail from the LAN through postfix, so I'll
> show some of my setup. Replace any <> with your hostnames.
> On the LAN machine I don't have postfix, I only send mail directly to
> the machine with 'sendmail', but I found that I have in
> /etc/mail/mailertable:
> 192.168. smtp:
>  esmtp:
> And in /etc/mail/local-host-names I have set  -
> maybe that does something, but I send mail directly with sendmail
> either way.

I think those entries must be for sendmail.

> On the postfix machine I have in /etc/postfix/aliases:
> root:   arve
> This should make all mail to root be delivered to me.

Yes, I have root: prh, but postfix still tries to forward mail for 
root@ to  instead of hanging on to it.

> It also contains a bunch of aliases that I'm not sure if is necessary:
> arve@ arve
> arve@.lan arve
> arve@.localdomain arve
> arve@.lan  arve

I hadn't thought of doing that. When I tried it, postfix complained "Names must 
be local" and wouldn't accept my root@ entries.

> In /etc/postfix/main.cf there is this, and I assume at least some of
> this makes this all work:
> myhostname = .lan
> inet_interfaces = $myhostname, localhost
> mydestination = $myhostname, localhost.$mydomain, localhost, 

Isn't  the same as $myhostname?

> mynetworks = 192.168.0.0/24, 127.0.0.0/8

I'll try setting mynetworks and see what happens.

Thanks, Arve.

-- 
Regards,
Peter.






Re: [gentoo-user] Help with local mail, please

2024-02-13 Thread Arve Barsnes
On Tue, 13 Feb 2024 at 16:52, Peter Humphrey  wrote:
> For years, I've been using postfix to accept mail from LAN hosts, and from the
> Internet via my ISP. This has never worked as I want it - it's just so complex
> to set up and understand. Well, it is for a bear of little brain like me.
>
> Can someone tell me how to make postfix accept all mail addressed to any host
> or user on the LAN - and not forward any mail to anywhere at all? It's running
> on a single-homed host on the LAN, and all other hosts are also single homed.
> Any of four hosts can originate mail, and I have fetchmail running on the same
> host to collect POP3 mail from my ISP. Dovecot serves IMAP4 to KMail clients
> on the LAN.
>
> At present, postfix is insisting on forwarding mail addressed to root on a LAN
> machine, but it's supposed to be acting on behalf of that machine. Two other
> hosts' mails never show up anywhere.

I'm not sure I quite understood where you're having problems, but I
have a machine that accepts mail from the LAN through postfix, so I'll
show some of my setup. Replace any <> with your hostnames.

On the LAN machine I don't have postfix, I only send mail directly to
the machine with 'sendmail', but I found that I have in
/etc/mail/mailertable:
192.168. smtp:
 esmtp:
And in /etc/mail/local-host-names I have set  -
maybe that does something, but I send mail directly with sendmail
either way.

On the postfix machine I have in /etc/postfix/aliases:
root:   arve
This should make all mail to root be delivered to me. It also contains
a bunch of aliases that I'm not sure if is necessary:
arve@ arve
arve@.lan arve
arve@.localdomain arve
arve@.lan  arve

In /etc/postfix/main.cf there is this, and I assume at least some of
this makes this all work:
myhostname = .lan
inet_interfaces = $myhostname, localhost
mydestination = $myhostname, localhost.$mydomain, localhost, 
mynetworks = 192.168.0.0/24, 127.0.0.0/8

Regards,
Arve