Indra Satriani

I'm not a geek!

Archive for the ‘linux’ Category

Limit Email Size Per User In Exim

I’ve been searching on google for a while and found very few references regarding this, even in the exim user mailing list. Or its just me whose not lucky enough to get the answer. I finally stumbled on a post in a forum dated few years ago, explaining little script to get what I wanted to do, which hasn’t even been tested before. So I took the liberty to test that script on my working environment production. And now it worked beautifully just as I wanted.

Basically, you only need 2 steps to do this: add the code snippet; and create a file contains a list of users. Put this code inside the router section of your Exim config file:


reject_if_too_big:
driver = redirect
domains = customer.domain.com
condition = ${if > \

{$message_size}{${lookup{$local_part}lsearch{/etc/messagelimit}{$value}{5M}}}
\
{yes}{no}}
allow_fail
data = :fail: message too big.

Change the domain name and default value according to your need, and if you have a line that says:

message_size_limit = 50M

in your config file, comment that line out, because this could override the value settings in the script above. Save and restart Exim.

Next is to create a /etc/messagelimit file that contains all the users you want to give different size. Example:

user1  10M
user2  20M
user3  30M

This means all the users not listed in this file will only able to send or receive maximum 5MB email include the attachment. No need to restart Exim after adding or removing user to this file. Good luck!

Written by Indra Satriani

October 14, 2011 at 6:51 pm

Posted in linux, tech

mount error(13): permission denied

leave a comment »

Most of people got this Permission Denied access when mounting a
Windows Shared folder

following mounting ->

usually : mount -t cifs //<MachineName>/<Shared Folder> /mnt/Shared -o username=<username>,password=<password>
give you error 13.

correct : mount -t cifs //<MachineName>/<SharedFolder> /mnt/Shared -o username=<DomainName>/<username>,password=<password>

Yes! the only difference is “domain name:<DomainName>” is missing. In case of No Domain try to put your <MachineName> there.
cifs does not locate domain itself (I guess).

Source: http://is.gd/gR1L4

Written by Indra Satriani

November 9, 2010 at 11:25 am

Posted in linux

[Samba] getpeername failed. Error was Transport endpoint is not connected

with 2 comments

nss_wins[31684]:   getpeername failed. Error was Transport endpoint is not connected

If you have something like that in your log, that is because the Windows client attempting to connect to samba on ports 445 and 139.

the XP Pro PC Client attempts to initially communicate with the
server over both ports 445 and 139 and that whichever port responds first
is used for further communication.

http://groups.google.com/group/linux.samba/msg/370a5eaded746ab2?pli=1

The workaround is either you disabled port 445 via iptables like the solution in here or simply by adding this line on your [global] stanza inside smb.conf

smb ports = 139

Edit:
Adding “smb ports = 139” may decrease your samba share performance. If you’re ok with that error above filling up your log, then its not necessary to add smb ports in your smb.conf. Your choice 🙂

Written by Indra Satriani

September 30, 2010 at 10:33 am

Posted in linux

Tagged with , ,