Skip to main content

API to discard message with email Filter

Comments

4 comments

  • cPanelTJ
    Hey @hiredgeek , The webmail interface is using /dev/null
    .
    0
  • hiredgeek
    Thanks TJ, that makes sense. Is that the best way to handle incoming email that is unwanted? For instance, I am using a noreply@ mail account to send using SMTP, and I don't want any replies, and bouncebacks are unnecessary. Is setting the destination to /dev/null the same as a blackhole? I see alot of different opinions about whether to blackhole or fail, and some of it is outdated. What do you advise in 2020?
    0
  • cPanelLauren
    Hi @hiredgeek So the only instances in which I'd recommend you save to /dev/null (silently fail or discard the message) is if you don't want to send a bounceback i.e., it's obvious spam or domain forgery and sending a bounceback would result in backscatter. In other instances though, the RFC compliant way to manage delivery failures is to fail it with a message so the sender knows why the message failed to be delivered. There is a fantastic and very informative discussion of this here:
    0
  • hiredgeek
    Thank you Lauren and @sparek-3. It sounds like for my scenario, what I should use is a Forwarder (not a filter). And select the option to "Discard with error to sender (at SMTP time)", so that the remote server is the one sending the message. I would use UAPI Function - Email::add_forwarder, and fwdopt=fail. And then my server would not be receiving and handling the messages, correct?
    0

Please sign in to leave a comment.