Selcuk's Blog

Çarşamba, Mayıs 28, 2014

Sieve and managesieve on redhat EL 6 with Dovecot 2.0.9


Last time , I applied LDA deliverey on our MTA instead of procmail.

let's try to add sieve funtions to dovecot.


first, stop everything :)


# service stop postfix

# service stop dovecot


after that you must install dovecot pigeonhole with



yum install dovecot-pigeonhole



after that, go to dovecot/conf.d directory.
1. Edit your 15-lda.conf file and 
uncomment plugins parameter in protocol lda seciton:



mail_plugins = $mail_plugins sieve 


We have aditional two files in here for sieve configuration, 20-managesieve.conf and 90-sieve.conf.

2. Go to 90-sieve.conf file and edit parameters below:

sieve = /var/sieve-scripts/%u.sieve
sieve_dir = /home/vmail/domains/sieve/%n/.sieve
Note:
 %u user     full username (e.g. user@domain)
 %n username user part in user@domain, same as %u if there's no domain
 %d domain   domain part in user@domain, empty if user with no domain

3. In 20-managesieve.conf file uncomment

  protocols = $protocols sieve

and 

 inet_listener sieve {
    port = 4190


  }
lines and add this parameters end of  file
plugin {
  # Used by both the Sieve plugin and the ManageSieve protocol
  sieve = /var/sieve-scripts/%u.sieve  
  sieve_dir = /home/vmail/domains/sieve/%n/.sieve
}


* Our mail_location is mbox:/home/vmail/domains/%d/%u and there is no mail_home config parameter. Home directory is come form OpenLDAP field (Jamm schema)

and scripts folder is like this.
drwxr-xr-x 2 vmail vmail 4096 May 28 14:43 /var/sieve-scripts 

And start everything
# service start postfix
# service start dovecot

I suggest , you must do change delivery method to LDA , so after that install sieve things. If you have any webmail interface like roundcube, afterlogic , you can install managesieve plugin or filter plugin than you can start create your filters.

Cuma, Mayıs 23, 2014

Convert mail delivery from Procmail to Dovecot 2.0.9 on Redhat EL 6


Maybe you installed this like MTA system

http://wanderingbarque.com/howtos/mailserver/mailserver.html

or

http://www.stefan-seelmann.de/wiki/mailserver-postfix-dovecot

So i installed this MTA system but our delivery method remained procmail. Last two days i try to change delivery system promail to dovecot, after thart i installed dovecot-pigeonhole sieve manager, so users can create their own filters or etc. Before that there is no need just like these thing , everybody is happy.

HowTo :

first stop everything,

service stop postfix
service stop dovecot

ok these are steps of procmail to dovecot

1. in main.cf

change mailbox_command to

mailbox_command = /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT"


change virtual_transport to 
virtual_transport = dovecot
and add
dovecot_destination_recipient_limit = 1

2. in master.cf

dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}

in this example our user is vmail you must change with your own.


3. in dovecot/conf.d/15-lda.conf  add log file values
protocol lda
{
  log_path = /var/log/dovecot-lda-errors.log
  info_log_path = /var/log/dovecot-lda.log
  debug_log_path = /var/log/dovecot-lda-errors.log
}
maybe all these log values are not neccessary but it works :) i didn't touch them.

4. in dovecot/conf.d/10-master.conf uncomment mod and user, remember vmail is our user in here

service auth {
  # auth_socket_path points to this userdb socket by default. It's typically
  # used by dovecot-lda, doveadm, possibly imap process, etc. Its default
  # permissions make it readable only by root, but you may need to relax these
  # permissions. Users that have access to this socket are able to get a list
  # of all usernames and get results of everyone's userdb lookups.
  unix_listener auth-userdb {
    mode = 0600
    user = vmail 
    #group = 
  }


finally start everything 

service start postfix
service start dovecot

that's it.

i hope helps someone else.

Çarşamba, Kasım 20, 2013

BIND DNS Subdomain Settings For Office 365

When you have BIND DNS server with subdomains, and you want to add Office 365 e-mail server settings one of the subdomains, you need add to records below in your master zone dns file.
;
; Microsoft Office 365
;
mysubdomain.domain.com.tr.         IN      MX             0 mysubdomain-comain-com-tr.mail.protection.outlook.com.

mysubdomain.domain.com.tr.         IN      TXT             "v=spf1 include:spf.protection.outlook.com -all"

 autodiscover.mysubdomain.domain.com.tr.    IN      CNAME   autodiscover.outlook.com.

sip.mysubdomain.domain.com.tr.     IN      CNAME   sipdir.online.lync.com.
lyncdiscover.mysubdomain.domain.com.tr.    IN      CNAME   webdir.online.lync.com.
;
; Microsoft Lync Online
;
_sip._tls.mysubdomain.domain.com.tr.        IN      SRV 100 1 443 sipdir.online.lync.com.
_sipfederationtls._tcp.mysubdomain.domain.com.tr.   IN      SRV 100 1 5061 sipfed.online.lync.com.
msoid.mysubdomain.domain.com.tr.   IN      CNAME   clientconfig.microsoftonline-p.net.
;



Pazartesi, Ekim 07, 2013

SQL Server Index Fragmentation Monitoring

Hi,

This is the very simple monitoring command for sql server. Of course you must create a mail profile.


DECLARE @xml NVARCHAR(MAX)
DECLARE @body NVARCHAR(MAX)

SET @xml = CAST(( SELECT Object_name(object_id) as 'td',s.name as 'td1'
,LTRIM(Str(avg_fragmentation_in_percent, 25, 3)) as 'td2'
FROM sys.dm_db_index_physical_stats (DB_ID('AdventureWorks2012'), NULL, NULL , NULL, 'LIMITED') d
join sysindexes s on d.object_id = s.id
and d.index_id = s.indid
and avg_fragmentation_in_percent > 30 and s.name is not null
FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))

SET @body =' < html >< body >< H 3>Index Fragmantetion Results< / H3 >
< table border = 1 >
< tr >
< th > Table Name < /th> Index Name < /th> Avg. Rate  < /tr >'    

SET @body = @body + @xml +'< /table>< /body>< /html>'
SET @body = REPLACE(@body,'td1','td')
SET @body = REPLACE(@body,'td2','td')

EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'dbmail', -- you have to create this
    @recipients = 'mail@mail.com.tr',
@body = @body,
    @body_format ='HTML',
--@execute_query_database='AdventureWorks2012', --maybe necessary
    @subject = 'Index Monitoring' ;

Salı, Nisan 19, 2011

PDFCreator AutoSave Folder Reset at Windows 2008 R2

Just Set

Under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PDFCreator\Program Key SEt Auto-Save folder value.


Pazartesi, Mart 14, 2011

Simple OnAccess Scan Solution For Clamav in Redhat

Clamav is powerfull antivir solution for linux. But if you wantto add onaccess scan functionality of clamav you maus re-compile your kernel with DazukoFS. I think it is quite diffucult process for running systems.


There is another alternative for this with inotify tools. Here is the steps;

1. Instal ClamAv for linux.
2.Install intotify tools for linux
2.1. wget http://sourceforge.net/projects/inotify-tools/files/inotify-tools/3.13/inotify-tools-3.13.tar.gz/download
2.2 goto inotify source inotifywait.c line 310
2.3 add this lines before " fflush( NULL );" atom

static char * scanfiles;
nasprintf( &scanfiles, "%s%s",inotifytools_filename_from_wd( event->wd ), event->name );
char command[1000];
strcpy (command,"/usr/local/clamav/bin/clamscan -r --remove ");
strcat (command,scanfiles);
system(command);

2.4 goto instalation dir of inotify tools
2.5 run
./configure
make
make install
2.6 goto rc.local add this line

nohup /usr/local/bin/inotifywait -qq -r -m -e create,close_write /watch_folder_name/ > /dev/null &


also you can add these parameters before folder name , if you have joomla or another application

--exclude "refTableSQL/* --exclude "cache/*" (quotas must be include)

and that's it. When new file created or replaced , or whatever event ocuured, clamav scan these files.

I hope that this is helpfull for anyone.

Çarşamba, Ağustos 25, 2010

The Mars

Nihayet, uzun zamandır planladığım siteyi açtım.


www.iwanttogotomars.org

...