-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple .forward aliases sometimes give pysrs the wrong destination domain. #7
Comments
pysrs operates on MAIL FROM. RCPT TO doesn't come into the picture, and hasn't even been seen yet when your logs are output. The default pysrs.cfg has comments that hopefully describe how to control MAIL FROM rewriting. In trying to guess what you were thinking, I considered that perhaps you were hoping there was a way to configure MAIL FROM rewriting based on RCPT TO. srsmilter knows the recipients, but has a different problem, as noted in the comments:
|
I suggest you describe what you are trying to do on the [email protected] mailing list, and we can give some suggestions. |
I think I have some more time to work on this now. I think I abstracted my problem description too much here initially. My main problem is what happens when my mail server receives a message with both local and remote recipients. In that case, sometimes PySRS does not rewrite the envelope-from address, which causes problems when sendmail forwards the message. More concretely, let's say a message comes in to my server. Let's say it's I'm using
If I understand that correctly, it first takes the envelope-from address and prepends the I can see in the PySRS log the requests that are made of it. With the above example, sometimes I see this:
and sometimes I see this:
I believe what's happening is that the Does that make my problem any clearer? |
I worked around the problem by just removing the |
I will try your tweak to see if anything breaks. So you have local mailboxes on the same mailserver that forwards outgoing mail? That would explain why I haven't seen the problem. I always have a separate "mail gateway" VM that doesn't deliver anything locally (except root notifications). |
I think that with your tweak, you will still have the problem if one of the alias recipient domains is in nosrsdomain. Sendmail is kind enough to run the ruleset for every RCPT TO, but apparently not for every recipient generated by aliasing. |
If a person has a .forward file in their home directory and that .forward file contains multiple email addresses with different domains, pysrs will sometimes get the domains mixed up.
e.g. if the .forward file contains this:
Sometimes the SRS address for the email sent to [email protected] will use the hash for [email protected].
This is particularly problematic when one of the addresses is local, e.g.
\person, [email protected]
In that case, sometimes the email to [email protected] doesn't have a destination domain, so pysrs simply doesn't do SRS on the address. (And that, of course, causes problem if the destination domain does SPF checking.)
Sometimes things do work, but sometimes they don't. If I understand the process correctly (and this is the first time I've delved past sendmail.mc into sendmail.cf rules), I suspect that the order in which sendmail is running the EnvFromSMTP ruleset and ruleset zero is non-deterministic. I'm hoping you have a deeper understanding of this level of communication, though.
I'm running pysrs on Scientific Linux 6 (a RHEL 6 clone).
/wtc/mail/sendmail.cf
contains (excerpted):Here's an excerpt from pysrs.log, with domains sanitized:
Although the .forward file for the account on "forwarder.com" contained two email addresses with different domains, only one domain was used for both message forwards.
The text was updated successfully, but these errors were encountered: