after this should be enough to restart postfix. The postfix docs tend to explain this strategy: Postfix Address Rewriting
That’s obviously for sending emails, for receiving, then you use the appropriate canonical option in the docs (recipient_canonical_maps)
Your error:
means you have two entries of inet_interfaces in main.cf so remove the duplicate and incorrect one. inet_interfaces should not be $myhostname or anything like that, if you are unsure just put:
inet_interfaces = all
but I would check both entries that you have, since first there should only be one, and secondly, it should be configured properly.
You create a file called sender_canonical like I mentioned in my previous post, and inside that file you put the information in the format I suggested. The same as when you created the /etc/postfix/generic file.
sender@office.mydomain.com sender@mydomain.com
the first address being the one that you want to change, and the second one being the one you want to change it to.
Return-path: <myname@myDomain>
Received: from tspf1.office.myDomain ([192.168.0.205])
by TSGW1.office.myDomain with ESMTP; Sun, 14 Aug 2022 19:02:51 +0200
Message-ID: <77a9c35cab5066e529eddc9baa177ec8b3a74786.camel@myDomain>
Subject: Test Postfix Masquerading
From: Henry Martin <myname@myDomain>
Reply-To: myname@myDomain
To: myname@myDomain
Date: Sun, 14 Aug 2022 19:02:50 +0200
Organization: My Organization
Content-Type: text/plain
X-Mailer: Evolution 3.28.5 (3.28.5-18.el8)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
So this is the problem. Either your ISP is blocking this machine from sending SMTP emails, or you have postfix incorrectly configured. You would need to post the entire main.cf and master.cf from the /etc/postfix directory for anyone to actually know what changes you have made, and whether they are incorrect or not. Please copy and paste that here. Please do not post as a screenshot. Best is to copy/paste the text.
And please post properly using the appropriate formatting tools that this forum allows, because posting text without formatting in code blocks means we cannot read it properly. I have edited your post above to give you an example of how to do this.
Nothing stands out in the configuration as being problematic. Usually though you would need a DNS A record for tspf1.office.myDomain.com. as the unable to relay, assuming that mydomain.com is your normal Groupwise server could be the server rejecting the email, or as mentioned before, it could be your ISP not allowing you to send SMTP port 25 from that particular server that you have created.
Ah, that may be the problem. I haven’t created a public DNS record for it, only an internal private one. I didn’t want to make it public until it was working. Could this be the problem?
Difficult to say. The only information I can go on is what you posted which was unable to relay.
So either this means it’s because your mail server rejected it because it doesn’t have an SMTP entry, or your mail server doesn’t allow relay for your internal network, so according to postfix that mail server would need to allow: 192.168.0.0/24 assuming of course that is your internal network. But you haven’t provided enough information for us to know whether this is the case or not. Another option for unable to relay is that it is caused by the ISP - you say that this is not the case, so then it doesn’t leave many other options other than what I have written so far.
So in summary, your main mail server doesn’t want to accept email from postfix because of missing DNS A record, or that postfix is unable to communicate with your main mail server, either because the port is blocked, or because it doesn’t allow relaying from your internal network.
Unfortunately it will be impossible to help further with this problem because it means you need to paste the full logs showing the email delivery failure from the postfix side, as well as from the Groupwise Mail server. And you need to paste it without redacting too much information, because when it is heavily redacted, then it’s impossible to know what was sent from where and what to. Therefore, I suggest you take a look at the logs, and take into account what I’ve posted, that should give you an idea of what you need to unblock/configure to allow it to work.
NO, my mail server does not reject I had mail going through to Proton mail fro this server when I was using the generic, but it always arrived from tspf1.office.myDomain.com and NOT as tspf1.myDomain,com, so even though it was coming from the wrong network, it was accepted.
Tomorrow, I’ll go back to the generic as I managed to get it to work and post a complete accepted mail, and the maillog
My bedtime
Could you run “postconf -v | grep -i restriction” from your Postfix server as well. And add in here
Didn’t see any statement of “smtpd_client_restrictions” nor “smtpd_sender_restrictions”
(Also, might be good to have the full output from ‘postconf -v’)
Might be so that Postfix now a days have those set by default, but I am always adding “permit_mynetworks” to both of them in Postfix, and then make sure that all my client IP networks are fully defined in “mynetworks”
I think the “unable to relay” message are in fact a message from your Postfix server
Btw, your mail client are on IP net 192.168.0.0/24?
I have this in most of my Postfix installations
smtpd_client_restrictions = permit_mynetworks
(I do have a few more restrictions as well, but this gives at least my clients access to use Postfix as an internal “Relayer”)
As for sender (recipient are local) I do have this at my outer Postfix as well.
smtpd_sender_restrictions = regexp:/etc/postfix/forbid_from, permit_mynetworks, reject_unknown_sender_domain, reject_rhsbl_sender zen.spamhaus.org
And mynetworks are defined as:
mynetworks = 192.168.1.0/24, 192.168.2.0/24, 192.168.3.0/24
This will allow those networks to per definition use my Postfix as an SMTP relayer
smtd_sender_restrictions, are just to block a few SMTP senders that I do not trust, and allow those I really trust. You could at this point leave it blank as you already do have
In main.cf file, i.e. same file as you do have your “mynetworks” statement
Put it last in your main.cf file, or make sure that you do not have a conflicting statement. Hence the “postconf -v” which will always show you the correct configured values.