Page 1 of 1

Allow sender without @domain

Posted: 2023-04-07 13:32
by tanaki
Hello,

I am looking for solution how to allow hmailserver to accept messages with "MAIL FROM:" missing the domain part ( te "@...." part). Also if such message arrives I want to be able to append a domain part.

I tried catching the event "OnClientConnect" , but no message header is available. The event "OnSMTPData" doesn't work as well , because hmailserver SMTPD closes session before calling it.

Any suggestions are welcome.

Thanks

Re: Allow sender without @domain

Posted: 2023-04-07 14:46
by SorenR
tanaki wrote:
2023-04-07 13:32
Hello,

I am looking for solution how to allow hmailserver to accept messages with "MAIL FROM:" missing the domain part ( te "@...." part). Also if such message arrives I want to be able to append a domain part.

I tried catching the event "OnClientConnect" , but no message header is available. The event "OnSMTPData" doesn't work as well , because hmailserver SMTPD closes session before calling it.

Any suggestions are welcome.

Thanks
In which case would "MAIL FROM: <JOHN_DOE>" be true?

RFC say:

Code: Select all

      "MAIL FROM:" ("<>" / Reverse-Path) [SP Mail-parameters] CRLF
And "Reverse-Path" is defined by:

Code: Select all

      Reverse-path = Path
      Forward-path = Path
      Path = "<" [ A-d-l ":" ] Mailbox ">"
      A-d-l = At-domain *( "," A-d-l )
            ; Note that this form, the so-called "source route",
            ; MUST BE accepted, SHOULD NOT be generated, and SHOULD be
            ; ignored.
      At-domain = "@" domain
      Mail-parameters = esmtp-param *(SP esmtp-param)
      Rcpt-parameters = esmtp-param *(SP esmtp-param)
      esmtp-param     = esmtp-keyword ["=" esmtp-value]
      esmtp-keyword   = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")
      esmtp-value     = 1*(%d33-60 / %d62-127)
            ; any CHAR excluding "=", SP, and control characters
      Keyword  = Ldh-str
      Argument = Atom
      Domain = (sub-domain 1*("." sub-domain)) / address-literal
      sub-domain = Let-dig [Ldh-str]

      address-literal = "[" IPv4-address-literal /
                            IPv6-address-literal /
                            General-address-literal "]"

      Mailbox = Local-part "@" Domain

      Local-part = Dot-string / Quoted-string
            ; MAY be case-sensitive

      Dot-string = Atom *("." Atom)

      Atom = 1*atext

      Quoted-string = DQUOTE *qcontent DQUOTE

      String = Atom / Quoted-string

Re: Allow sender without @domain

Posted: 2023-04-11 02:44
by mattg
tanaki wrote:
2023-04-07 13:32
Also if such message arrives I want to be able to append a domain part.
How will you know the domain to append?

Does the GUI switch 'allow empty sender address' in SMTP >> RFC compliance achieve what you want?


If you are talking about client connections to the SMTP server for OUTGOING mail, what you need to set is the 'default domain' on the advanced tab