LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Changing headers to ALL outgoing mails (https://www.linuxquestions.org/questions/linux-server-73/changing-headers-to-all-outgoing-mails-4175512163/)

linoskoczek 07-24-2014 12:55 PM

Changing headers to ALL outgoing mails
 
Hi!

I've got a service which makes e-mail aliases. It works in that way:

joseph@gmail.com sends e-mail to george@mysite.com
george@mysite.com is an alias to george@gmail.com so george@gmail.com receives an e-mail

Other example:
joseph@mail.com -> george@mysite.com -> george@mail.com

The problem starts when joseph@mail.com sends e-mail to george@mysite.com. joseph@mail.com receives error message with an error:
Quote:

[...]
Action: failed
Status: 5.0.0
Remote-MTA: dns; mxx.xxx.xxx
Diagnostic-Code: smtp; 550 Bad SPF records for [xxx.xxx:11.11.11.11], see
http://spf.pobox.com/
So I think I need to change header of every outcoming mail from mysite.com, so it would look like mysite.com sends all the messages. I've got postfix. How could I do it? I was reading a bit about header_checks, but I don't really know how to use it. I would also like to edit body of the message a bit to say "e-mail aliased by mysite.com blablabla".

I hope you will find a solution for me,
linoskoczek

vishesh 07-25-2014 06:53 AM

I think you should do some sort of address rewriting http://www.postfix.org/ADDRESS_REWRITING_README.html

Thanks

YankeePride13 07-25-2014 02:35 PM

I'm not 100% sure, but I think the error you're seeing means that mysite.com won't accept e-mail from any domain that doesn't have an SPF record set up. In order to fix that, the DNS admin for mail.com would have to create an SPF record.

linoskoczek 07-25-2014 02:42 PM

Quote:

Originally Posted by vishesh (Post 5209403)
I think you should do some sort of address rewriting http://www.postfix.org/ADDRESS_REWRITING_README.html

Thanks

Thank you for your answer.

I've already done it with header_checks.

To /etc/postfix/main.cf I've added:
Code:

header_checks = regexp:/etc/postfix/header_checks
I made a file /etc/postfix/header_checks and added that:
Code:

/^From: .+/ REPLACE From: mymail@mysite.com
It works, but it isn't solution for my problem.

Quote:

Originally Posted by YankeePride13 (Post 5209609)
I'm not 100% sure, but I think the error you're seeing means that mysite.com won't accept e-mail from any domain that doesn't have an SPF record set up. In order to fix that, the DNS admin for mail.com would have to create an SPF record.

Thank you for your answer.

Hmm, I didn't even think about it, but it may be easy solution. I need to check it now!


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