Code Monkey home page Code Monkey logo

Comments (7)

bjoe2k4 avatar bjoe2k4 commented on May 30, 2024

postfix sender_canonical_classes option is your friend. Actually if you stick to the postsrsd recommended settings (see README) then this should not happen.

from postsrsd.

shashisingh avatar shashisingh commented on May 30, 2024

I have set sender_canonical_classes to "envelope_sender" as described in the README. It is my understanding that this setting should imply that only envelope header (i.e. MAIL FROM:, RCTP TO: etc.) will be replaced and header_sender (From:, To: in MIME body) will not be replaced. But still I see this issue. I am running postfix 2.11.0 on Ubuntu.

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 30, 2024

What do the logs say?

from postsrsd.

bkuhn avatar bkuhn commented on May 30, 2024

I have sender_canonical_classes properly configured. I can produce this problem in the following way:
with the configuration as the README suggests, send an email with no From: header in it, and set your envelope information to a domain handled as a virtual_alias_domains (i.e., not the primary domain of the mail server).

I find that the SRS-formatted envelope sender in this case ends up in the From:

I suppose this can't be prevented, and really you should be submitting outgoing mail with a From: header in place, but I've been unable to find the setting in Postfix which decides what to add into the From, but whatever it is, it's using the SRS rewritten information when postsrsd is activated, and DTRT (uses [email protected]) when postsrsd is deactivated.

If this is a bug, I think the primary needed action is to add an explanation of how to handle virtual_alias_domains and empty From: headers in the docs.

from postsrsd.

roehling avatar roehling commented on May 30, 2024

The missing header is added by the Postfix cleanup daemon (see the manual page), after it has consulted the canonical_* maps, that's why the rewritten address ends up in the From: header.

from postsrsd.

romuloceccon avatar romuloceccon commented on May 30, 2024

The correct solution is to always set the "From:"-header, but sometimes it's not possible to control that, and using SRS-remapping just makes things worse. One such example are mails sent from Ubuntu's unattended upgrades system. A possible workaround is to use Postfix's header checks:

/etc/postfix/main.cf:
    smtp_header_checks = pcre:/etc/postfix/header_checks

/etc/postfix/header_checks:
    /^From:[[:space:]]*SRS0[[:print:]]*=([[:print:]]+?)=([[:print:]]+?)@[[:print:]]*?[[:space:]]*$/ REPLACE From: ${2}@${1}

from postsrsd.

roehling avatar roehling commented on May 30, 2024

Closing this issue, since it seems to be stale. Feel free to reopen.

from postsrsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.