Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a Linux server that is permanently connected to the internet. Two of my users have remote POP3 boxes on other servers hosted by their ISPs. They don't want their mail to be downloaded to the Linux server because they check them from their mobile phones / at home etc.
I'm looking for spam solutions for these users. Is it possible to set up SpamAssassin so that it checks these POP3 boxes at regular intervals and removes spam mail from them / marks them as spam? So when the user comes to download their e-mail the spam messages are not there, or at least marked as spam so that they can be easily filtered or deleted?
(I'm aware that if they check their messages and a spam mail has been received since the last time SpamAssassin checked the account then that will still be there, but hopefully that should be minimal)
Alternatively, if SpamAssasssin cannot do this, does anyone know of an alternative solution that would do it (preferably Linux and Open Source, but not definitely)? Or a different idea to acheive the same result? Local spam scanners are not ideal, because we can't install it on mobile phones etc, and installing spam scanning at the ISP level is not an option unfortunately.
Rather than writing an entire script, you can probably do something with fetchmail. This will let you download each message to the Linux box and filter it, doing whatever you like with spam.
You'll can then forward email to another mail box to if you don't want to keep it on the Linux box; then just point your users at the “filtered” mail box instead.
The actions you can perform on a POP3 mail box are rather basic — getting the number of emails, retrieving the entirity of an email, marking an email for deletion when you log out, and logging out.
So you could write a script that downloads each email from the server without deleting it, pipes it through spamassassin, then deletes it if it is found as spam. If you want to mark it as spam, you'll either have to upgrade to IMAP or forward the email to the recipient again (and make sure you don't keep reprocessing each message).
The Perl modules Mail::Internet and Mail::SpamAssassin will help you here. There'll be a POP3 or IMAP module for CPAN as well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.