Hi,
Just two things that are not correct:

In : Apache configuration, the file is SOGO.conf

in: Create certificates : mv cyrus-imapd.pem /etc/pki/cyrus-imapd/

Otherwise the tutorial sounds interesting.

I am trying to install a mail server in centos 5.5, but my approach is
different.
I use:
centos-ds-base
Postfix
cyrus-imapd
Cyrus-salsauthd but using pam
Dspam
SOGo

Postfix handles virtual domains with queries on the server ldap
transport_maps = proxy:ldap:/etc/postfix/ldap/transport_map.cf

bind = no
server_host = ldap://127.0.0.1:389
scope = sub
search_base = dc = test, dc = fr
query_filter = (mail =% s)
result_attribute = MailDeliveryOption

User in the LDAP directory:
dn: uid = afernandez, ou = people, ou = city, dc = test, dc = fr
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: mailrecipient
objectClass: mozillaAbPersonAlpha
cn: Annabelle Fernandez
gidNumber: 31
homeDirectory: /home /afernandez
sn: Fernandez
uid afernandez
uidNumber: 31
departmentNumber: General Secretariat
Description: Null
givenName: Annabelle
loginShell: /bin/false
mail: [email protected]
mailAlternateAddress:
mailAutoReplyText:
mailDeliveryOption: lmtp: unix: /var/lib/imap/socket/lmtp
mailhost: mail.test.fr
telephoneNumber: 0123456789
userPassword:: xxxxx

Cyrus-imapd also uses virtual domains:

autocreatequota: 524288
allowplaintext: yes
hashimapspool: 1
sasl_mech_list: PLAIN
virtdomains: 1
duplicatesuppression: 0
sasl_pwcheck_method: saslauthd
sievedir:/var/lib/imap/sieve
autocreate_sieve_script:/var/lib/imap/sieve/spam.script
admins: cyrus
configdirectory:/var/lib/imap
defaultdomain: test.fr
autocreatequota_units: 1048576
sendmail: / usr / sbin / sendmail
autocreateinboxfolders: Draft|Sent|Trash|Spam|Nonspam
unixhierarchysep: 1
lmtp_downcase_rcpt: true
partition-default:/var/spool/imap
autosubscribeinboxfolders: Draft | Sent | Trash | Spam | Nonspam
createonpost: 1
tls_cert_file:/etc/pki/cyrus-imapd/cyrus-imapd.pem
tls_key_file:/etc/pki/cyrus-imapd/cyrus-imapd.pem
tls_ca_file:/etc/pki/tls/certs/ca-bundle.crt

spam.script:
require ["fileinto"];

if allof (header: contains "subject" [SPAM] ") {
         fileinto "INBOX / Spam";
}

And my sogo configuration:
{
    NSGlobalDomain = {
    };
    gdnc = {
    };
    sogod = {
    NGImap4ConnectionStringSeparator = "/";
    NGUseUTF8AsURLEncoding = YES;
    OCSFolderInfoURL = "postgresql://sogo:sogo@localhost
:5432/sogo/sogo_folder_info";
    SOGoACLsSendEMailNotifcations = YES;
    SOGoACLsSendEMailNotifications = YES;
    SOGoAppointmentSendEMailNotifcations = YES;
    SOGoAppointmentSendEMailNotifications = YES;
    SOGoAuthenticationMethod = LDAP;
    SOGoDraftsFolderName = INBOX/Draft;
    SOGoFoldersSendEMailNotifications = YES;
    SOGoForceIMAPLoginWithEmail = YES;
    SOGoForwardEnabled = YES;
    SOGoIMAPAclConformsToIMAPExt = YES;
    SOGoIMAPAclStyle = rfc4314;
    SOGoIMAPServer = localhost;
    SOGoLanguage = French;
    SOGoLoginModule = Mail;
    SOGoMailDomain = "test.fr";
    SOGoMailShowSubscribedFoldersOnly = NO;
    SOGoMailSpoolPath = "/var/spool/sogo";
    SOGoMailUseOutlookStyleReplies = YES;
    SOGoMailingMechanism = smtp;
    SOGoOtherUsersFolderName = "Other Users";
    SOGoProfileURL = "postgresql://sogo:sogo@localhost
:5432/sogo/sogo_user_profile";
    SOGoSMTPServer = localhost;
    SOGoSentFolderName = INBOX/Sent;
    SOGoSharedFolderName = "Shared Folders";
    SOGoSieveServer = sieve://127.0.0.1:4190;
    SOGoEnableEMailAlarms = YES;
    OCSEMailAlarmsFolderURL = "postgresql://sogo:sogo@localhost
:5432/sogo/sogo_alarms_folder";
    SOGoEnablePublicAccess = YES;
    SOGoSpecialFoldersInRoot = YES;
    SOGoSuperUsernames = (
        admin
    );
    SOGoTimeZone = Europe/Paris;
    SOGoTrashFolderName = INBOX/Trash;
    SOGoUserSources = (
        {
        CNFieldName = cn;
        IDFieldName = uid;
        IMAPHostFieldName = mailHost;
        UIDFieldName = uid;
        baseDN = "ou=People,ou=town,dc=test,dc=fr";
        bindDN = "cn=Directory Manager";
        bindPassword = password;
        canAuthenticate = NO;
        displayName = "town";
        hostname = 127.0.0.1;
        id = OT;
        isAddressBook = YES;
        port = 389;
        scope = SUB;
        },
        {
        CNFieldName = cn;
        IDFieldName = uid;
        IMAPHostFieldName = mailHost;
        UIDFieldName = uid;
        baseDN = "dc=test,dc=fr";
        bindDN = "cn=Directory Manager";
        bindFields = mail;
        bindPassword = password;
        canAuthenticate = YES;
        displayName = Entreprise;
        hostname = 127.0.0.1;
        id = shared;
        isAddressBook = NO;
        port = 389;
        scope = SUB;
        }
    );
    SOGoVacationEnabled = YES;
    WOMessageUseUTF8 = YES;
    WOParsersUseUTF8 = YES;
    WOPort = 20000;
    WOUseRelativeURLs = NO;
    };
}

With this configuration, users who log on sogo and are configured in the
LDAP directory have their accounts automatically created in cyrus-imapd and
have a default sieve script.

I also installed dspam and set authentication on the dspam web interface to
match user on the ldap directory

dspam-web.conf:
#
# Web-UI for DSPAM.
#
Alias /dspam /usr/share/dspam-web
<Directory "/usr/share/dspam-web">

    Options FollowSymLinks ExecCGI
    DirectoryIndex      dspam.cgi
    AllowOverride       None
    Order               allow,deny
    Allow               from all
    AuthzLDAPAuthoritative On
    AuthBasicProvider ldap
    AuthLDAPBindDN "CN=Directory manager"
    AuthLDAPBindPassword "password"
        AuthType Basic
        AuthName "DSPAM Control Center"
    AuthLDAPURL "ldap://127.0.0.1:389/dc=test,dc=fr?mail?sub?(objectClass=*)
"
    Require valid-user
</Directory>

And train dspam to learn spam and no spam by a perl script that connect to
cyrus-imapd and match every mail on the spam directory and the no spam
directory.

use Mail::IMAPClient;
use IMAP::Admin;
use Data::Dumper;

#Récupération du paramètre defaultdomain dans le fichier de configuration de
cyrus-imapd
open FILE, "</etc/imapd.conf" or die $!;
while (<FILE>) {
 if ($_ =~ m/defaultdomain: (.*)/i){
    $domain = $1;
 }
}
close FILE;

my $imap1 = IMAP::Admin->new('Server' => "127.0.0.1",
            'Login' => "cyrus",
            'Password' => "cyrus",
            );

my $imap = Mail::IMAPClient->new;
$imap = Mail::IMAPClient->new(
                        Server => "127.0.0.1",
                        User    => "cyrus",
                        Password=> "cyrus",
                        Clear   => 5,
        );
@folders=$imap->folders;


  foreach $folder (@folders) {
    if ($folder =~ m/spam/i) {
        $hache = $imap->getacl($folder);
        foreach $key (sort (keys(%$hache))) {
            $utilisateur = $key;
            }
#        print $folder."\n";
        if ($folder =~ m/user\/([a-z]+[.-]?[a-z]+)\/(.*)(@(.*))$/i){
            $username = $1.$3;
#            print $username."\n";
            }
        else {
            $username = $utilisateur."@".$domain;
#            print $username."\n";
            }
        $imap->setacl($folder,"cyrus","lrswipcda");
        $imap->select($folder);
        my @msgs = $imap->messages;
        foreach $msg (@msgs) {
#            print $folder.":".$imap->get_header( $msg, "X-DSPAM-Signature"
)."\n";
            if ($imap->get_header( $msg, "X-DSPAM-Signature" )) {
                my $dspaminvocation = 'dspam --user '.$username.'
--class=spam --source=error --signature='.$imap->get_header( $msg,
"X-DSPAM-Signature" );
                my $dspamval = system($dspaminvocation);
                print $username." Spam:".$imap->get_header( $msg, "Subject"
)."\n";
                }
            }
        $imap1->delete_acl($folder, "cyrus");


    }
    elsif ($folder =~ m/nonspam/i) {
        $hache = $imap->getacl($folder);
        foreach $key (sort (keys(%$hache))) {
            $utilisateur = $key;
            }
#        print $folder."\n";
        if ($folder =~ m/user\/([a-z]+[.-]?[a-z]+)\/(.*)(@(.*))$/i){
            $username = $1.$3;
#            print $username."\n";
            }
        else {
            $username = $utilisateur."@".$domain;
#            print $username."\n";
            }
        $imap->setacl($folder,"cyrus","lrswipcda");
        $imap->select($folder);
        my @msgs = $imap->messages;
        foreach $msg (@msgs) {
#            print $folder.":".$imap->get_header( $msg, "X-DSPAM-Signature"
)."\n";
            if ($imap->get_header( $msg, "X-DSPAM-Signature" )) {
                my $dspaminvocation = 'dspam --user '.$username.'
--class=innocent --source=error --signature='.$imap->get_header( $msg,
"X-DSPAM-Signature" );
                my $dspamval = system($dspaminvocation);
                print $username." Nonspam:".$imap->get_header( $msg,
"Subject" )."\n";
                }
            }
        $imap1->delete_acl($folder, "cyrus");


    }
}

The last thing I installed is vulture ldap (application I develloped)
and allows
me to delegate the management of accounts in the LDAP directory.
An administrator of a domain can only manage users within its scope but the
super administrator can manage all areas.

Screenshot here http://oeufdure.free.fr/wordpress/?p=146
Since the publication on my blog, I worked on it but I have not updated the
rpm and deb

Regard

Fabrice Durand

2011/1/28 <[email protected]>

> So in my doc I had left some bitter feelings towards configuring Sogo in
> the form of a very bad word. I am truly sorry for that and I have removed it
> from the document.
>
> Thanks Jose for seeing that and pointing it out to me and sorry Jose for
> seeing that. :(
>
>
> Jon
>
>
>
> --
> [email protected]
> https://inverse.ca/sogo/lists
>
-- 
[email protected]
https://inverse.ca/sogo/lists

Reply via email to