NunoNeves
07-15-2008, 11:34 AM
Hi,
I need to create a no-reply@example.com and send it to /dev/null (discard) without notification.
How can I do this in CPanel?
frosman
07-15-2008, 01:23 PM
You could make an script to empty this account each day with a cron job.
cPanelDavidG
07-15-2008, 02:14 PM
What I do to comply with servers doing more stuff with verifying senders etc. nowadays is I create a POP3 account with a 1 mb quota. I have my scripts (e.g. WordPress) use this address to send automated emails. Since it's an actual account rather than a forwarder to :fail:, it is recognized as an account and no one has had any problems with it yet. I only lose 1 mb of disk space and since it's not an account that I actually use, I don't mind mail delivery failing at SMTP time because it is a full mailbox.
Now, if you are strictly using this as a do-not-reply email address that will never need all that mail account verification stuff to work, just create a forwarder in cPanel and for the destination select "Discard with error to sender (at SMTP time)." This is better than redirecting to /dev/null (aka, blackhole) as the server will never process the email, it will simply reject the email at SMTP time.
hzDylan
07-15-2008, 05:54 PM
David,
I thought :blackhole: sends to the mail queue and later discards it after several days (default) and :fail: is equivalent to sending to /dev/null but sends a failure message to the email sender? Am I wrong in thinking this?
root@host [~]# grep ':fail:' /etc/exim.conf
data = :fail: demo accounts are not permitted to relay email
data = ":fail: The mail server could not deliver mail to $local_part@$domain. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries."
NunoNeves:
echo 'no-reply@domain.com: /dev/null' /etc/valiases/domain.com
A daily cronjob to remove email sent to 'no-reply' would look like this: rm -f $HOME/mail/domain.com/no-reply/new/*
cPanelDavidG
07-15-2008, 05:58 PM
David,
I thought :blackhole: sends to the mail queue and later discards it after several days (default) and :fail: is equivalent to sending to /dev/null but sends a failure message to the email sender? Am I wrong in thinking this?
There's an excellent guide explaining the difference between fail and blackhole at: http://www.configserver.com/free/fail.html
linux-tech
07-15-2008, 06:06 PM
Just use :fail:, nobody should be sending mail to a no-reply address anyways.
hzDylan
07-15-2008, 06:12 PM
Thanks David - that did clear the air. I actually for the first time tested this (i have free time on my hands).
It is pretty clear that using :fail: - it immediately rejects the email and when using "/dev/null" - it accepts the email and then deletes it.
So using :fail: would be the optimal option when all you want to do is trash all email received.
Just thought I'de share the results:
2008-07-15 17:05:40 H=houston.hostingzoom.com [207.99.69.218] F=<dylan@hostingzoom.com> rejected RCPT <no-reply@cpanelnerds.com>:
2008-07-15 17:07:57 1KIsgT-0003n2-DZ => /dev/null (no-reply@cpanelnerds.com) <no-reply@cpanelnerds.com> R=virtual_aliases_nostar T=**bypassed**
:agree: