# ----------------------------------------------------------------------------- # E-MAIL NOTLARI # ----------------------------------------------------------------------------- E-mail için kullanılan servisler, araçlar vb. # ----------------------------------------------------------------------------- # exim4 # ----------------------------------------------------------------------------- # Kurulum apt-get install exim4-daemon-light heirloom-mailx # Temel ayarlar dpkg-reconfigure exim4-config . General type of mail configuration : mail sent by smarthost; no local mail . System mail name : comp1.emrah.com . IP-addresses to listen on for incoming SMTP connec. : 127.0.0.1 . Other destinations for which mail is accepted : . Visible domain name for local users : comp1.emrah.com . IP address or host name of the outgoing smarthost : smtp.gmail.com::587 . Keep number of DNS-queries minimal : No ( DNS sunucu kurulu olan ve sürekli Internet'e bağlı makineler için ) : Yes ( Internet'e sürekli bağlı olmayan makineler için ) . Split configuration into small files? : Yes x domains to relay mail for : comp1.emrah.com x machines to relay mail for : 192.168.1.0/24 # smarthost kullanıcı ayarları /etc/exim4/passwd.client *.google.com:kullanici:parola smtp.gmail.com:kullanici:parola # Kullanıcı-email eşleştirmeleri /etc/email-addresses root: admin@emrah.gen.tr emrah: emrah@yahoo.com # Servisin yeniden başlatılması update-exim4.conf systemctl restart exim4.service # ----------------------------------------------------------------------------- # procmail # ----------------------------------------------------------------------------- # klasörleri oluştur cd $HOME mkdir -p mail/a_inbox/{cur,new,tmp} mkdir -p mail/a_sent/{cur,new,tmp} mkdir -p mail/b_gmail_hesap1/{cur,new,tmp} mkdir -p mail/b_gmail_hesap2/{cur,new,tmp} mkdir -p mail/l_debian-user-turkish/{cur,new,tmp} chmod 700 mail/ -R # $HOME/.procmailrc MAILDIR = $HOME/mail/ LOGFILE = $HOME/.procmaillog VERBOSE = no :0 * ^TO_ *hesap1@gmail.com b_gmail_hesap1/ :0 * ^TO_ *hesap2@gmail.com b_gmail_hesap2/ :0 * ^TO_ *debian-user-turkish l_debian-user-turkish/ :0 a_inbox/ # ----------------------------------------------------------------------------- # getmail # ----------------------------------------------------------------------------- getmail veya fetchmail'den sadece bir tanesi kullanılacak. getmail daha iyi bir seçenek # kurulum apt-get install getmail4 # klasor ve dosyalar cd mkdir .getmail chmod 700 .getmail cd .getmail touch hesap1@gmail.com touch hesap2@gmail.com chmod 600 * # örnek bir ayar dosyasi ~/.getmail/hesap1@gmail.com [retriever] type = SimplePOP3SSLRetriever server = pop.gmail.com username = hesap1 port = 995 password = xxxx [destination] type = MDA_external path = /usr/bin/procmail # test getmail --rcfile hesap1@gmail.com # crontab ayarları crontab -e */15 * * * * getmail -q --rcfile hesap1@gmail.com */15 * * * * getmail -q --rcfile hesap2@gmail.com # ----------------------------------------------------------------------------- # fetchmail # ----------------------------------------------------------------------------- # kurulum apt-get install fetchmail # $HOME/.fetchmailrc poll pop.gmail.com with protocol pop3, user hesap1 there is emrah here ssl, with password xxxx; poll pop.gmail.com with protocol pop3, user hesap2 there is emrah here ssl, with password xxxx; mda '/usr/bin/procmail -f fetchmail' # .fetchmailrc izinleri chmod 600 .fetchmailrc # test fetchmail -vk # crontab ayarları crontab -e */15 * * * * fetchmail -s # ----------------------------------------------------------------------------- # lynx # ----------------------------------------------------------------------------- HTML formatındaki mailleri görmek için kullanılacak # kurulum apt-get install lynx # ----------------------------------------------------------------------------- # mailcap # ----------------------------------------------------------------------------- Mail ile gelen farklı formattaki dosyaların neyle gösterileceğini belirlemek için kullanılacak # ~/.mailcap text/html ; lynx -dump -nolist -force_html %s ; copiousoutput # ----------------------------------------------------------------------------- # mutt # ----------------------------------------------------------------------------- # $HOME/.muttrc set mbox_type = maildir set mbox = "~/mail/a_inbox/" set spoolfile = "~/mail/a_inbox/" set folder = "~/mail/" set record = "~/mail/a_sent/" alternates hesap1@gmail.com hesap2@gmail.com mailboxes +a_inbox mailboxes +a_sent mailboxes +b_gmail_hesap1 mailboxes +b_gmail_hesap2 mailboxes +l_debian-user-turkish folder-hook . my_hdr From: hesap1 folder-hook b_gmail_hesap1 my_hdr From: hesap1 folder-hook b_gmail_hesap2 my_hdr From: hesap2 folder-hook l_debian-user-turkish my_hdr From: hesap1 set include = yes set beep_new = yes macro index G "!getmail -rhesap1@gmail.com -rhesap2@gmail.com\n" "Getmail ile yeni postaları al" macro pager G "!getmail -rhesap1@gmail.com -rhesap2@gmail.com\n" "Getmail ile yeni postaları al" #macro index G "!fetchmail\n" "Fetchmail ile yeni postaları al" #macro pager G "!fetchmail\n" "Fetchmail ile yeni postaları al" auto_view text/html auto_view text/HTML alternative_order text/plain text/html set mailcap_path=~/.mailcap:/etc/mailcap # programı başlatmak için mutt -y # ----------------------------------------------------------------------------- # mail # ----------------------------------------------------------------------------- # kurulum apt-get install bsd-mailx # mail komutunda header bilgileri mail -a "from: emrah " \ -a "reply-to: emrah.test@yahoo.com" \ -s "Mesajin konusu" \ arkadasim@yahoo.com Mail bitince CTRL+D # HTML mail mail -a "from: from: emrah " \ -a "Content-type: text/html" \ -s "Mesajin konusu" \ arkadasim@yahoo.com < newsletter.html # ----------------------------------------------------------------------------- # sSMTP # ----------------------------------------------------------------------------- Sadece mail gönderir. "/etc/hostname" içinde yer alan makine adı, "/etc/hosts" içerisinde yer almıyorsa kurulumda hata oluşuyor. # kurulum apt-get install ssmtp # /etc/ssmtp/ssmtp.conf mailhub=smtp.sunucu.com:587 AuthUser=kullanici_adi AuthPass=parola UseTLS=YES UseSTARTTLS=YES FromLineOverride=YES