On Mon, 15 Jun 2020 08:24:10 +0200 Per Jessen <per@computer.org> wrote:
Dave Howorth wrote:
Thanks for the reply. After my last message, I discovered that the setting should be in main.cf rather than master.cf so I did that and restarted postfix. After that I can see in /var/log/mail that it is getting a connection from the other host, but there's no mail for the user:
Can't get the log to format (it's too late :) - I've attached a copy that's hopefully OK.
2020-06-14T23:26:15.486595+01:00 acer-suse postfix/smtpd[1627]: connect from emonpi.fritz.box[192.168.1.24] 2020-06-14T23:26:15.486949+01:00 acer-suse postfix/smtpd[1627]: improper command pipelining after HELO from emonpi.fritz.box[192.168.1.24]: MAIL FROM: emonpi@emonpi.fritz.box\nRCPT TO: emoncms@acer-suse.fritz.box\nDATA\nDoes this work?\n.\n
This is postfix choking on your data from the Raspi. Normally the SMTP setup is an exchange of commands and replies, not just a stream of commands.
Maybe try with "EHLO raspi" instead of just "HELO". I think that might enable the pipelining. (yes, EHLO, not HELO).
Using EHLO instead doesn't seem to make any difference. Neither does typing the commands one at a time instead of via <<EOF. Maybe I actually need a two-way connection? In which case this simple approach doesn't seem likely to fly? Bengt?
2020-06-14T23:26:15.526135+01:00 acer-suse postfix/smtpd[1627]: disconnect from emonpi.fritz.box[192.168.1.24] helo=0/1 mail=1 rcpt=1 data=1 commands=3/4
Okay, looks like you still got a message delivered.
2020-06-14T23:26:15.570440+01:00 acer-suse postfix/smtp[1618]: 77DE576D9: to=<emoncms@acer-suse.fritz.box>, relay=none, delay=0.04, delays=0.04/0/0/0, dsn=5.4.6, status=bounced (mail for acer-suse.fritz.box loops back to myself)
Question - do you have an already working postfix setup on this machine? The above suggests 'not quite'. The machine should at least be prepared to receive mails for acer-suse.fritz.box. (or @fritz.box).
Exactly so. I installed postfix on the pi early on but haven't configured it or removed it yet. Ahah! The key is the "mail for acer-suse.fritz.box loops back to myself" bit. Google tells me I need to add acer-suse.fritz.box to mydestination in main.cf and having done that it works!
2020-06-14T23:26:15.581894+01:00 acer-suse postfix/bounce[1630]: 77DE576D9: sender non-delivery notification: 8B53176DB 2020-06-14T23:26:15.625961+01:00 acer-suse postfix/smtp[1619]: 8B53176DB: to=<emonpi@emonpi.fritz.box>, relay=emonpi.fritz.box[192.168.1.24]:25, delay=0.06, delays=0.01/0/0.01/0.04, dsn=4.7.1, status=deferred (host emonpi.fritz.box[192.168.1.24] said: 454 4.7.1 <emonpi@emonpi.fritz.box>: Relay access denied (in reply to RCPT TO command))
The above is the non-delivery message bouncing - 192.168.1.24 is your Raspi, right? something is listening on port 25 - something that speaks SMTP and sends proper error codes.
BTW is there any way to tell postfix to only accept mail from other machines on my LAN? (or even specific machines on my LAN?)
Yes, you can tell postfix to only accept mails for '@fritz.box', and not to do any relaying. You can also tell it which network is trusted (192.168.1.0/24 I presume). The default openSUSE setup already does this.
If you will be using 'fritz.box' as your local domain, and send mails from e.g. 'emonpi@fritz.box' to 'emoncms@fritz.box', on your 'acer-suse' machines, I would add this to /etc/postfix/main.cf :
mydestination=fritz.box
Hmm, just fritz.box didn't work but acer-suse.fritz.box did. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org