• Re: How to know local IP on which mail was received on

    From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to AMM on Wed Dec 11 01:31:39 2024
    AMM wrote:

    How do I know if email came on 1.2.3.4 (eth1) or 5.6.7.8 (eth2)?

    What do you currently use for DaemonPortOptions?

    you could use multiple DaemonPortOptions and specify
    Name User-definable name for the daemon (defaults to "Daemon#")
    Addr Address mask (defaults INADDR_ANY)

    see doc/op/op.*

    Or you could add some custom log entry via a ruleset
    using the syslog map and log
    ${daemon_addr}
    The IP address the daemon is listening on for connections.
    together with the queue id.

    --
    Note: please read the netiquette before posting. I will almost never
    reply to top-postings which include a full copy of the previous
    article(s) at the end because it's annoying, shows that the poster
    is too lazy to trim his article, and it's wasting the time of all readers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to AMM on Wed Dec 11 14:45:05 2024
    AMM wrote:

    Or you could add some custom log entry via a ruleset

    Can you provide more help with this? I could not find much help in doc/op/op.*

    "It's complicated" - you could do some online search for this.
    Here's something completely untested:
    Klog syslog
    SLocal_check_relay
    R$+ $| $+ $: $(log daemon_addr=$&{daemon_addr} $)

    I would like change log entry at two places in syslog (systemd journal)

    Logging from the binary would need code changes.

    Can this be made the default in future versions of sendmail, as in my
    opinion it is an important piece of information to detect connection issues.

    The simplest approach is to use multiple DaemonPortOptions,
    anything else is (significantly) more complicated.
    It shouldn't be hard to write a script which takes the local
    network configuration and creates the proper mc entries.

    OR can the logging be made easier without touching / modifying ruleset?

    No - see above: code or ruleset.

    --
    Note: please read the netiquette before posting. I will almost never
    reply to top-postings which include a full copy of the previous
    article(s) at the end because it's annoying, shows that the poster
    is too lazy to trim his article, and it's wasting the time of all readers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Taylor@21:1/5 to All on Wed Dec 11 21:13:47 2024
    On 12/11/24 13:45, Claus Aßmann wrote:
    The simplest approach is to use multiple DaemonPortOptions, anything
    else is (significantly) more complicated.

    That's what I do.

    Though I do wonder if it might be possible to have an abstraction
    hostname that is referenced via /etc/hosts on each system.

    Presuming that all systems had two IPs and that there is a way to use a
    name abstraction; maybe something like this:

    DAEMON_OPTIONS(`Family=inet, Address=ip-place-holder-A,
    Name=MTA-v4-IP-A')dnl
    DAEMON_OPTIONS(`Family=inet, Address=ip-place-holder-B,
    Name=MTA-v4-IP-B')dnl

    Then have entries like the following in the /etc/hosts file on host1

    192.0.2.11 ip-place-holder-A
    192.0.2.12 ip-place-holder-B

    And similar entries in the /etc/hosts file on host2

    192.0.2.21 ip-place-holder-A
    192.0.2.22 ip-place-holder-B

    This is predicated on if ip-place-holder-A type thing would work in the
    config. I don't know.

    I've presented the mc (m4) syntax which provides some flexibility to do
    some interpretation when compiling the mc (m4) into the cf file. As in
    I think you could get m4 to run commands and extract the necessary
    information to place in the compiled cf output.

    If you do this in the cf file directly, it would be predicated on if if Sendmail will resolve a hostname in this type of situation or not. I
    don't know of this is possible or not.

    Both of these would be a change from the current configuration. But
    name resolution would allow consistent config files across multiple
    systems with the differences being contained in the /etc/hosts file
    which already probably has some host specific things like loghost, etc.



    --
    Grant. . . .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)