Hello,
i would like to ask for help with possibly a bug we encountered on PMG. We have a two node cluster of gateways and we are using it to filter the incoming mail. There is a list of aprox 100 domains we accept in "Mail Proxy - Relay domains" and destinations in "Mail Proxy - Transports".
While testing we did not encounter any problem with this setup and setting through GUI:
Relay domain: domain.tld
Host: imap.foo.bar
Protocol: smtp
Port: 25
Use MX: no
When adding the transport through API by calling:
curl --location 'https://pmg.foo.bar:8006/api2/json/config/transport' \
--header 'CSRFPreventionToken: REDACTED' \
--header 'Content-Type: application/json' \
--header 'Cookie: PMGAuthCookie=REDACTED \
--data '{
"domain":"domain.tld",
"comment" : "Added: 1.1.2023",
"host" : "imap.foo.bar",
"port" : 25,
"protocol" : "smtp",
"use_mx" : false
}'
the record gets added and can be seen in PMG gui on both gateways, but when someone sends an email to the domain.tld the mail is processed incorectly and ends on:
The problem is that the GW tries to deliver the email localy instead of relaying it to the server imap.foo.bar.
This error persists for days. After adding any other record to the Mail Proxy - Transports setting or reloading postfix, the emails are delivered correctly to imap.foo.bar
gw1 postfix/smtp[2487449]: 81A4A1240BC: to=<info@domain.tld>, relay=imap.foo.bar[REDACTED]:25, delay=0.08, delays=0.01/0/0.04/0.03, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 9396E20079)
Is there any bug or difference between adding the record in GUI or API?
Thank you for your help.
i would like to ask for help with possibly a bug we encountered on PMG. We have a two node cluster of gateways and we are using it to filter the incoming mail. There is a list of aprox 100 domains we accept in "Mail Proxy - Relay domains" and destinations in "Mail Proxy - Transports".
While testing we did not encounter any problem with this setup and setting through GUI:
Relay domain: domain.tld
Host: imap.foo.bar
Protocol: smtp
Port: 25
Use MX: no
When adding the transport through API by calling:
curl --location 'https://pmg.foo.bar:8006/api2/json/config/transport' \
--header 'CSRFPreventionToken: REDACTED' \
--header 'Content-Type: application/json' \
--header 'Cookie: PMGAuthCookie=REDACTED \
--data '{
"domain":"domain.tld",
"comment" : "Added: 1.1.2023",
"host" : "imap.foo.bar",
"port" : 25,
"protocol" : "smtp",
"use_mx" : false
}'
the record gets added and can be seen in PMG gui on both gateways, but when someone sends an email to the domain.tld the mail is processed incorectly and ends on:
May 29 09:57:40 gw1 postfix/smtpd[2485533]: connect from mail-pj1-x1036.google.com[2607:f8b0:4864:20::1036] May 29 09:57:41 gw1 postfix/smtpd[2485533]: NOQUEUE: client=mail-pj1-x1036.google.com[2607:f8b0:4864:20::1036] May 29 09:57:41 gw1 pmg-smtp-filter[2486489]: 141C0464745AF5D658A: new mail message-id=<CAJNjfQ=jOSTLkQJWDumZF3twocJ-cWFRk9RNvRLExeFbDQWLDA@mail.gmail.com>#012 May 29 09:57:42 gw1 pmg-smtp-filter[2486489]: 141C0464745AF5D658A: SA score=0/5 time=0.889 bayes=0.00 autolearn=ham autolearn_force=no hits=AWL(0.452),BAYES_00(-1.9),DKIM_SIGNED(0.1),DKIM_VALID(-0.1),DKIM_VALID_AU(-0.1),DKIM_VALID_EF(-0.1),FREEMAIL_FROM(0.001),HTML_MESSAGE(0.001),RCVD_IN_DNSWL_NONE(-0.0001),SPF_HELO_NONE(0.001),SPF_PASS(-0.001),T_SCC_BODY_TEXT_LINE(-0.01) May 29 09:57:42 gw1 postfix/smtpd[2486304]: connect from localhost.localdomain[127.0.0.1] May 29 09:57:42 gw1 postfix/smtpd[2486304]: CA4171240BC: client=localhost.localdomain[127.0.0.1], orig_client=mail-pj1-x1036.google.com[2607:f8b0:4864:20::1036] May 29 09:57:42 gw1 postfix/cleanup[2486493]: CA4171240BC: message-id=<CAJNjfQ=jOSTLkQJWDumZF3twocJ-cWFRk9RNvRLExeFbDQWLDA@mail.gmail.com> May 29 09:57:42 gw1 postfix/qmgr[2320443]: CA4171240BC: from=<REDACTED@gmail.com>, size=4111, nrcpt=1 (queue active) May 29 09:57:42 gw1 postfix/smtpd[2486304]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 xforward=1 mail=1 rcpt=1 data=1 commands=5 May 29 09:57:42 gw1 pmg-smtp-filter[2486489]: 141C0464745AF5D658A: accept mail to <info@domain.tld> (CA4171240BC) (rule: default-accept) May 29 09:57:42 gw1 pmg-smtp-filter[2486489]: 141C0464745AF5D658A: processing time: 0.957 seconds (0.889, 0.039, 0) May 29 09:57:42 gw1 postfix/smtpd[2485533]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (141C0464745AF5D658A); from=<REDACTED@gmail.com> to=<info@domain.tld> proto=ESMTP helo=<mail-pj1-x1036.google.com> May 29 09:57:42 gw1 postfix/local[2486555]: CA4171240BC: to=<info@domain.tld>, relay=local, delay=0.05, delays=0.01/0.02/0/0.02, dsn=5.1.1, status=bounced (unknown user: "info") May 29 09:57:42 gw1 postfix/qmgr[2320443]: CA4171240BC: removed May 29 09:58:13 gw1 postfix/smtpd[2485533]: disconnect from mail-pj1-x1036.google.com[2607:f8b0:4864:20::1036] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7 |
The problem is that the GW tries to deliver the email localy instead of relaying it to the server imap.foo.bar.
This error persists for days. After adding any other record to the Mail Proxy - Transports setting or reloading postfix, the emails are delivered correctly to imap.foo.bar
gw1 postfix/smtp[2487449]: 81A4A1240BC: to=<info@domain.tld>, relay=imap.foo.bar[REDACTED]:25, delay=0.08, delays=0.01/0/0.04/0.03, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 9396E20079)
Is there any bug or difference between adding the record in GUI or API?
Thank you for your help.