dlevens
Members-
Posts
152 -
Joined
-
Last visited
Everything posted by dlevens
-
Makes perfect sense. I was a little confused because it appeared Bruce had somehow gotten this to work. But I see now that this is a setting by design at TCH for security reasons. I will use the good ole helpdesk for chown requests Thanks guys, Dennis
-
If I am the owner of the file and want to give away ownership to nobody then how would I do that? So far I am trying this script but it is failing chown.sh >#!/bin/sh cd /home/my_cpanel_userid/public_html/squirrelmail/plugins/change_passwd chown root:nobody chpasswd I have it in my cgi-bin directory with chmod 755 and trying to run via the web. Dennis
-
I hope this was the right forum for this question, but I cannot seem to find the exact version of RedHat that is running on server 74? Dennis
-
How To Schedule Cron Outside Of Cpanel? Via Php?
dlevens replied to dlevens's topic in CPanel and Site Maintenance
I saw a php script somewhere that you put your cpanel account and password into and it logged into cpanel for you and created a full backup request. Was hoping to build something similar that would still use cron jobs and cpanel but would login for me and create it then a follow up that would remove it. Dennis -
I am trying to find an easy way to run a cron job without having to login to cpanel click on cron and manually create it, then schedule it to run every minute, then delete it after it runs. I have a few scripts that I need to run once in awhile, but not on a consistant enough basis to put them on a schedule. I would like to have a way to just run something that would create the cron job and then after it runs delete it self. Maybe a php file? It would be nice if cpanel would add a config option where you did not need to schedule a cron but could instead just click a button to run it once. At least then I could just login real quick and click run once. Any help would be appreciated, Dennis
-
Mike or anyone, Is there a way to modify this script to tell cpanel to just backup a particular directory instead of a full backup? I have directory that I would like to backup often (like daily or every few days) and do not want to do a full backup as my site is large. I only need a full backup once a month or longer. Would be nice to just backup and zip one directory. Dennis
-
I want to backup and compress just one directory and all files inside it. Through cpanel I only have two choices, either backup everything or backup my entire homefolder. Anyone know how I can backup just one folder? I tried playing with gzip and tar but not sure what command to run to make this happen. Dennis
-
How To Install Squirrelmail - The Ultimate Guide
dlevens replied to dlevens's topic in Client Written Tutorials
Instead of making 15 scripts, put all the scripts into one file. Just add the other folders to be scanned like I have shown an example below (look at the blue text, and substitute for your actual folder names. saham.sh #!/bin/sh echo "Learning HAM" for FILE in `find $HOME/mail/****** -name inbox -print` do echo "Processing $FILE" sa-learn --showdots --ham --mbox $FILE done for FILE in `find $HOME/mail/****** -name folder1 -print` do echo "Processing $FILE" sa-learn --showdots --ham --mbox $FILE done for FILE in `find $HOME/mail/****** -name folder2 -print` do echo "Processing $FILE" sa-learn --showdots --ham --mbox $FILE done for FILE in `find $HOME/mail/****** -name folder3 -print` do echo "Processing $FILE" sa-learn --showdots --ham --mbox $FILE done for FILE in `find $HOME/mail/****** -name folder4 -print` do echo "Processing $FILE" sa-learn --showdots --ham --mbox $FILE done echo "Done" I currently have my script that way, but I would really like to build it so that it will run the ham script on all files except: spam, drafts, sent, trash. Like a condition or for loop. This way the script will work for my entire domain, and will run on each users mailbox and will avoid the folders where ham usually does not reside. If anyone knows how to write something like that it would be greatly appreciated. Dennis -
How To Install Squirrelmail - The Ultimate Guide
dlevens replied to dlevens's topic in Client Written Tutorials
phat, by root of your ftp I mean the first place you see when you login. This would be before the public_html i.e. /home/tchuserid/.mysqmail/public_html basically the same place that you already have the following folders: .spamassassin .mysqmail .sqmaildata .trash etc mail public_ftp public_html tmp Dennis -
How To Install Squirrelmail - The Ultimate Guide
dlevens replied to dlevens's topic in Client Written Tutorials
I like that option. Time to learn me how to code in PHP. Running the scripts via cron give me an email with the results so will definately want the code to report back to the webpage. Would be sweet to have a secure website where I can just login in an run when I have my ham and spam ready for processing. To go one step further do you know how to modify my scripts to so that the ham script will run against all files except (spam, sent, trash, draft)? The spam script is pretty much ready to go since I only use one spam folder for spam. I know I cam modify the ham script to do what I want, I just don't know enough about shell scripting to do it. Would be nice, because now I have to make 15 scripts for the 15 folders I use for ham files. Dennis -
How To Install Squirrelmail - The Ultimate Guide
dlevens replied to dlevens's topic in Client Written Tutorials
For most users the cpanel squirrelmail at http://www.******/webmail which runs on port 2095 or the sqmail at http://www.******/sqmail which runs on port 80 will be more than enough. But like nate said, if you require plugins that are not installed on the serverwide install from TCH or if you need features that are only available in the newer versions of squirrelmail, then a stand alone install is your best bet. I like to stay on the bleeding edge of squirrelmail releases and I want a ton of plugins to offer my users so I prefer my own install. I also like to control all the default settings for new users. Dennis -
Squirrelmail Settings - Do I Have These Right?
dlevens replied to dlevens's topic in CPanel and Site Maintenance
I put together an all in one guide to set this all up, as well as the perfect spam solution and how to automate it all with cron jobs. Check it all out here http://www.totalchoicehosting.com/forums/i...showtopic=11452 Dennis -
Well it is about time for me to start giving back to TCH and this great community. After about a month of trial and error I believe I have compiled everything you need to know to setup your own squirrelmail install as well as what I found to be the ultimate way to fight spam using cPanel Spam Assassin. INSTALLING SQUIRRELMAIL: note: items in bold require you to modify to match your own info 1. Download a stable version from http://www.squirrelmail.org/download.php 2. Unpack and upload the contents to /public_html/squirrelmail 3. Create a folder in your ftp root called .mysqmail 4. Create a data and tmp folder inside .mysqmail (i.e. /.mysqmail/data & /.mysqmail/tmp) 5. Using File Manager from cPanel modify the three folders you made as follows: .mysqmail (chmod 777) data (chmod 770) tmp (chmod 730) 6. Make sure and copy the default_pref from the data folder that came with your squirrelmail package over to your new data folder that you made in step 5. Note: Step 7 is optional. As long as you created your data directory from step 3 & 4 in the location specified or at least above the public_html folder you can skip this step. 7. Create a helpdesk ticket and ask them to run the following commands: cd /home/tchuserid/.mysqmail chown -R nobody data chown -R nobody tmp chgrp -R nobody tmp 8. Go to your squirrelmail files that you extracted and uploaded to /public_html/squirrelmail and go the config directory. Copy config_default.php and rename to config.php then edit this config.php file to match the items below. Make sure and change the bold items to match your info. $domain = 'companyname.com'; $useSendmail = true; $smtpServerAddress = 'localhost'; $smtpPort = 25; $sendmail_path = '/usr/sbin/sendmail'; $imapServerAddress = 'localhost'; $imapPort = 143; $imap_server_type = 'uw'; $use_imap_tls = false; $use_smtp_tls = false; $smtp_auth_mech = 'none'; $imap_auth_mech = 'login'; $optional_delimiter = 'detect'; $pop_before_smtp = false; $default_folder_prefix = ''; $show_prefix_option = false; $default_move_to_trash = true; $default_move_to_sent = true; $default_save_as_draft = true; $trash_folder = 'INBOX.Trash'; $sent_folder = 'INBOX.Sent'; $draft_folder = 'INBOX.Drafts'; $auto_expunge = true; $delete_folder = false; $use_special_folder_color = true; $auto_create_special = true; $list_special_folders_first = false; $default_sub_of_inbox = false; $show_contain_subfolders_option = false; $default_unseen_notify = 2; $default_unseen_type = 1; $noselect_fix_enable = false; $default_charset = 'iso-8859-1'; $data_dir = '/home/tchuserid/.mysqmail/data'; $attachment_dir = '/home/tchuserid/.mysqmail/tmp'; $dir_hash_level = 0; $default_left_size = '150'; $force_username_lowercase = true; $default_use_priority = true; $hide_sm_attributions = true; $default_use_mdn = true; $edit_identity = false; $edit_name = true; $allow_thread_sort = false; $allow_server_sort = false; $allow_charset_search = true; $uid_support = true; $session_name = 'SQMSESSID'; YOUR DONE! SETTING UP SPAM ASSASSIN WITH AUTOLEARN AND BAYES 1. From cPanel click on Spam Assassin and enable both the Spam Assassin and the Spam Box. 2. Using File Manager from cPanel edit the user_prefs file located here: /.spamassassin/user_prefs Make the file match this info: auto_learn 1 ok_languages en ok_locales en report_safe 1 required_hits 8 rewrite_subject 0 skip_rbl_checks 0 subject_tag *****SPAM***** use_bayes 1 use_dcc 1 use_pyzor 1 use_razor2 1 use_terse_report 0 note: if you edit this file any other way you need to use a program like textpad and make sure and save it in UNIX ANSI format. PC format or DOS will mess things up. There should not be a need for whitelists and blacklists anymore, instead just train spam assassin (shown below) to know what is spam and what is not. After making these changes if you go to modify the spam assassin configuration via cPanel and then save the changes, for some odd reason cPanel will duplicate every line in this file. If you save again it will triplicate it. So I recommend you only add to your white and black list using file manager or textpad. OR back up this file, then make your change in cPanel and then edit it again in file manager or textpad and remove the duplicates. For those of you who have played with Spam Assassin and noticed we do not have many options from cPanel, you will immediatly notice we can turn on auto learn and bayes filtering by doing it this way. This will give you a very powerful Spam filter that learns. Another option to editing the file manually is using this utility to have it make one for you http://www.yrex.com/spam/spamconfig.php 3. Send yourself an email and view the header. You will now see Spam Assassin is working. Do not get confused if you see autolearn=no in the header. This is normal. It does not mean Spam Assassin autolearn is not on, it only means that the message did not meet the point level to be learned or it has already learned that message. HOW TO TEACH SPAM ASSASSIN WHAT IS SPAM AND WHAT IS NOT 1. Using textpad or File Manager create two shell scripts in your /public_html/cgi-bin/ folder: saham.sh #!/bin/sh echo "Learning HAM" for FILE in `find $HOME/mail/****** -name inbox -print` do echo "Processing $FILE" sa-learn --showdots --ham --mbox $FILE done echo "Done" saspam.sh #!/bin/sh echo "Learning SPAM" for FILE in `find $HOME/mail/****** -name spam -print` do echo "Processing $FILE" sa-learn --showdots --spam --mbox $FILE rm $FILE touch $FILE chmod 660 $FILE done echo "Done" 2. After you copy your two scripts to the cgi-bin folder, make sure you chmod both files to 755 or they will not run. 3. Note: the ham script will teach spam assassin what you think is good email. In the script we have it looking at every inbox file in your mail directory for your entire domain. So if you have 40 email accounts every single inbox file will be read. This script can be modified to look for other folders if you use them. For instance I use a folder called bills and one called personal. I could change inbox to bills or personal and have Spam Assassin learn those. You want to make sure that only good emails and NO spam reside in the folders you run with the ham script. Also know that you can run it on the same emails twice and Spam Assassin is smart enough to know it has learned them already and will look at them but will not learn any more from them. This is good if you do not archive your email for a long time, because you can run your script weekly and not have to worry that already learned email will be seen. 4. Now also note the spam script. This script will only work if you turned on Spam Box from cpanel, or if you manually create a spam folder. If you manually create a spam folder and call it something else, just change the name in the script to match. Any spam that spam assassin catches on its own will already be learned and put in the spam folder so this script is a little redundant. But the benefit comes from the email spam assassin misses. All you do is move them to the spam folder and then run the script and force spam assassin to learn that you think they are spam. NOW PLEASE NOTE! the two lines in red are dangerous. They will delete the entire spam file and all email in it and then create a new spam file. If you do not want your spam to be deleted by the script just remove those two lines. I use them because once spam assassin has seen them and learned from them I want them deleted anyway. This is nice because they are deleted and a new spam folder is created and ready to go. 5. To automate all of this just create a cron job that runs those scripts on a weekly basis or daily or whatever you need. HOW TO CREATE A CRON JOB TO RUN YOUR SCRIPTS - Login to cPanel - Click on Cron Jobs - Click on Standard - In the "Command to run:" field type the path to your script: /home/yourcpaneluserid/public_html/cgi-bin/saspam.sh - Choose the times you want this to run: Minute: 0 Hours: 22 Days: Every Day Months: Every Month Weekday: Monday The above is just an example that if used your script will run every Monday at 10pm SERVER TIME. The server may not be in or set to the same time zone as you are. Best way to verify is to upload a file to your ftp and compare the timestamp. This way you can make sure that the scripts run when you intended them to run. For me the script above actually runs at 5am my time since the server is 7 hours ahead of me. 6. Click on Save Crontab After setting things up like this, 95+ % of your spam should be caught. And ad each day goes buy and the more you teach SA what is spam and what is not that number will only go up. If you have a ton of good email and a ton of spam you can force Spam Assassin to learn both and you will be that much further ahead. Anyway, just my two cents. I hope this helps. Dennis Levens This posted was last edited on July 20th 2004. As this thread grows I will try and modify my original post to add missing items and correct any mistakes.
-
Squirrelmail Settings - Do I Have These Right?
dlevens replied to dlevens's topic in CPanel and Site Maintenance
nate, all of the files in the mail folder could have been created by the cpanel webmail or your install or even the www.****/sqmail on port 80. All 3 use the same directory to store mail. Be careful because if you delete inbox then sure your next login will recreate it but you will have lost all of the email inside it. As far as security below public_html I am not sure. I would assume the only people who have access there are people you give ftp access to assuming you give them root access and people at tch. Dennis -
Squirrelmail Settings - Do I Have These Right?
dlevens replied to dlevens's topic in CPanel and Site Maintenance
nate by default the folder prefix starts at mail. I think if you had your path correctly identified it would have worked. You would have needed /home/tchuserid/mail/ If you mean by getting rid of, that you no longer want webmail to point to the default cpanel webmail of 3 choices, then I think you can do this via the helpdesk. Submit a ticket asking them to delete the forward they have setup for your domain. Dennis -
Squirrelmail Settings - Do I Have These Right?
dlevens replied to dlevens's topic in CPanel and Site Maintenance
Mike, Thanks for the clarification. I must admit, I sorta threw out that fish line hoping you would respond. From my experience reading these forum I have become impressed with your responses. Thanks for outstanding support and keep up the great work. Very much appreciated, Dennis -
Squirrelmail Settings - Do I Have These Right?
dlevens replied to dlevens's topic in CPanel and Site Maintenance
I use the following for my set up: $trash_folder = 'Trash'; $sent_folder = 'Sent'; $draft_folder = 'Drafts'; or default should be: $trash_folder = 'INBOX.Trash'; $sent_folder = 'INBOX.Sent'; $draft_folder = 'INBOX.Drafts'; Keep in mind the location where it is trying to make the inbox.sent folder is the same location used by the default webmail from cpanel. /home/tchuserid/mail which account are you using? are you using the main tchuserid to login? Try making a new mailbox and loging in with that to see if it is a folder permission issue for mail directory or if it is a file issue. It could be that the inbox.sent is already made but your install of sqmail does not have rights. Dennis -
Squirrelmail Settings - Do I Have These Right?
dlevens replied to dlevens's topic in CPanel and Site Maintenance
It is so odd that I do not get emails telling me people have replied to this thread??? I always put a check in enable notification of replies but sometimes I get them and sometimes not. Is this because you only get an email if you were the last person to post and someone adds a reply? I hope it is setup so that any replies to the entire thread and you are notified. Anyway, on to my reply: First off, I swear I get a different answer everytime I ask the question about what IMAP we use at TCH. Sujit from the help desk said we are using Courier IMAP, another post said we were using other, and a few have said uw. So far I have no figured out a way to verify this 100% so will go with MikeJ and say UW is the setting we need. after many trials and errors I believe I have it worked out. Here are the settings you should use: Note the BOLD are changed items $domain = 'companyname.com'; $useSendmail = true; $smtpServerAddress = 'localhost'; $smtpPort = 25; $sendmail_path = '/usr/sbin/sendmail'; $imapServerAddress = 'localhost'; $imapPort = 143; $imap_server_type = 'uw'; $use_imap_tls = false; $use_smtp_tls = false; $smtp_auth_mech = 'none'; $imap_auth_mech = 'login'; $optional_delimiter = 'detect'; $pop_before_smtp = false; $default_folder_prefix = ''; $show_prefix_option = false; $default_move_to_trash = true; $default_move_to_sent = true; $default_save_as_draft = true; $trash_folder = 'INBOX.Trash'; $sent_folder = 'INBOX.Sent'; $draft_folder = 'INBOX.Drafts'; $auto_expunge = true; $delete_folder = false; $use_special_folder_color = true; $auto_create_special = true; $list_special_folders_first = false; $default_sub_of_inbox = false; $show_contain_subfolders_option = false; $default_unseen_notify = 2; $default_unseen_type = 1; $noselect_fix_enable = false; $default_charset = 'iso-8859-1'; $data_dir = '/home/accountname/foldername/data'; $attachment_dir = '/home/accountname/foldername/squirrelattachments'; $dir_hash_level = 0; $default_left_size = '150'; $force_username_lowercase = true; $default_use_priority = true; $hide_sm_attributions = true; $default_use_mdn = true; $edit_identity = false; $edit_name = true; $allow_thread_sort = false; $allow_server_sort = false; $allow_charset_search = true; $uid_support = true; $session_name = 'SQMSESSID'; Your data and attachments are in the best place for security. IF for some reason you wanted them in the default locations of /data where you installed squirrelmail you would use this as the path $data_dir = SM_PATH . 'data/'; making note that all SM_PATH means is start where squirrelmail is installed and go from there. Otherwise you use the absolute path starting from the root using as you did /home/tchuserid/.mysqmail/data As far as I can tell TLS will not work for authentication for either IMAP or SMTP which is the main reason you are having issues. And from what I can gather SMTP authentication is none and IMAP is login. I am not sure why this is because when setting up your users on outlook express you have to use authentication for smtp to work. Maybe this is because on squirrelmail it is already here on the server and thus does not need authentication on the install side of things. In either case I am still playing with the cmod, chown and chgrp settings to get things to work with the most security. having your data and attachments below the public_html directory will make a huge difference for security. For now I am folloing this for my security squirrelmail folder is default no changes made data chown -R nobody data attachments chown -R nobody attachments chgrp -R nobody attachments for chmod /home/tchuserid/.mysqmail (777) /home/tchuserid/.mysqmail/data (770) /home/tchuserid/.mysqmail/attachments (730) The only problem with this setup is you cannot directly modify or even view the files in the data directory. They can only be deleted. If you want to edit them you have to do it through squirrelmail. I am still trying to see if there is a way to give nobody the rights it needs to run but still give my tchuserid the ability to edit the files. Someone this is working without how tch setup our server wide cpanel install of squirrelmail from cpanel. Because my .sqmaildata is actually owned by my tchuserid and I am listed as group and owner. But when I set my stand alone install like this it wont work. I have to give the world 777 permissions to everything to get by. Anyway, hope this helps you get moving. Dennis -
Ahhhhhh, so that is why it is not working Thanks for the heads up. Dennis
-
Hey guys, hopefully this is the right place to ask this question. I am trying to right a shell script to run via a cron job that will change the owner ship of a folder and files. So far I have created the following script (/public_html/cgi-bin/chown.sh) in Unix ANSI format. CHMOD is 755 Currently the owner and group is 99 I would like to make my userid the owner of this directory. I am installing a stand alone copy of squirrelmail and everything is working but I cannot view or modify the files in the data directory since 99 is the owner and group and there is no public view rights. I want to make this data folder similar to the default data folder we use for webmail. This way I can edit and view the data files. I think my script is written wrong but I do not know enough about this to know where I messed up. Any pointers would be appreciated. Dennis
-
Squirrelmail Settings - Do I Have These Right?
dlevens posted a topic in CPanel and Site Maintenance
I noticed that cPanel lists sendmail at /usr/sbin/sendmail and wanted to know if the server wide install of squirrelmail uses sendmail or SMTP? I have it working on SMTP but read that sendmail was the recommended way of doing it? I am also not sure what type of IMAP server we use here. Is it (courier, cyrus, exchange, uw, macosx or other?) Can you take a look at these settings and see if they look correct for a stand alone squirrelmail setup here? BTW I am using squirrelmail 1.4.3.a $useSendmail = false; $smtpServerAddress = 'localhost'; $smtpPort = 25; $sendmail_path = '/usr/sbin/sendmail'; $imapServerAddress = 'localhost'; $imapPort = 143; $imap_server_type = 'courier'; $use_imap_tls = true; $use_smtp_tls = true; $smtp_auth_mech = 'login'; $imap_auth_mech = 'login'; $optional_delimiter = 'detect'; $pop_before_smtp = true; Thanks, Dennis Levens -
Script Or Plugin To Read Quota For Cpanel Email
dlevens replied to dlevens's topic in CPanel and Site Maintenance
Thanks, I tried that plugin and the other one and cannot get them to work. I don't think TCH has the extension on and I don't think they run courier IMAP. I have asked around but so far no replies. Dennis -
Yeah I had the same question, not sure how to help it out. The configuration options we have are very limited. I am curious if anyone has installed any of the squirrelmail plugins that are supposed to give a frontend to spamassasin's settings? There are 2 or 3 of them here: http://www.squirrelmail.org/plugins_catego...p?category_id=3 Dennis
-
Mike, How is the SA guide coming? Dennis
-
After many days trying to get a plugging that shows quota usage for users mailboxes inside squirrelmail, I have come to the conclusion that nothing exists that works with cPanel to do this. I want to provide my users the ability to see from their squirrelmail how much quota they have used. Can someone write a script or pluggin that will work here at TCH for squirrelmail? The info is already posted in your cPanel if you click on manage accounts and then disk quota taking you here: http://******:2082/frontend/bluela...tml?extras=disk I attached a screenshot of what I am trying to offer. Dennis