6 Replies Latest reply: Nov 14, 2013 4:20 PM by Ben M.
timmil312 Level 1 Level 1 (0 points)

I am pretty new to the whole serveradmin tool and was working on trying to whitelist a couple of domains.  When I list the settings using the command:

 

sudo serveradmin settings mail:postfix|grep white

 

I end up with the following output:

 

2012-11-26 08:54:16.973 serveradmin[13578:a07] servermgr_mail: postconf read error: /usr/sbin/postconf: warning: /Library/Server/Mail/Config/postfix/main.cf: unused parameter: domain_whitelist=delete

mail:postfix:whitelist_from:_array_index:0 = "delete"

mail:postfix:add_whitelist_domain:_array_index:0 = "domain1.com"

mail:postfix:add_whitelist_domain:_array_index:1 = "{"

mail:postfix:add_whitelist_domain:_array_index:2 = "{"

mail:postfix:add_whitelist_domain:_array_index:3 = "domain2.com"

mail:postfix:add_whitelist_domain:_array_index:4 = "domain2.com"

mail:postfix:host_whitelist:_array_index:0 = "{"

mail:postfix:add_whitelist_host:_array_index:0 = "{"

mail:postfix:domain_whitelist:_array_index:0 = "domain1.com"

mail:postfix:domain_whitelist:_array_index:1 = "{"

mail:postfix:domain_whitelist:_array_index:2 = "{"

mail:postfix:domain_whitelist:_array_index:3 = "domain2.com"

mail:postfix:domain_whitelist:_array_index:4 = "domain2.com"

 

How do I remove these so that I can start from scratch?  And can anyone tell me if these are the right settings for correctly whitelisting 2 domains?

Where can one find more information on the serveradmin tool?

 

Thanks for your help!

- Tim


Mac mini Server (Mid 2011), OS X Mountain Lion (10.8.2)
  • blacksun Level 1 Level 1 (0 points)

    I had this question, too. Here's what I found by digging.

     

    The script that runs greylisting is /usr/libexec/postfix/greylist.pl . This script creates two databases:

     

    whitelist.db and greylist.db

     

    A scan of that file reveals where these files are kept:

     

    /Library/Server/Mail/Data/gldb

     

    Here you'll find those two databases as well as two other files:

     

    whitelist_domain  and  whitelist_host

     

    I had similar garbage in those files and you can use pico or vi or yourfavoriteeditor to access them and rewrite them with the info you'd like them to have.

     

    Stop the Mail services (so greylist.pl is inactive).

     

    Delete whitelist.db.

     

    Restart Mail services. The whitelist.db gets recreated and you're good to go!

     

    You can check that by running:

     

    serveradmin settings mail

     

    I'm off to go try creating blacklists to see if it works the same for those as well!

     

    Hope I helped.

     

    Pat

  • mikeschinkel Level 1 Level 1 (0 points)

    Thanks Pat, that totally helped.

     

    BTW, this post says to use this command:

     

    • sudo serveradmin settings mail:postfix:add_whitelist_domain = 'domain1.com,domain2.com,etc'

     

    Then this manual page says to delete like this:

     

    • web:Sites:_array_id:MySite = delete

     

    If appears both are wrong, correct?  I'm trying to verify if this is indeed correct:

     

    • sudo serveradmin settings mail:postfix:add_whitelist_domain = domain1.com
    • sudo serveradmin settings mail:postfix:add_whitelist_domain = domain2.com
    • sudo serveradmin settings mail:postfix:add_whitelist_domain = etc

     

    Which would mean that each domain goes on a line by itself. Is that correct?

  • blacksun Level 1 Level 1 (0 points)

    Although I am not home where I can check this I think that those commands just write to the above mentioned file(s). I believe that you can do single lines if you prefer or if you have multiple addresses to add, add them all at once in a comma delimited format when using the command line. The effect is the same when file gets parsed. When I added names manually to the file, I stuck to the format of each address being on its own line - IIRC.

     

    Dunno about the web:Sites:_array_id command you mentioned.

     

    Pat

  • mikeschinkel Level 1 Level 1 (0 points)

    Hi Pat,

     

    Thanks so much for the follow up.  You're the best!

  • Ben M. Level 1 Level 1 (0 points)

    Would deleting the whitelist.db file clear all of the "automatically" whitelisted domains? 

     

    For instance my file is semi large as I imagine over the past several days domains are being added to the .db file as they are confirmed.  If I delete that file and restart the mail services, the file goes to 0KB.  Does that mean, it's just forgotten about all of the greylisted domains it learned?

     

    Just wondering.

    Thanks for the help!!!

     

    Ben

  • Ben M. Level 1 Level 1 (0 points)

    Pat, did you ever figure out if black listing works?  If so, can you let me know what you did?

     

    Thanks!!

    Ben