Email address shows up as null null
What does NULL mean | MacRumors Forums
What does the word "null" appear in front… - Apple Community
What is null in emails - Google Account Community
Any idea why some users that send internal mail from Exchange online has their "from" address being seen as a null sender.
A simple test mail with a subject "Test Mail" from some users will show in the logs as a null sender, thus failing any authentication methods with 3rd party SMTP services.
Hi Www_w_,
There are several causes why users receive NDR when sending emails. NDRs include a code that indicates why your email isn’t delivered, you can refer to the list in this article.
In your case, the emails you send have an invalid sender address (null sender), so it would be rejected by Office 365. Sometimes a rejected message will appear as “550 5.7.512 Access denied, message must be RFC 5322 section 3.6.2 compliant and include a valid From address”. This is an expected behavior, as the NDR cannot be sent back to the sender whose address is invalid. Therefore, NDR will not be sent and it will be “discarded”
We appreciate your understanding and patience.
Best Regards,
Ruel
Thank you very much.
Please teach me.
>NDR will not be sent and it will be “discarded”
Exchange server have undeliverable queue and later, the NDR threw away?
Or when the message is null sender, Exchange server discard soon?
Well, and please teach me.
When my tenant's exchange server makes the NDR, exchange server send external smtp server the exchange online's NDR.
And exchange server discards the original message of external smtp server.
Is my understanding correct?
Please teach me.
The original message discard soon? Or is there the original message in exchange server's queue?
This URL is Exchange 2010.
https://technet.microsoft.com/en-US/library/bb232161%28v=exchg.141%29.aspx?f=255&MSPPError=-2147217396
This URL is Exchange 2013
https://technet.microsoft.com/en-US/library/bb125022(v=exchg.150).aspx
Well.....So, I think. Maybe, exchange online stores the discard message in "Unreachable queue" too**.**
Undeliverable
You cannot do this with SmtpClient and MailMessage, so using this or Send-MailMessage is out of the question. Unfortunately that means you're left with either finding a third party library which does support it, or writing the code yourself to send directly through SMTP.
You're probably better off testing this part of your system with a unit test.
Manually with telnet
open localhost 25
HELO Foo
MAIL FROM: <> <--- the null address
Automated.
Not actually the complete working code, but should give the general impression GetFile and SmtpStream are streams. The solution is to feed an pre-created .eml file by directly interacting with the SMTP protocol.
GivenAClientIsConnectedToAnAgentInTheWAITINGState();
SmtpStream.WriteAsciiString("MAIL FROM:<>{0}", Environment.NewLine);
SmtpStream.ReceiveAsAsciiString();
SmtpStream.WriteAsciiString("RCPT TO:<{0}>{1}",mailboxAddress, Environment.NewLine);
SmtpStream.ReceiveAsAsciiString();
SmtpStream.WriteAsciiString("DATA{0}", Environment.NewLine);
SmtpStream.ReceiveAsAsciiString();
SmtpStream.SendEmail(_fileRepository.GetFile("NullSenderMessage.eml"));
SmtpStream.SendDataTerminator();
SmtpStream.ReceiveAsAsciiString();
SmtpStream.WriteAsciiString("QUIT");
Options like
null@,devnull@, ornone@seem plausible, but there's a concern that these addresses might already be in use.
None of those are standard and they indeed might be already in use.
As far as I know, there is no special address that would guarantee non-delivery when sending to arbitrary random domains – any syntactically-valid "local-part" is equally valid for delivery, and only the receiving MTA can decide whether to accept it; the sending MTA cannot refuse based on local-part.
So in all cases, you'll have to decide on a specific (sub)domain first.
Suggestions:
Set up an MTA at your own domain name (or a subdomain thereof; you can put MX records on subdomains). You'll then have a guarantee that e.g.
null@will not be in use at that particular domain. Of course, the sender will still try to contact you, but you can literally alias that mailbox to/dev/nullon your end.There is now a recent convention of creating a "null MX" record on domains that are explicitly never expected to receive email (as opposed to domains that have no MX records, in which case the domain would be implicitly its own MX). If you create a single MX record that points to the server
., this will cause many new MTAs to automatically fail delivery. Again, you can use a subdomain for this instead of dedicating a whole domain.example.com(and.net, and.org) is a real domain that exists, but is reserved for usage in examples and documentation (i.e. it'll never have real mailboxes); as part of that, it actually has a "null MX" record.There are reserved domains, such as
[anything].invalid, which will never exist in DNS at all (not even as null-MX) and therefore your origin MTA will immediately fail delivery.
Since the question mentions Postfix MTA, here is how to set up Postfix to have a particular address behave as if it was an equivalent of /dev/null.
The Postfix comes with a discard mail delivery agent, which is described as:
The discard(8) delivery agent pretends to deliver all recipients in the delivery request, logs the "next-hop" destination as the reason for discarding the mail, updates the queue file, and either marks recipients as finished or informs the queue manager that delivery should be tried again at a later time.
An e-mail address can be configured to be handled by the discard agent by using the transport maps:
/etc/postfix/main.cf:
transport_maps = hash:/etc/postfix/transport
/etc/postfix/transport:
[email protected] discard:
Then execute postmap /etc/postfix/transport to create indexed file of the transport database and reload the Postfix daemon (the command for reloading or restarting a daemon could vary depending on the operating system being used).
As a result, Postfix will discard mail addressed to [email protected].
Mail for entire domain or subdomains can be discarded in this way:
/etc/postfix/transport:
# discard all mail to domain 'example.com':
example.com discard:
# discard all mail to subdomains of 'example.com':
.example.com discard: