| Linode Forum https://forum.linode.com/ |
|
| Spam on new unused server https://forum.linode.com/viewtopic.php?f=11&t=10179 |
Page 1 of 1 |
| Author: | PcComputerGuy [ Mon Jun 24, 2013 11:57 pm ] |
| Post subject: | Spam on new unused server |
Howdy All, After a month off and on of hacking away and using the great linode guides and workaround.org guide I was finally able to get my mailserver running. I haven't completed everything, such as spam assassin and such, so I haven't made the server "live" yet by pointing my MX record to the server. Therefore, if I connect directly to the IP, I can send mail out with outlook (or telnet), but I can't receive anything from the outside world. I CAN receive messages from myself to myself IF sent from the linode, and as far as I know that's the only way I can receive messages.... or so I thought. The server has been up for all of maybe 6 hours and I now have a single Chinese spam message in my inbox. I'm puzzled by this, and want to ensure I am not somehow missing something with security as I don't want to allow spammers (or unauthenticated relays) from my server. So I'm unsure how I received this piece of Chinese spam on my linode inbox... since I myself cant send myself a message unless I originate it from my linode. Here is my mail.log at the same time I received the message in my inbox. I noticed there are a couple things such as a message from no one <>, and to root. How is someone logging in and sending a message from no one since I (at least believe) have SMTP authentication on? I tried with outlook to untick the "my server requires authentication" on the outgoing, and sending fails. When I tick that back on, sending succeeds, which implies to me it is indeed correctly setup to require authentication. Code: Jun 24 23:09:02 PcComputerGuy postfix/pickup[3989]: 4D23B249E2: uid=0 from=<root> Thanks for your suggestions and for the great linode community. |
|
| Author: | Vance [ Tue Jun 25, 2013 12:19 am ] |
| Post subject: | Re: Spam on new unused server |
Easy; someone just connected to your SMTP server at random and submitted a spam message addressed to root. The fact that you haven't pointed an MX record toward it just means that you won't get spam pointed toward @whateveryouhave.tld. Anyone can still connect to port 25 on your server and attempt to submit mail. See this thread for some generic recommendations on setting up Postfix. Note: don't be tempted to block or bit-bucket mail with a null sender <>; some valid mail will come from this address. |
|
| Author: | PcComputerGuy [ Tue Jun 25, 2013 12:39 am ] |
| Post subject: | Re: Spam on new unused server |
Awesome thanks! Can you answer a couple follow ups? 1. I considered the "just sending to root" deal, and tried that myself to see if it would (somehow) end up in my test@example.com inbox, and it didn't. So how did the message sent to root end up in test@example.com, when my text message did not replicate the same thing? 2. Reading the linked forum sounds like I can possible use the "reject_unlisted_recipient"? Or would root be listed? If so, how can I disable root from getting mail, or is this a bad thing to do? |
|
| Author: | dcraig [ Tue Jun 25, 2013 12:45 am ] |
| Post subject: | Re: Spam on new unused server |
An MX record is not necessary to receive mail if the A record for yourdomain.com points to an IP that is configured to handle mail for your domain. |
|
| Author: | PcComputerGuy [ Tue Jun 25, 2013 12:56 am ] |
| Post subject: | Re: Spam on new unused server |
I think Vance was on the right track. I receive no other mail to that address, as far as the world is concerned, it doesn't exist via it's domain, only IP. |
|
| Author: | Vance [ Thu Jun 27, 2013 4:04 am ] |
| Post subject: | Re: Spam on new unused server |
I can't really give answers to your questions not knowing your specific configuration, but I can try to give you some hints. 1. Somehow Postfix has been configured to take (some) mail addressed to root and deliver it to test@example.com. This could be in /etc/aliases, your virtual alias config, or your virtual mailbox config. I would guess it's one of the latter two, since it seems to be treating mail differently based on whether it's submitted locally or externally. 2. Yes, root is probably considered "listed" although this depends on your exact configuration (see especially the values for local_recipient_maps, virtual_alias_maps, virtual_mailbox_maps, relay_domains). Cron jobs and many daemons expect to be able to send mail to root in case of trouble, so disabling it is probably not a good idea. I would suggest making sure that delivery is working properly to all the addresses you'd like to receive mail before using reject_unlisted_recipient. In short, the best way to prevent root from getting spam is to set up your mail server so that all recipients get a minimum of spam. In descending order of my personal preference, methods to do this include the Postfix sanity checks, greylisting, DNSBLs, and content filtering (Spamassassin). You don't want to put super-duper filtering on mail to root (and may in fact want less), since when things go wrong, that's probably where the notification is going. You may be throwing that notification away if you're too aggressive on filtering. |
|
| Author: | PcComputerGuy [ Thu Jun 27, 2013 9:52 am ] |
| Post subject: | Re: Spam on new unused server |
Alrighty, thanks for the tips! |
|
| Author: | sleddog [ Thu Jun 27, 2013 5:17 pm ] |
| Post subject: | Re: Spam on new unused server |
If you post you postfix configuration, troubleshooting would be easier... |
|
| Author: | PcComputerGuy [ Thu Jun 27, 2013 5:56 pm ] |
| Post subject: | Re: Spam on new unused server |
Sure thing. Here is my main.cf Code: # See /usr/share/postfix/main.cf.dist for a commented, more complete version Here is my master.cf Code: # Here is my Dovecot.conf Code: protocols = imap imaps pop3 pop3s Thanks! |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|