Allow sender without @domain

This section contains user-submitted tutorials.
Post Reply
tanaki
New user
New user
Posts: 1
Joined: 2023-04-07 13:18

Allow sender without @domain

Post by tanaki » 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

User avatar
SorenR
Senior user
Senior user
Posts: 6124
Joined: 2006-08-21 15:38
Location: Denmark

Re: Allow sender without @domain

Post by SorenR » 2023-04-07 14:46

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
SørenR.

To understand recursion, you must first understand recursion.

User avatar
mattg
Moderator
Moderator
Posts: 22387
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Allow sender without @domain

Post by mattg » 2023-04-11 02:44

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
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply