How to whitelist an email address

What is the correct way to whitelist an email address?

I receive emails from several organizations and their emails go directly to spam.

There does not seem to be any whitelisting options in webmail such as, "This is not spam ", or “accept emails from this address” , or “add this email as a safe sender”.

I realize that the organizations that are sending the emails may not have there email servers set up correctly to all the latest safety and security options, But that is really not my problem. I just want to get emails from them and I don’t want to go dig it out of the spam folder.

I don’t know of a simple way to do it, but the spam handling system should learn from you classifying the email. For that to work, you need to move the mail out of the spam folder.
If that doesn’t work, or you want it fast, you can add a local configuration file to spamassassin that might handle this:

  • create a file like /etc/spamassassin/90_custom.cf
  • add a line whitelist_from <emailaddress> in the file

This should whitelist emails coming from that email address. There’s more subtlety here, e.g. look at whitelist_from_spf and whitelist_from_rcvd if you’re interested in having better controls over whitelisting.

[updated to fix mistake]

1 Like

Try making a file /etc/mail/spamassassin/99_local.cf with lines like:

whitelist_from *@example.com
whitelist_from *@anotherdomain.com

And then restart the spamd service

2 Likes

Minor addition, it’s actually spampd and there’s no need to restart it.

1 Like

Simple question for clarity. Whitelisting as described here will allow that email for all users and accounts of the box, correct?

If so, does moving the email out of spam to train the filter only train by account, domain, or by the entire server?

More of a curiosity for my understanding on how the spam filter works. If anyone has more info, please post a link as I have more questions, but would prefer reading first to not clog the forum with questions that have easily attained answers elsewhere.

1 Like

I believe that both whitelisting and spam training is valid for all users, the way it is configured in Mail in a Box.
From spamassassin point of view it is probably possible to configure a training database per user.

2 Likes

I have done this and it doesn’t seem to work. I don’t know how spamassassin learns this or what its criteria is for it to finally say “Oh this email is no longer spam, you go to the inbox”. I have moved probably several dozen emails out of my spam. and it doesn’t make a difference.

Round Cube has a trusted sender list in its contact tab but I cant seem to add an address there. If I click on the “+” button and add a address it just adds it to my Personal Addresses list. Even if the email address are in there, it doesn’t work, they still go to spam.

Going to try and create the white list file and see what happens.

It might well be very ineffective. I only know that the mechanism is in place to let this work. You might see it’s effect by studying the spamassassin headers that are added to each mail you receive.

I didn’t know that. I suspect that it is not linked to the spam fighting mechanisms in the box though

1 Like

This did not work for me.

This did work for me.

Thank you everyone.

Ai, indeed. I see that I made a mistake there, sorry about that. :pensive:

To whitelist an email address, you might not find the option directly in your webmail like saying This is not spam or Accept emails from this address. But you can still whitelist by adding the sender’s email to your contacts or address book. This tells your email provider that you trust emails from that address, and they won’t go to spam. Even if the sender’s email system isn’t up to date with safety options, this trick should work to get their emails directly into your inbox without you having to search through the spam folder.

I don’t think that this has been implemented in Mailinabox. But I would gladly be corrected :wink:

I dont think so either… not sure spamassassin knows about anything in your contacts/address book.

What if you want to whitelist an IP address? How do you do that?

what are you trying to whitelist it from?

postgrey or spamassassin?

POSTGREY

create a file located here:

 /etc/postgrey/whitelist_clients.local

The file should contain list of domains you what whitelisted (ideally it should really contain the IP addresses of the servers for that trusted domain, but I find adding the domain itself is pretty reasonable so long as its not gmail.com or hotmail.com (one of the larger providers)

restart the postgrey service

service postgrey restart

SPAMassassin:

the above →

should be how you do this with spamassassin.

remember to bounce that service too

service spamassassin restart
service spampd restart