apt get life

Life around technology

  • Technology
    • Guides
    • Linux
    • Development
      • Laravel
    • Misc
    • Raspberry Pi
  • Writing
  • Crafts
    • Crochet
    • Model Making
    • Painting
  • Privacy Policy
You are here: Home / Archives for sudo

Setting email quota in Courier-MTA

2011/03/22 by sudo

If you’re receiving errors along the lines of:
456 Address temporarily unavailable.
Or
maildrop: maildir over quota.
Or
status: deferred

It’s likely that the mail box in question has run out of storage space. In my experience this is usually due to the user not sorting through their emails and deleting old ones, and in one case there was hundreds of megabits in the .Trash folder that had simply not been emptied.

In order to increase the mail directory’s quota for the user in question, you need to run the following command from inside the users directory:
maildirmake -q 500000000S,1000000C ./Maildir

this will allow 500MB of Storage to be used, or 1000000 Correspondents (or emails) to be stored on their mail directory, whichever comes first.

After running this command you’ll need to restart the mta
/etc/init.d courier-mta restart

and make sure that the cache of problem email addresses is cleared:
courier clear all

Filed Under: Guides, Technology Tagged With: Courier MTA, Mail Quota

Simple Single Interface Squid Proxy

2011/01/07 by sudo

This is a brief introduction to Squid proxy that covers Setting up Squid on Ubuntu/Debian with a single network card, and routing traffic through it. I use this for testing websites remotely before putting them live, but it would also be possible to setup a similar box to monitor network traffic.

Before you begin you should have a computer setup with Ubuntu/Debian. I am using Ubuntu 10.04 LTS for my proxy. The rest of these instructions will assume that this is installed and configured on your network as you want it. Also note that Debian users should su to root instead of typing sudo.

1. Get squid

First thing’s first, we need to get squid. This can be achieved by typing the following into  the terminal:

sudo apt-get install squid

This will download squid from the repositories and set it up on your machine.

2. Setup Squid

This is easy if you know what you’re doing. The squid config file is in the /etc/squid/ directory, so open it up in a text editor:

sudo nano /etc/squid/squid.conf

Now we need to add the lines to allow access to your network. If you’re in nano you can use

Ctrl+w and type acl all src all

Since I’m setting this up as a remote server I have to allow my IP address for work to be able to access the proxy. Here’s the lines I added:

acl remotenet src 123.123.123.123 #Work’s external IP address

If you don’t know your external IP address go to: sirnet.co.uk/ip.php

further down the script there’s a line that reads http_access allow localnet, under this line add:

http_access allow remotenet #allow connections to this proxy server from “remotenet”

Understanding this process

ACL is an access control list, which you’re assigning IP addresses to. in the above two lines you’ve allowed the IP address 123.123.123.123 access to the proxy server. You can continue adding IP addresses to the remotenet group my copying and pasting the first line you entered but with different IP addresses.

At the end to the file you’ll also need to add the following line of code:

visible_hostname someProxyServerName

Exit and save the squid.conf file by pressing Ctrl+x and pressing Y when asked if you want to save changes, followed by enter to overwrite the file.

restart squid: sudo service squid restart

3. Setting  Up Your Web Browser

You should now be able to access your server by setting the proxy details up in your browser as the following:

Proxy: your squid IP address/DNS name

Port: 3128

Filed Under: Guides, Technology Tagged With: proxy server, squid

Auditing Postfix, Adding sender BCC to monitor outgoing email

2010/10/31 by sudo Leave a Comment

copy sent mail to inbox in postfix

My scenario is this: A customer has hosted email with me, and they had a problem with one of their members of staff. They suspected he was emailing confidential information to third parties. As a result they wanted all emails inbound and outboud forwarded to one of their senior managers for review without the member of staff knowing. I run a system using postfix, so it’s quite simple to setup the inbound redirects.

Inbound Redirects (aliases) in postfix

Inbound redirects in postfix should be very straight forward. You’ll already have a /etc/postfix/virtual file.

Edit the /etc/postfix/virtual file and find the email account you want. Then change the line so has the detectives mailbox after the suspects. My file looks like the example, but depending on your setup it might be slightly different. The important thing is to leave the suspect in both places and simply add a comma followed by your detectives details in the same format.

#Emails to this address #Go to these inboxes (seporate by comma)
suspect@domain.com suspect@domain.com, detective@domain.com

Save the file, you might need to run the postfix reload command to make this work.

Inbound Redirects (aliases) in Courier MTA

Courier MTA operates in a similar way when setting up inbound redirects, so I thought I’d detail that for you too. You’ll need to edit /etc/courier/aliases/domain.com so make a backup for it first!

Edit /etc/courier/aliases/domain.com and find the line with suspect@domain.com in it. The way this file works is that it takes the email address on the left and sends it to the place on the right, in my case that’s the Maildir folder for that user

#Emails to this address #go to these folders
suspect@domain.com suspect, detective

You’ll probably need to restart the mta in order for it to recognise the new entries file.
Update: You’ll need to run makealiases to get this to work!

Outbound Auditing sender BCC in postfix

This doesn’t work on older versions. We will need to edit the /etc/postfix/main.cf file and create a /etc/postfix/sender_bcc file. As always make a backup of the files we’re editing first, incase it all goes wrong! (cp /etc/postfix/main.cf /etc/postfix/main.cf.old)

Edit the /etc/postfix/main.cf file and add the line:
sender_bcc_maps = hash:/etc/postfix/sender_bcc

Create the file /etc/postifx/sender_bcc

#emails from #BCC to
suspect@domain.com detective@domain.com

You then need to run the commands:
postmap /etc/postfix/sender_bcc
postfix reload

Filed Under: Guides, Technology Tagged With: auditing, email, Postfix

Mounting a SMB filesystem in Xubuntu & Ubuntu

2010/09/05 by sudo

Although this guide tells you how to mount SMB file systems over the network in Xubuntu, it will also work for Ubuntu and similar Debian based Linux distributions.

Fellow users of Xubuntu may have noticed that the file manager doesn’t support viewing samba shares in the same way that Ubuntu’s file manager does. This functionality used to exist, however they changed the filemanager used around 8.10. In order to view samba shares, you must therefore mount them on your system.

Mounting Samba Shares

1. Create a folder to mount your Samba share

sudo mkdir /media/music

sudo runs the command as root, mkdir tells the system to make a directory and the rest is the path you specify, I usually mount things in the /media/ directory but you can just as easily mount them in your /home/username directory.

2. Editing the fstab so it loads on boot

This file contains information on your disk partitions and you shouldn’t change anything that already exists!
sudo nano /etc/fstab

In the fstab file you will need to enter a line similar to the following:

\SAMBASERVERShareName /media/music smbfs user=username,passwd=password 0 0 

The left part indicates the server the share is hosted on, followed by where it should be mounted to in your file system, you then need to tell it that it’s a samba filesystem. If you have a username or password to view the share, enter it – if not use the line below. One word of warning – usernames and passwords stored in the file are in cleartext, it’s highly advisable that on your samba server you create a new user with limited privellages to restrict access.

\SAMBASERVERShareName /media/muisic smbfs 0 0 

save the file.

3. Run the mount command

sudo mount /media/music

this will lookup what should be mounted in the fstab file, it should then allow you to view the contents of the folder in /media/music in the Xubuntu filesystem as if it were on your local machine.

4. It didn’t work! (wrong mount type, bad option, bad superblock on…)

this means you need to run the additional command:

sudo apt-get install smbfs

This will install the samba filesystem package on your system, simply re-run the mount command when you’ve got this package and all should work!

5. It still didn’t work!

If you’re getting the error:
retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

This means that your share cannot be located or cannot be logged into with the current credentials.

Try using the samba client list command:
smbclient -L ServerName

This will give you an output indicating what shares are available to connect to on the defined server. if your share isn’t found, then you’ll need to reconfigure the /etc/samba/smb.conf file on the server to enable the share you’re looking for, or use a different share name in your clients /etc/fstab file.

If your share is in that list then you need to make sure that samba references the correct directory (ie login to the server and do an ls of the directory that you’re trying to connect to to see if it exists).

Filed Under: Guides, Technology Tagged With: network shares, samba, smb, smbfs, xubuntu

7z (7zip) errors with unsupported method message

2010/08/11 by sudo

When trying to extract a .rar file with 7zip I encountered an error about an unsupported method. The directory contents of the file were listed, however it wouldn’t extract the files. After alittle reserach I discovered you required the following apparently unreleated plugin: p7zip-rar

sudo apt-get install p7z-rar

after installation, re-run your 7zip command and it will work fine

7z x filename.rar

This applies to 7-zip on Ubuntu and Debian distributions. It may also work for other distributions, however it has not been tested.

Install the full version of 7zip with the rar extensions

To install the full version of 7zip, including the p7zip-rar package to solve the unsupported method error when extracting .rar files use the following command:
sudo apt-get install p7zip-full p7zip-rar

Filed Under: Guides, Technology Tagged With: 7z, 7zip, Linux

  • « Previous Page
  • 1
  • …
  • 12
  • 13
  • 14
  • 15
  • Next Page »

Recent Posts

  • System Hang on Ubuntu 24.04 “e1000_print_hw_hang”
  • Disable iLO on HP Microserver Gen8
  • Ubuntu Desktop 24.04 Change Wallpaper Settings
  • Customising Ubuntu Desktop 24.04
  • Remove domains from Let’s Encrypt using Certbot

Tags

API auditing crochet data recovery debian debudding development Dingo API docker email Getting started with Laravel 5 & Dingo API hard drive health HP Microserver KVM Laravel larvel 5 lenovo Linux Minion mint netgear nas networking network shares php PHP development Postfix raspberry pi review samba security SMART smartctl smartmontools smb testing traefik ubuntu ubuntu 18.04 ubuntu 20.04 ubuntu 22.04 ubuntu server vagrant Virtual machines xdebug xubuntu

© Copyright 2015 apt get life