Ubuntu/Linux - Grunder [Mobil, Eng, Eng/Mob] | GRUB | GRUB2 | PXE | skript | ssh | mail | Internet | backup
Ubuntu mail
[upp]
DNS
MTA
MDA
postfix
[ner]
- - -
samtliga sidor
dölj finstilt
This page has a new address:
[http://e-dog.info/t/63/doc/Ubuntu_mail.php]
Please update your bookmark.

This page is just a draft, so far.
Last update:
October 20, 2012
[TA BORT MEDDELANDET]
[index]
[Tillbaka till: Ubuntu - Installation, partitionering. Grunder.]
[Tillbaka till: GRUB - Reparera starthanteraren.]




=DNS=
set up one A record 123.123.123.123 to mail.MYDOMAIN.COM
set up one MX record mail.DOMAIN.COM

=MTA= MTA ("mail server")
apt-get install exim4
cat /etc/exim4/update-exim4.conf.conf
dc_eximconfig_configtype='smarthost'
# dc_eximconfig_configtype='local'
dc_other_hostnames='MYDOMAIN.COM'
dc_local_interfaces=''
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.MYISP.com'
# dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'


different ways to deliver mail:
1. /var/spool/mail/MYUSER
2. $HOME/mailbox
3. $HOME/Maildir/ (directory tree)
4. Using MDA like Procmail etc

different ways to send mail:
dc_eximconfig_configtype='local'
dc_eximconfig_configtype='internet'
dc_eximconfig_configtype='smarthost'

dc_smarthost='smtp.ISP.com'


Start Telnet connection to:
domain=mail.example.com, port=25
The server replies start with a number (250, 354)
220 Ready
HELO
250 mail.example.com
MAIL from: 
250 Sender  Ok
RCPT to: 
250 Recipient  Ok
DATA
354 Ok Send data ending with .
From: sender@example.com
To: recipient@example.com
Subject: Test message
This is a test message.
.
250 Message received
QUIT

cat /var/log/exim4/mainlog
tail -50 /var/log/mail.log





=MDA=
#aptitude install dovecot-imapd dovecot-pop3d dovecot-common

the function of MDA is to read the inbox, it can then, on command, move emails from inbox to f.ex. the users home directory

vim /etc/dovecot/dovecot.conf
disable_plaintext_auth = no
mail_location = mbox:~/mail:INBOX=/var/mail/%u

group "mail" probably already exists in the system, otherwise create it
cat /etc/group
...
disk:x:6:
lp:x:7:
mail:x:8:MYUSER,MYUSER2
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
...

(note group number, mail is 8 in this example)
/etc/dovecot/dovecot.conf
mail_gid = "mail"

add users to group
usermod -a -G mail MYUSER1
usermod -a -G mail MYUSER2

check
id -u MYUSER2
groups MYUSER2

edit the configuration file to use the passwd-file conf.d/10-auth.conf:
# Add '#' to comment out the system user login for now:
#!include auth-system.conf.ext

# Remove '#' to use passwd-file:
!include auth-passwdfile.conf.ext

The passwords can be set to be different from the Linux user passwords.
vim /etc/dovecot/users
MYUSER1:{PLAIN}PWD1:1002:8::/home/MYUSER1
MYUSER2:{PLAIN}PWD2:1001:8::/home/MYUSER2
"8" is group number (GID) for group mail

edit the file conf.d/auth-passwdfile.conf.ext
passdb {
  driver = passwd-file
  args = scheme=CRYPT username_format=%u /etc/dovecot/users
}
userdb {
  driver = passwd-file
  args = username_format=%u /etc/dovecot/users
}


or maybe
  args = username_format=%u /etc/dovecot/users

edit conf.d/10-ssl.conf
ssl = yes

telnet to port 110 (keep an email in the inbox)
+OK Dovecot ready.
user nnnnn
-ERR Unknown command.
user nnnnn
+OK
pass xxxxxxxxxx
+OK Logged in.
stat
+OK 1 1553
retr 1
+OK 1553 octets
Return-path: 
Envelope-to: nnnnnn@mydomain.com
Delivery-date: Tue, 06 Nov 2012 12:02:28 +0100
Received: from bay0-xcvxcv-xvxcv.bay333.hotmail.com ([123.123.123.123])
        by deb7.pc with esmtp (Exim 4.80)

check log
tail -50 /var/log/mail.log

doveconf -n
 root@deb7:/etc/dovecot/conf.d# doveconf -n
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-3-686-pae i686 Debian wheezy/sid
disable_plaintext_auth = no
mail_gid = mail
mail_location = mbox:~/mail:INBOX=/var/mail/%u
namespace inbox {
  inbox = yes
  location =
  prefix =
}
passdb {
  args = username_format=%u /etc/dovecot/users
  driver = passwd-file
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
protocols = " imap pop3"
ssl_cert = 








=postfix=
Postfix configuration files:
install.cf (generated when installing Postfix the first time; used for reinstallation)
master.cf (used by the main process master)
main.cf (what you edit)
"postconf -n" will show what settings are modified by your main.cf.


Wiki (Ubuntu-se.org)
Ubuntu - Installation, partitionering. Grunder.
Reparera GRUB

Är det oklart hur man gör, fråga gärna vidare här.




Länkar:
Länkar till övriga sidor om Ubuntu och Linux på denna domän finns här.




Kontaktinformation:

[CSS: Webcredible]
Sidan underhålls av ycc, en av Ubuntu Sveriges medlemmar. Innehåll och design avspeglar nödvändigtvis inte Ubuntu Sveriges uppfattning.