How can I send a single email from the server? Command line?

lenashore

Member
Feb 11, 2011
12
0
51
My server got on a blacklist yesterday. I found the offending problem and cleaned it up. So, now I am trying to get delisted. One of things I need to do is to send an email from the offending server with a special subject line provided for me:

You must be able to send an e-mail with an verifycode from xxx.xx.xxx.xx to delist.
I don't have any email accounts on this server. I do have some Wordpress sites that have email forms - but I don't know how to SEND an email to these guys. Clearly I could set up a form on a server to send mail and send it (the damn hackers do it) - but I was hoping there was more of a one-time solution... Maybe sending from the command-line somehow? Or is there an option to send a single mail from the WHM someplace?

Any ideas? I am feeling a little dumb here.
 

madmanmachines

Well-Known Member
Nov 28, 2014
94
4
8
cPanel Access Level
Root Administrator
Hi,

You'll need to receive mail from the same address that you send the delist request from, so you should probably just create a temporary email account. As well, are you sure the RBL requires the delist request to be sent from the server?

Thanks,
 

lenashore

Member
Feb 11, 2011
12
0
51
Hi,

You'll need to receive mail from the same address that you send the delist request from, so you should probably just create a temporary email account. As well, are you sure the RBL requires the delist request to be sent from the server?

Thanks,
It did say "from the IP it was listed". So, I'm inferring it needs to come from the server.

I did find a possible solution from the command line a few minutes ago. I should know in a few hours if it worked. As if it worked, I should be delisted within 3 hours.

Code:
[[email protected] ~]# mail -s "Test Subject" [email protected] < /dev/null
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello,

While it may work sending from the command line, is there any reason you can't create an email account for a domain name hosted on your server?

Thank you.
 

lenashore

Member
Feb 11, 2011
12
0
51
Hello,

While it may work sending from the command line, is there any reason you can't create an email account for a domain name hosted on your server?

Thank you.
I suppose I could. There are no mail accounts at all on the server now. I guess I assumed if I made an account it would add extra software to the server. Also, all sites are set up to use outside mail servers. Would that matter? Maybe that is a non-issue?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
I guess I assumed if I made an account it would add extra software to the server
No extra software is installed as cPanel already includes email functionality. That being said, if the domain name resolves to a remote server and email is handled remotely, then it's likely a better idea to send the email as you did.

Thank you.
 

lenashore

Member
Feb 11, 2011
12
0
51
Thanks for the clarification on how it works. Much appreciated. So much to learn, but that can be fun.