LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   prevent procmail from adding Return-path (https://www.linuxquestions.org/questions/linux-newbie-8/prevent-procmail-from-adding-return-path-4175735775/)

mike1950r 04-07-2024 10:18 AM

prevent procmail from adding Return-path
 
Hi,

I'm forwarding mails as a copy to another domain.

Sometimes I get an error message saying:

Mail rejected. DMARC check failed. OFR_515
[515] (in reply to end of DATA command)

I could imagine, that this is because procmail changes the return-path original to my server send path.
And dkim entry in the original mail is made for the original sender.

So I think if it would make sense to keep the original return-path in the forwarded mail.

How could I do this?

The forwarding code follows:

Code:

:0 c
* (^TO_|for.*)mail@mydomain.com
* !^X-Loop: mail@mydomain.com
* !^From mail@otherdomain.com
{
        :0 hfw
        * ^Subject:\/.+
        | formail -I "Subject: FORWARDED:$MATCH"
        :0 a
        ! mail@otherdomain.com
}

Thanks in advance for any tip.

Cheers mike

business_kid 04-08-2024 09:27 AM

Do you really want to inform the sender that your relaying attempt failed? Surely, that's something for you to sort out, not him.

mike1950r 04-08-2024 09:49 AM

Quote:

Originally Posted by business_kid (Post 6494856)
Do you really want to inform the sender that your relaying attempt failed? Surely, that's something for you to sort out, not him.

thanks for your response.

i just want to get the forwarded email accepted and not refused.
i do not know why these certain mails from a bank are refused, when beeing forwarded by my server.

other users of procmail also complain, that procmail changes the return-path.
i want to forward the email like it is, just with an additional mark in the subject.
i thought this could be perhaps the reason. my server does not add a dkim when forwarding emails from other domains.
so the dkim of the original domain seems to be the problem.

anyway it was a try.

cheers mike

business_kid 04-08-2024 11:33 AM

It's been decades since I messed with procmail, but ISTR it was entirely set up by the config file and the delivery recipe. I'd Google for similar issues or post the configs here (relevant portions).

To judge by the deathly quiet on this, either everyone has moved over to another MDA or to another method altogether. I never use smtp anymore myself, but webmail.

scasey 04-08-2024 12:25 PM

Or. Adjust the DMARC validation on otherdomain.com to allow the copied messages.

Does it work when you forward manually?

mike1950r 04-08-2024 12:36 PM

Quote:

Originally Posted by scasey (Post 6494879)
Or. Adjust the DMARC validation on otherdomain.com to allow the copied messages.

Does it work when you forward manually?

Hi,

thanks for the input.
Manually forwarding causes same problem.

May be removing the dkim entry from the originally message could be a solution.
If the is no dkim inside, no dkim verification would be done, perhaps nomore error messages?

Sure the problem is at the recipient side.
Other users of this domain complain, that some emails do not arrive, with same error report like posted above.
So the forwarding is not the problem.

Sounds tricky ...

Thanks anyway.

Cheers mike

mike1950r 05-05-2024 06:14 AM

Hi again,

found the solution with the help of other forum.
just wanted to input this here for others with same problem:

:0 c
* (^TO_|X-Original-To:.*)me@mydomain\.com
* ^From:\/.+
{
FROM=$MATCH
:0 hfw
* ^Subject:\/.+
| formail -I "Subject: FORWARDED:$MATCH" -I "X-Original-From:$FROM" -I "From: noreply <me@mydomain.com>"
:0 a
! me@otherdomain.com
}

Cheers mike


All times are GMT -5. The time now is 07:07 PM.