Deleting mail in queue

  • Rat
  • Guru
  • Guru
  • User avatar
  • Posts: 1190
  • Loc: desk

Post 3+ Months Ago

--------------------------------------------------------------------------------

I have several hundred emails in my queue which are taking up my daily mail limit and do not want to have to download them all using Outlook. I've been looking for a command to delete them from the queue with ssh but haven't found any. I use Plesk and QMail. Any tips?
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

Well, the first tip I would give you would be to not arbitrarily delete mail from your spool without knowing what it is.

The next thing I would advise is that you install clamav and spamassassin, if you don't already have them installed.

If the mail is real mail (from a real person, to a real person), you need a mail server with more space. If the mail is mostly spam, you can usually isolate out a few (hundred) ip addresses that they're all coming from and put an entry into your tcp.smtp to deny them as such:
Code: [ Select ]
123.123.123.123:deny

I generally take an ip address and perform a whois on it, then block the whole subnet if I know it to be from somewhere I'll never be getting legitimate mail from, for example: If the IP address is 89.102.162.100:
Code: [ Select ]
whois 89.102.162.100
....
....
inetnum: 89.102.162.0 - 89.102.162.255
descr:     Karneval Media Teplice 7 - Public
country:    CZ
  1. whois 89.102.162.100
  2. ....
  3. ....
  4. inetnum: 89.102.162.0 - 89.102.162.255
  5. descr:     Karneval Media Teplice 7 - Public
  6. country:    CZ

This is the whole 89.102.162.x range and in the Czech Republic (where I don't do any business), so I might add something like this to /etc/tcp.smtp:
Code: [ Select ]
89.102.162.:deny

Make sure you put this before your allows, then do:
Code: [ Select ]
qmailctl stop
qmailctl cdb
qmailctl start
  1. qmailctl stop
  2. qmailctl cdb
  3. qmailctl start

After repeating this a few (hundred) times, your spam should drop off drastically.

Because I'm shameless and have no love for spammers, here's my tcp.smtp. Feel free to use it to start your own collection :)
Code: [ Select ]
38.112-119.:deny
58.10.:deny
58.69.0-127.:deny
59.0-42.:deny
59.84-85.:deny
59.86.0-159.:deny
59.189.:deny
61.32-43.:deny
61.191.:deny
61.232.2-3.:deny
69.6.:deny
80.179.242.224-255:deny
81.35-39.:deny
81.44.0-127.:deny
81.53.124.:deny
81.67.36-37.deny
81.174.128-191.:deny
81.199.240-247.:deny
81.214.140-143.:deny
82.66.194-195.:deny
82.117.156.:deny
82.128.0-127.:deny
82.154.244-255.:deny
82.177.128-159.:deny
82.235.44-47.:deny
83.8.64-255.:deny
83.30.:deny
83.32-35.:deny
84.41.128-159.:deny
84.120-123.:deny
84.136-191.:deny
84.226.128-218.:deny
85.75.0-127.:deny
85.176-181.:deny
85.182.0-127.:deny
86.63.96-127.:deny
86.221.110.:deny
88.153.170-255.:deny
88.154.170-255.:deny
88.233.:deny
88.240.:deny
124.104-107.:deny
125.212.93.:deny
125.234-235.:deny
193.252.23.64-71:deny
195.46.240.:deny
200.109.128/17
200.114.224/19:deny
200.221.0/18:deny
200.244.107.128/26:deny
201.27/16:deny
201.128.75/24:deny
201.134/16:deny
201.152/14:deny
202.66.:deny
203.101.25.:deny
203.152.25.16-31:deny
203.153.167.0-15.:deny
203.194.139.223-254:deny
203.215.64-127.:deny
209.59.202.:deny
210-119.0-15.:deny
210.200-201.:deny
210.234.202.0/24:deny
211.47.210-212.:deny
211.155.245.:deny
211.221.13.:deny
212.47.12.:deny
213.163.8.:deny
218.62.128-255.:deny
218.63.:deny
218.72.248-255.:deny
218.85.:deny
218.86.0-127.:deny
218.87.:deny
218.90-94.:deny
218.160-175.:deny
218.201.192-255.:deny
219.248.100-103.:deny
220.72-87.:deny
220.99.:deny
220.163-165.:deny
220.170.128-143.:deny
220.171-172.:deny
220.174.:deny
221.3.128-255.:deny
221.32.0-63.:deny
221.124-127.:deny
221.216-223.:deny
221.169.192.0/21:deny
221.196-198.:deny
221.224-231.:deny
222.64-74.:deny
222.136-143.:deny
222.170-171.:deny
222.173-191.:deny
222.216-218.:deny
201.135.24.2:deny
211.218.124.44:deny
89.102.162.:deny

127.:allow,RELAYCLIENT=""
:allow
  1. 38.112-119.:deny
  2. 58.10.:deny
  3. 58.69.0-127.:deny
  4. 59.0-42.:deny
  5. 59.84-85.:deny
  6. 59.86.0-159.:deny
  7. 59.189.:deny
  8. 61.32-43.:deny
  9. 61.191.:deny
  10. 61.232.2-3.:deny
  11. 69.6.:deny
  12. 80.179.242.224-255:deny
  13. 81.35-39.:deny
  14. 81.44.0-127.:deny
  15. 81.53.124.:deny
  16. 81.67.36-37.deny
  17. 81.174.128-191.:deny
  18. 81.199.240-247.:deny
  19. 81.214.140-143.:deny
  20. 82.66.194-195.:deny
  21. 82.117.156.:deny
  22. 82.128.0-127.:deny
  23. 82.154.244-255.:deny
  24. 82.177.128-159.:deny
  25. 82.235.44-47.:deny
  26. 83.8.64-255.:deny
  27. 83.30.:deny
  28. 83.32-35.:deny
  29. 84.41.128-159.:deny
  30. 84.120-123.:deny
  31. 84.136-191.:deny
  32. 84.226.128-218.:deny
  33. 85.75.0-127.:deny
  34. 85.176-181.:deny
  35. 85.182.0-127.:deny
  36. 86.63.96-127.:deny
  37. 86.221.110.:deny
  38. 88.153.170-255.:deny
  39. 88.154.170-255.:deny
  40. 88.233.:deny
  41. 88.240.:deny
  42. 124.104-107.:deny
  43. 125.212.93.:deny
  44. 125.234-235.:deny
  45. 193.252.23.64-71:deny
  46. 195.46.240.:deny
  47. 200.109.128/17
  48. 200.114.224/19:deny
  49. 200.221.0/18:deny
  50. 200.244.107.128/26:deny
  51. 201.27/16:deny
  52. 201.128.75/24:deny
  53. 201.134/16:deny
  54. 201.152/14:deny
  55. 202.66.:deny
  56. 203.101.25.:deny
  57. 203.152.25.16-31:deny
  58. 203.153.167.0-15.:deny
  59. 203.194.139.223-254:deny
  60. 203.215.64-127.:deny
  61. 209.59.202.:deny
  62. 210-119.0-15.:deny
  63. 210.200-201.:deny
  64. 210.234.202.0/24:deny
  65. 211.47.210-212.:deny
  66. 211.155.245.:deny
  67. 211.221.13.:deny
  68. 212.47.12.:deny
  69. 213.163.8.:deny
  70. 218.62.128-255.:deny
  71. 218.63.:deny
  72. 218.72.248-255.:deny
  73. 218.85.:deny
  74. 218.86.0-127.:deny
  75. 218.87.:deny
  76. 218.90-94.:deny
  77. 218.160-175.:deny
  78. 218.201.192-255.:deny
  79. 219.248.100-103.:deny
  80. 220.72-87.:deny
  81. 220.99.:deny
  82. 220.163-165.:deny
  83. 220.170.128-143.:deny
  84. 220.171-172.:deny
  85. 220.174.:deny
  86. 221.3.128-255.:deny
  87. 221.32.0-63.:deny
  88. 221.124-127.:deny
  89. 221.216-223.:deny
  90. 221.169.192.0/21:deny
  91. 221.196-198.:deny
  92. 221.224-231.:deny
  93. 222.64-74.:deny
  94. 222.136-143.:deny
  95. 222.170-171.:deny
  96. 222.173-191.:deny
  97. 222.216-218.:deny
  98. 201.135.24.2:deny
  99. 211.218.124.44:deny
  100. 89.102.162.:deny
  101. 127.:allow,RELAYCLIENT=""
  102. :allow
  • Rat
  • Guru
  • Guru
  • User avatar
  • Posts: 1190
  • Loc: desk

Post 3+ Months Ago

Thanks!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 50 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.