• defer, not DSN when "host not found" - how?

    From =?iso-8859-2?Q?Kamil_Jo=F1ca?=@21:1/5 to All on Thu Jan 26 11:34:17 2023
    I am rather new to sendmail so please forgive vague question.

    There is computer.
    This computer sometimes is connected via vpn to work network.
    When computer is connected to work network it can resolves hosts in
    internal domain (say "*.kjonca")
    But when is not connected via vpn to work network this domain is not resolvable, i.e. alfa.kjonca return NXDOMAIN.
    Sometimes this laptop has to send mails to other host, and here is a
    problem.
    When is disconnected from vpn I immediately got

    --8<---------------cut here---------------start------------->8--- 30N7Ip4W023613: DSN: Host unknown (Name server: alfa.kjonca: host not found) --8<---------------cut here---------------end--------------->8---

    is it possible to configure sendmail to defer mails when vpn is off, and
    send them when vpn goes up?
    I tried to search, and found some pages, but TBH they are rather not understandable to me.

    Any hint? Point to doc?

    KJ

    --
    http://wolnelektury.pl/wesprzyj/teraz/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Thu Jan 26 11:53:21 2023
    Am 26.01.2023 schrieb Kamil Jońca <kjonca@poczta.onet.pl>:

    is it possible to configure sendmail to defer mails when vpn is off,
    and send them when vpn goes up?

    You could configure the queue running, so the queue (maybe use a
    specific queue for that messages) only runs when VPN is up.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrzej Adam Filip@21:1/5 to kjonca@poczta.onet.pl on Thu Jan 26 13:15:56 2023
    Kamil Jońca <kjonca@poczta.onet.pl> wrote:
    I am rather new to sendmail so please forgive vague question.

    There is computer.
    This computer sometimes is connected via vpn to work network.
    When computer is connected to work network it can resolves hosts in
    internal domain (say "*.kjonca")
    But when is not connected via vpn to work network this domain is not resolvable, i.e. alfa.kjonca return NXDOMAIN.
    Sometimes this laptop has to send mails to other host, and here is a
    problem.
    When is disconnected from vpn I immediately got

    30N7Ip4W023613: DSN: Host unknown (Name server: alfa.kjonca: host not found)

    is it possible to configure sendmail to defer mails when vpn is off, and
    send them when vpn goes up?
    I tried to search, and found some pages, but TBH they are rather not understandable to me.

    Any hint? Point to doc?

    Which soft/server do you use as DNS resolver on the computer?
    IMHO It is worth to _try_ fix DNS replies in initial fix attempts.
    I suspect DNS resolver switching between "normal internet" and
    "VPN internet" set of nameservers in /etc/resolv.conf

    "resolvconf" package can even modify active local nameserver (bind) configuration based on network interfaces active.
    As I understand if you use static IP address local resolving nameserver
    (bind) may use static configuration.

    --
    [Andrew] Andrzej A. Filip

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?iso-8859-2?Q?Kamil_Jo=F1ca?=@21:1/5 to Andrzej Adam Filip on Thu Jan 26 13:55:24 2023
    Andrzej Adam Filip <anfi@onet.eu> writes:

    Kamil Joñca <kjonca@poczta.onet.pl> wrote:
    I am rather new to sendmail so please forgive vague question.

    There is computer.
    This computer sometimes is connected via vpn to work network.
    When computer is connected to work network it can resolves hosts in
    internal domain (say "*.kjonca")
    But when is not connected via vpn to work network this domain is not
    resolvable, i.e. alfa.kjonca return NXDOMAIN.
    Sometimes this laptop has to send mails to other host, and here is a
    problem.
    When is disconnected from vpn I immediately got

    30N7Ip4W023613: DSN: Host unknown (Name server: alfa.kjonca: host not found) >>
    is it possible to configure sendmail to defer mails when vpn is off, and
    send them when vpn goes up?
    I tried to search, and found some pages, but TBH they are rather not
    understandable to me.

    Any hint? Point to doc?

    Which soft/server do you use as DNS resolver on the computer?
    IMHO It is worth to _try_ fix DNS replies in initial fix attempts.

    I do not understand. IMO DNS behavior is correct - when no vpn, then no "*.kjonca" domain.

    I suspect DNS resolver switching between "normal internet" and
    "VPN internet" set of nameservers in /etc/resolv.conf

    DNS is provided by dnsmasq + bunch of scripts controlled by me.
    I of course change them but, this is unintuitive for me.

    I would expect that sendmail can deal with such problem.
    KJ


    --
    http://stopstopnop.pl/stop_stopnop.pl_o_nas.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to All on Thu Jan 26 16:03:29 2023
    On 26/01/2023 13:55, Kamil Jońca wrote:
    Andrzej Adam Filip <anfi@onet.eu> writes:

    I suspect DNS resolver switching between "normal internet" and
    "VPN internet" set of nameservers in /etc/resolv.conf

    DNS is provided by dnsmasq + bunch of scripts controlled by me.
    I of course change them but, this is unintuitive for me.

    I would expect that sendmail can deal with such problem.

    You could always hard code it in hosts or in dnsmasq config, so you get
    an ip no matter if you are on the vpn or not.

    --

    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Thu Jan 26 16:22:41 2023
    Am 26.01.2023 schrieb Kamil Jońca <kjonca@poczta.onet.pl>:

    I would expect that sendmail can deal with such problem.

    As I wrote, I assume this is possible with specific queue groups for
    that domain. The sendmail 4th edition PDF has some chapters about it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to All on Thu Jan 26 13:00:12 2023
    Kamil Joñca wrote:

    But when is not connected via vpn to work network this domain is not resolvable, i.e. alfa.kjonca return NXDOMAIN.

    30N7Ip4W023613: DSN: Host unknown (Name server: alfa.kjonca: host not found)

    What are you doing to trigger this errror?
    Please provide all log entries for 30N7Ip4W023613

    Does this happen when you are trying to send an e-mail to alfa.kjonca?
    Or is alfa.kjonca the name of your server?

    In the former case you could
    define(`confDELIVERY_MODE', `q')
    You might want to add
    LOCAL_CONFIG
    CPkjonca
    to your mc file to indicate that this domain is valid.

    --
    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 =?iso-8859-2?Q?Kamil_Jo=F1ca?=@21:1/5 to All on Fri Jan 27 09:56:10 2023
    Claus Aßmann <INVALID_NO_CC_REMOVE_IF_YOU_DO_NOT_POST_ml+sendmail(-no-copies-please)@esmtp.org>
    writes:

    Kamil Joñca wrote:

    But when is not connected via vpn to work network this domain is not
    resolvable, i.e. alfa.kjonca return NXDOMAIN.

    30N7Ip4W023613: DSN: Host unknown (Name server: alfa.kjonca: host not found)

    What are you doing to trigger this errror?

    I tried to send mail to alfa.kjonca, while vpn was off, and domain
    *.kjonca was not resolvable (I think).

    Please provide all log entries for 30N7Ip4W023613

    --8<---------------cut here---------------start------------->8---
    $grep 30N7Ip4W023613 /var/log/mail.log-20230125 2023-01-23T08:18:51.589454+01:00 uhla sm-mta[23613]: 30N7Ip4W023611: 30N7Ip4W023613: DSN: Host unknown (Name server: alfa.kjonca: host not found)
    2023-01-23T08:18:51.593528+01:00 uhla sm-mta[23613]: 30N7Ip4W023613: to=kjonca@alfa.kjonca, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=30000, relay=alfa.kjonca, dsn=5.1.2, stat=Host unknown (Name server: alfa.kjonca: host not found)
    2023-01-23T08:18:51.593927+01:00 uhla sm-mta[23613]: 30N7Ip4W023613: 30N7Ip4X023613: return to sender: Host unknown (Name server: alfa.kjonca: host not found)
    2023-01-23T08:18:51.599480+01:00 uhla sm-mta[23613]: 30N7Ip4W023613: Saved message in /var/lib/sendmail/dead.letter
    --8<---------------cut here---------------end--------------->8---

    Does this happen when you are trying to send an e-mail to alfa.kjonca?
    Or is alfa.kjonca the name of your server?

    uhla is local host which tried to send locally generated mail to kjonca.

    In the former case you could
    define(`confDELIVERY_MODE', `q')
    You might want to add
    LOCAL_CONFIG
    CPkjonca
    to your mc file to indicate that this domain is valid.

    (probably I need to setup some test environment which can take
    while)


    KJ

    --
    http://wolnelektury.pl/wesprzyj/teraz/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to All on Fri Jan 27 05:06:59 2023
    Kamil Joñca wrote:

    define(`confDELIVERY_MODE', `q')

    Make that
    define(`confDELIVERY_MODE', `d')

    4.7. Delivery Mode

    d defer delivery attempts (don't deliver)

    Mode "d" is identical to mode "q" except
    that it also prevents lookups in maps including the -D
    flag from working during the initial queue phase; it
    is intended for ``dial on demand'' sites where DNS
    lookups might cost real money. Some simple error mes-
    sages (e.g., host unknown during the SMTP protocol)
    will be delayed using this mode.

    (probably I need to setup some test environment which can take

    That's a good plan.

    BTW: what do you want to happen with mails which are being
    sent to other domains while your VPN is down?
    With this kind of setup all mails wll be "deferred".

    --
    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 =?iso-8859-2?Q?Kamil_Jo=F1ca?=@21:1/5 to All on Fri Jan 27 11:35:37 2023
    Claus Aßmann <INVALID_NO_CC_REMOVE_IF_YOU_DO_NOT_POST_ml+sendmail(-no-copies-please)@esmtp.org>
    writes:

    Kamil Joñca wrote:

    define(`confDELIVERY_MODE', `q')

    Make that
    define(`confDELIVERY_MODE', `d')

    4.7. Delivery Mode

    d defer delivery attempts (don't deliver)

    Mode "d" is identical to mode "q" except
    that it also prevents lookups in maps including the -D
    flag from working during the initial queue phase; it
    is intended for ``dial on demand'' sites where DNS
    lookups might cost real money. Some simple error mes-
    sages (e.g., host unknown during the SMTP protocol)
    will be delayed using this mode.

    (probably I need to setup some test environment which can take

    That's a good plan.

    BTW: what do you want to happen with mails which are being
    sent to other domains while your VPN is down?
    With this kind of setup all mails wll be "deferred".

    Thats ok for me, as I do not plan send emails to others domains from
    this host. :)

    KJ

    --
    http://wolnelektury.pl/wesprzyj/teraz/

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