Archive for the 'Yazılım' Category

Page 2 of 2

qmail from address and SMTP-AUTH username check patch

qmail SMTP-AUTH control mechanism is very good way to stop spams and give flexibility user to send email from anywere in the world. But current SMTP-AUTH patches do not check whether from address and SMTP-AUTH username is same.

The following patch will simply reject the mail if the SMTP-AUTH username does not match with the from address.
To be enable use this patch SMTP-AUTH username must be in email address format (user@domain.com). This can be
possible only in qmail+vpopmail or qmail-ldap (if the uid is in email address format) installation.

This patch is based on netqmail-1.06 and Erwin Hoffmann’s qmail-authentication-0.68 patch. But I believe that you can simply integrate your qmail source.

PS:  qmail-remote-logging.patch and qmail-smtp-auth-fromcheck.patch are integrated into JMS1 combined patch and Shupp Toaster patch.

URLs:

http://files.endersys.com/patches/qmail-1.03-jms1.7.08_endersys.patch

http://files.endersys.com/patches/qmail-toaster-0.9.1_endersys.patch

INSTALLATION and CONFIGURATION

1.  Stop qmail
2. Apply this patch to your qmail toaster and compile it (don’t install!)
3. Take backup of your qmail-smtpd binary and override new qmail-smtpd binary
4. Create control/checksenderauth to enable this control
5. Start qmail

You can get the patch from here


--- qmail-smtpd.c.orig  2009-12-16 00:09:42.000000000 +0200
+++ qmail-smtpd.c       2009-12-16 00:20:34.000000000 +0200
@@ -1,3 +1,4 @@
+#include <sys/stat.h>
#include "sig.h"
#include "readwrite.h"
#include "stralloc.h"
@@ -346,6 +347,7 @@
out("250 ok\r\n");
}
void smtp_rcpt(arg) char *arg; {
+struct stat st;
if (!seenmail) { err_wantmail(); return; }
if (!addrparse(arg)) { err_syntax(); return; }
if (flagbarf) { err_bmf(); return; }
@@ -356,6 +358,22 @@
}
else
if (!addrallowed()) { err_nogateway(); return; }
+/* This small patch compare mail from value and smtp auth username.
+* if they are not identical,  the mail will not be relayed!
+* This control will be ignored, if the remote IP is defined in tcp.smtp.cdb
+* create/delete control/checksenderauth file to enable/disable this feature
+*  - Developed by Endersys Ltd R&D Team - http://www.endersys.com
+*/
+  if ((stat("control/checksenderauth",&st) == 0) && (remoteinfo)) {
+
+ /* remoteinfo:username issued during the smtp auth state
+ *   mailfrom.s: From value issued at mail from: state */
+        if (str_diff(remoteinfo, mailfrom.s))  {
+               out("535 Mail From address and SMTP-AUTH username does not match (#5.7.1)\r\n");
+                       return;
+       }
+ }
+

TÜBİTAK TEYDEB desteğinde birinci dönem başarıyla tamamlandı

Endersys, geliştirdiği yazılımlardan biri için aldığı TÜBİTAK TEYDEB (1507 KOBI Ar-GE) desteğinde birinci fazı başarıyla tamamladı. Yakın zamanda diğer iki yazılım projemiz içinde başvuruda bulunacağız.

Linux’da kullanıcıları OpenLDAP üzerinden yetkilendirme

Daha önceki yazımız genel olarak LDAP ve OpenLDAP yapılandırması üzerineydi. Bu yazıda ise önceki yazıdaki alt yapıya göre Linux kullanıcılarını OpenLDAP üzerinden yetkilendirme anlatılacaktır.
Bu yazıyı okumadan önce mutlaka önceki yazıyı okumalısınız. Bu örnekte OpenLDAP sunucusu, OpenLDAP üzerinden yetkilendirme yapacak Linux istemci makinasına üzerine kurulmuştur. Dolayısıyla LDAP sunucu olarak 127.0.0.1 kullanılmıştır.

Kullanıcı yetkilendirmek için nss_ldap paketinin kurulması gerekir. Redhat’de bu paket nss_ldap ve pam_ldap modüllerini içerir. nss (Name Service Switch) passwd, group ve host gibi bilgilere nasıl erişileceğini tanımlarken, pam (Pluggable Authentication Modules) ise yetkilendirme işlemini yapar. Aşağıdaki komutla nss_ldap paketi kurulu değilse kurulur.

yum install nss_ldap

/etc/ldap.conf dosyasına aşağıdaki satırlar eklenir.

base dc=example,dc=com
rootbinddn cn=root,dc=deneme,dc=com
uri ldap://127.0.0.1/
ssl no
tls_cacertdir /etc/openldap/cacerts
scope one
pam_filter objectclass=posixaccount
pam_login_attribute uid,
pam_member_attribute gid
pam_password md5
nss_base_passwd         ou=People,dc=deneme,dc=com?one
nss_base_shadow         ou=People,dc=deneme,dc=com?one
nss_base_group          ou=Group,dc=deneme,dc=com?one
scope

LDAP arama seviyeleri (scope)

/etc/ldap.secret dosyasına ldap yönetici parolası yazılır. Dosya izni 600 yapılır.

echo secret > /etc/ldap.secret
chmod 600 /etc/ldap.secret

/etc/nsswitch.conf dosyasındaki aşağıdaki satırlara ldap parametresi eklenir.

passwd:     files
shadow:     files
group:      files

ldap değerlerini ekledikten sonra kayıtlar aşağıdaki gibi gözükmelidir.

passwd:     files ldap
shadow:     files ldap
group:      files ldap
cat /etc/pam.d/system-auth
#%PAM-1.0
# This file is auto-generated.

# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        sufficient    pam_ldap.so use_first_pass
auth        required      pam_deny.so

account     required      pam_unix.so broken_shadow
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     sufficient    pam_ldap.so
account     required      pam_ldap.so
#account    [default=bad success=ok user_unknown=ignore] pam_ldap.so
account     required      pam_permit.so

password    requisite     pam_cracklib.so try_first_pass retry=3
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
password    sufficient    pam_ldap.so use_first_pass
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_mkhomedir.so skel=/etc/skel umask=0022 silent
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
session     optional      pam_ldap.so

Mevcut kullanıcı ve parola bilgilerini veritabanına atmak için /usr/share/openldap/migration/ altındaki scriptler kullanılabilir.

cd /usr/share/openldap/migration/
vi migrate_common.ph
# Default DNS domain
$DEFAULT_MAIL_DOMAIN = "deneme.com";

# Default base
$DEFAULT_BASE = "dc=deneme,dc=com";
$EXTENDED_SCHEMA = 1;
mkdir -p /root/ldap/migration
./migrate_base.pl >/root/ldap/migration/base.ldif
more /root/ldap/migration/base.ldif
dn: dc=deneme,dc=com
dc: deneme
objectClass: top
objectClass: domain
objectClass: domainRelatedObject
associatedDomain: deneme.com

dn: ou=Hosts,dc=deneme,dc=com
ou: Hosts
objectClass: top
objectClass: organizationalUnit
objectClass: domainRelatedObject
associatedDomain: deneme.com
./migrate_group.pl /etc/group  >/root/ldap/migration/group.ldif
more /root/ldap/migration/group.ldif
dn: cn=root,ou=Group,dc=deneme,dc=com
objectClass: posixGroup
objectClass: top
cn: root
userPassword: {crypt}x
gidNumber: 0
ETC_SHADOW=/etc/shadow
./migrate_passwd.pl /etc/passwd > /root/ldap/migration/passwd.ldif

Son olarak yukarıda oluşturulan ldiff dosyaları ldapadd komutu ile eklenir.

qmail canonicalised recipient logging and more patch

As Endersys R&D team, we made simple but very useful patch to qmail-remote about the delivery report.

After this patch, qmail-remote will log sender and recipient of the email in addition to remote IP adddress.  So tracking an email result will be easier than before.

Here is the sample log file:

@400000004b1bdd4d1f89d84c delivery 10: success: <From:owner-freebsd-current@freebsd.org_To:user@remotedomain.com>_193.140.X.X_accepted_message.
/Remote_host_said:_250_ok_1260117440_qp_15626/

@400000004b1bdbb8191f1954 delivery 6: failure: <From:a@surgate.net_To:test323232@remoteserver.com>_212.252.x._does_not_like_recipient.
/Remote_host_said:_550_non-existent_recipient/alici_bulunamadi/Giving_up_on_212.252.x.x/

Here is the patch based on netqmail-1.6. You can download the patch from http://files.endersys.com/patches/qmail-remote-logging.patch

PS:  qmail-remote-logging.patch and qmail-smtp-auth-fromcheck.patch are integrated into JMS1 combined patch and Shupp Toaster patch.

URLs:

http://files.endersys.com/patches/qmail-1.03-jms1.7.08_endersys.patch

http://files.endersys.com/patches/qmail-toaster-0.9.1_endersys.patch

# diff -ruN qmail-remote.c.orig qmail-remote.c
--- qmail-remote.c.orig 2009-12-06 17:55:41.000000000 +0200
+++ qmail-remote.c      2009-12-06 18:35:31.000000000 +0200
@@ -246,15 +246,23 @@
     substdio_flush(&smtpto);
     code = smtpcode();
     if (code >= 500) {
-      out("h"); outhost(); out(" does not like recipient.\n");
+      /* added by Endersys R&D Team */
+      out("h<From:"); outsafe(&sender); out(" To:"); outsafe(&reciplist.sa[i]); out("> ");  outhost(); out(" does not like recipient.\n");
       outsmtptext(); zero();
     }
     else if (code >= 400) {
-      out("s"); outhost(); out(" does not like recipient.\n");
+      /* added by Endersys R&D Team */
+      out("s<From:"); outsafe(&sender); out(" To:"); outsafe(&reciplist.sa[i]);  out("> ");  outhost(); out(" does not like recipient.\n");
       outsmtptext(); zero();
     }
     else {
-      out("r"); zero();
+       /*
+       * James Raftery <james@now.ie>
+       * Log _real_ envelope recipient, post canonicalisation.
+       * and modified by Endersys R&D Team
+       */
+
+      out("r<From:"); outsafe(&sender); out(" To:"); outsafe(&reciplist.sa[i]); out("> "); zero();
       flagbother = 1;
     }
   }

Yazılım geliştirme süreçleri – Sanallaştırma

ÇarklarEndersys AR-GE ekibi olarak yazılım test sürecinde sanal makinaları yoğun olarak kullanıyoruz.

Endersys yazılım ürünleri her gece saat 03:00′te kendiişler bir süreç ile SVN‘den çekilip derleniyor. Kuruluma hazır hale gelen ürünler kendileri için ayrılmış sanal makinalara kuruluyor. Bu kurulumlar yazılım ekibi tarafından geliştirilen yeni özelliklerin, giderilen hataların ve uygulanan güvenlik güncellemelerinin test ekibi tarafından günübirlik incelenebilmesi için kullanılıyor. Böylece test ekibi yeni özelliklerin verimliliğinin ve kullanılabilirliğinin arttırılması, geriye dönük uyumluluğun sağlanması gibi konularda yazılım ekibine rapor hazırlayabiliyor.

Bu yazıda anlattıklarım yazılım test sürecimizin yalnızca bir parçasıdır. İleride bu sürecin diğer parçaları olan sürekli entegrasyon ve kendiişler testler hakkında ayrıntılı yazılar yayımlayacağım.

Ürünlerini benzer bir yöntemle test eden geliştiricilerin yorumlarını bekliyorum.

Yazılım geliştirme süreçleri – Hata etiketleri

Çarklar

Endersys‘in hata takip sistemine düşen hata raporlarını ve yeni özellik isteklerini kapsamlarına göre etiketlendiriyoruz. Aşağıda bizim en çok kullandığımız etiketleri ve bu etiketlerin ne anlama geldiklerini görebilirsiniz:

  • UX: User experience kavramının kısaltılmış hali. Kullanıcı işlemlerini kolaylaştırmak amacıyla yapılan her değişikliği kapsar
  • DX: Developer experience kavramının kısaltılmış hali. Geliştirici işlemlerini kolaylaştırmak amacıyla yapılan her değişikliği kapsar
  • i18n: Internationalization kavramının kısaltılmış hali. Farklı dillere çeviri (uluslararasılaştırma) ile ilgili bütün değişiklikleri kapsar.
  • L10n: Localization kavramının kısaltılmış hali. Yerelleştirme ile ilgili bütün değişiklikleri kapsar. Takvim ayarlarının ülkelere göre değişmesi gibi.
  • Testing: Kendiişler testler ile ilgili bütün çalışmaları kapsar.