qmail 송수신 설정

리눅스/Mail|2015. 1. 23. 09:14
반응형

송신 설정 파일

/etc/tcp.smtp  기본 내용

127.0.0.1:allow,RELAYCLIENT=""
11.22.33.44:allow,RELAYCLIENT=""

변경을 하게되면, /home/vpopmail/bin/clearopensmtp 를 실행 해줘야 적용된다.


수신 설정 파일

/var/qmail/control/rcpthosts  기본 내용

"없음"

이곳에 등록되어진 도메인의 메일만 수신을 한다.

모든 도메인으로부터 메일 수신을 원하면 해당 파일을 삭제한다. ('내용 비움' 아님)

반응형

'리눅스 > Mail' 카테고리의 다른 글

queue-fix 설치  (0) 2015.01.23
mail control - /var/qmail/control/  (0) 2015.01.23
qmail 데몬 죽이기  (0) 2015.01.23
다람쥐메일(squirrelmail) 첨부파일 용량 늘이기  (0) 2015.01.23
구글메일 사용시 mx레코드 변경  (0) 2015.01.23

댓글()

qmail 데몬 죽이기

리눅스/Mail|2015. 1. 23. 09:13
반응형

pstree 명령으로 qmail 관련 pid 를 모두 kill 합니다.

# pstree -ap

qmail supervise 부터 상위부터 차례로  kill -9 하면 됩니다.
(qmail remote 도 kill)

그러면 restsart 됩니다.

반응형

댓글()

다람쥐메일(squirrelmail) 첨부파일 용량 늘이기

리눅스/Mail|2015. 1. 23. 09:12
반응형

[첨부파일 최대 용량을 10MB로 변경]

다람쥐메일을 sendmail 과 연동시 아래 두개의 파일을 확인해 봅니다.

1) /usr/local/apache/conf/php.ini

post_max_size = 10M
upload_max_filesize = 10M


저장 후, apache 재시작

참고 :  post는 메일내용 + 첨부파일 사이즈
            upload는 첨부파일 사이즈



2) /etc/mail/sendmail.cf

# maximum message size
O MaxMessageSize=10000000

저장 후, sendmail 재시작

 

반응형

'리눅스 > Mail' 카테고리의 다른 글

qmail 송수신 설정  (0) 2015.01.23
qmail 데몬 죽이기  (0) 2015.01.23
구글메일 사용시 mx레코드 변경  (0) 2015.01.23
sendmail 큐에 쌓인 메일 강제 발송  (0) 2015.01.23
[QMAIL] queue 에 쌓여있는 메일갯수 확인  (0) 2015.01.23

댓글()

구글메일 사용시 mx레코드 변경

리눅스/Mail|2015. 1. 23. 09:12
반응형

zone 파일에 아래항목 추가

@               IN      MX      10       ASPMX.L.GOOGLE.COM.
@               IN      MX      20       ALT1.ASPMX.L.GOOGLE.COM.
@               IN      MX      20       ALT2.ASPMX.L.GOOGLE.COM.
@               IN      MX      30      ASPMX2.GOOGLEMAIL.COM.
@               IN      MX      30      ASPMX3.GOOGLEMAIL.COM.
@               IN      MX      30      ASPMX4.GOOGLEMAIL.COM.
@               IN      MX      30      ASPMX5.GOOGLEMAIL.COM.

반응형

댓글()

sendmail 큐에 쌓인 메일 강제 발송

리눅스/Mail|2015. 1. 23. 09:12
반응형

# sendmail -q -v

반응형

댓글()

[QMAIL] queue 에 쌓여있는 메일갯수 확인

리눅스/Mail|2015. 1. 23. 09:11
반응형

# /var/qmail/bin/qmail-qstat

반응형

댓글()

sendmail 에서 특정 계정으로 오는 메일을 다른 계정으로 받기

리눅스/Mail|2015. 1. 23. 09:10
반응형

sendmail 에서 특정 계정으로 오는 메일을 다른 계정으로 받기


1) /etc/mail/virtusertable 파일을 수정합니다.

설정 내용은 아래와 같이..

root                                       sysdocu           // root 로 오는 메일은 sysdocu 계정으로 포워딩
webmaster@sysdocu.com    sysdocu          // /etc/mail/local-host-names 파일에 여러개의 도메인이 등록되어있을 경우,
admin@sysdocu.com            sysdocu               이렇게 계정에 도메인까지 콕 집어서 메일을 포워딩 할 수 있습니다.


2) 파일 저장 후, 적용합니다.

     # makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
     # /etc/init.d/sendmail restart



다른 포워딩 방법


사용자 홈디렉토리에 .forward 파일을 만들고 전달받을 주소를 적어줍니다.여러개의 주소를 입력하여 다수의 주소로 포워딩 할 수 있습니다.


# cd /home/sysdocu


# vi .forward

sysdocu@sysdocu.com    // 본래의 수신 주소를 쓰면 사본을 남겨둘 수 있음

sysdocu@hanmail.net

sysdocu@naver.com


# chown sysdocu.sysdocu .forward


반응형

댓글()

sendmail 보내기, 받기 안될때 확인 사항

리눅스/Mail|2015. 1. 23. 09:09
반응형

서버에서 외부로 메일 전송이 되지 않을때 확인.

# vi /etc/mail/local-host-names

sysdocu.com    <- 추가

# vi /etc/mail/sendmail.cf

Cwlocalhost sysdocu.com    <- 수정

# vi /etc/dovecot.conf

protocols = imap imaps pop3 pop3s    <- 수정
listen = [::]    -< 수정

# vi /etc/hosts
127.0.0.1               localhost.localdomain localhost
11.22.33.44          sysdocu.com sysdocu    <- 추가

# vi /etc/sysconfig/network
HOSTNAME=sysdocu.com    <- 수정

# /etc/init.d/network restart
# /etc/init.d/sendmail restart
# /etc/init.d/dovecot restart


외부에서 서버로 메일 전송이 되지 않을때 확인.

# vi /etc/mail/access

Connect:localhost.localdomain       RELAY
Connect:localhost           RELAY
Connect:127.0.0.1           RELAY
Connect:sysdocu.com          RELAY    <- 도메인이 꼭 있어야 함.


반응형

댓글()

다람쥐메일 (squirrelmail) 1.4.13 설치하기

리눅스/Mail|2015. 1. 23. 09:08
반응형

squirrelmail (다람쥐메일) 설치하기

다람쥐 메일에는 imap 기반으로 운영. sendmail 경우에는 xinetd의 imap, dovecot (uw) 부분을 활용하면 된다. 
* qmail 을 사용하는 경우는 대개 courier-imap 을 많이 사용함 ( courier-authlib , courier-imap ) 


### courier-authlib-0.58 설치 ### 
cd /usr/local/src 
wget http://shupp.org/software/courier-authlib-0.58.tar.bz2
tar jvxf courier-authlib-0.58.tar.bz2 
chown -R root.root courier-authlib-0.58
cd courier-authlib-0.58

./configure --prefix=/usr/local/courier-authlib --without-authpam --without-authldap --without-authpwd --without-authmysql --without-authpgsql --without-authshadow --without-authuserdb --without-authcustom --without-authcram --without-authpipe --with-authvchkpw --with-redhat
make
make install 
make install-configure

cp courier-authlib.sysvinit /etc/init.d/courier-authlib
chmod 700 /etc/init.d/courier-authlib
chkconfig --add courier-authlib
/etc/init.d/courier-authlib start



### courier-imap-4.0.6 설치 ### 
cd /usr/local/src 
wget http://shupp.org/software/courier-imap-4.0.6.tar.bz2
tar jvxf courier-imap-4.0.6.tar.bz2 
chown -R root.root courier-imap-4.0.6 
cd courier-imap-4.0.6 

export COURIERAUTHCONFIG=/usr/local/courier-authlib/bin/courierauthconfig 
export CPPFLAGS=-I/usr/local/courier-authlib/include 
./configure --prefix=/usr/local/courier-imap --disable-root-check --with-redhat 

make 
make install 
make install-configure 

vi /usr/local/courier-imap/etc/imapd 

MAXDAEMONS=40 
MAXPERIP=40 
IMAP_EMPTYTRASH=Trash:7,Sent:30 
IMAPDSTART=YES 

cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imap 
chmod 744 /etc/rc.d/init.d/courier-imap 
chkconfig --add courier-imap 
/etc/rc.d/init.d/courier-imap start 



### squirrelamil (다람쥐메일) 설치 ###
cd /usr/local/src 
wget http://www.squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fprdownloads.sourceforge.net%2Fsquirrelmail%2Fsquirrelmail-1.4.13.tar.gz ===> http://www.squirrelmail.org/download.php (다운페이지) 
cd /usr/local/apache/htdocs 
tar xvzf /usr/local/src/squirrelmail-1.4.13.tar.gz 
chown -R nobody.nobody squirrelmail-1.4.13 
chmod -R 750 squirrelmail-1.4.13 
ln -s squirrelmail-1.4.13 squirrelmail 

mkdir /var/squirrelmail 
mkdir /var/squirrelmail/data 
mkdir /var/squirrelmail/attach 

cd squirrelmail 
cp data/default_pref /var/squirrelmail/data 
chown -R nobody.nobody /var/squirrelmail 
chmod -R 0770 /var/squirrelmail/data 
chmod -R 0730 /var/squirrelmail/attach 

cd config 
./conf.pl 

Main Menu --
1. Organization Preferences 
2. Server Settings 
3. Folder Defaults 
4. General Options 
5. Themes 
6. Address Books 
7. Message of the Day (MOTD) 
8. Plugins 
9. Database 
10. Languages 

D. Set pre-defined settings for specific IMAP servers 

C Turn color on 
S Save data 
Q Quit 

Command >> D 

Please select your IMAP server: 
cyrus = Cyrus IMAP server 
uw = University of Washington's IMAP server (xinetd 의 imap 경우 -> 보통 sendmail에 다람쥐메일설치할경우 선택
exchange = Microsoft Exchange IMAP server 
courier = Courier IMAP server 
macosx = Mac OS X Mailserver 
hmailserver = hMailServer 
quit = Do not change anything 
Command >> courier 


1 ] Organization Preferences 
1. Organization Name : Webmail 
2. Organization Logo : ../images/sm_logo.png 
3. Org. Logo Width/Height : (308/111) 
4. Organization Title : Webmail 
5. Signout Page : 
6. Top Frame : _top 
7. Provider link : http://www.neulwon.com/ 
8. Provider name : neulwon webmail 

R Return to Main Menu 
C Turn color on 
S Save data 
Q Quit 

Command >> 

2 ] Server Settings 

General 
------- 
1. Domain : example.com => ( neulwon.com 으로 수정.) 
2. Invert Time : false 
3. Sendmail or SMTP : SMTP 

A. Update IMAP Settings : localhost:143 (courier) 
B. Update SMTP Settings : localhost:25 

R Return to Main Menu 
C Turn color on 
S Save data 
Q Quit 

Command >> 

3 ] Folder Defaults 

1. Default Folder Prefix : INBOX. 
2. Show Folder Prefix Option : false 
3. Trash Folder : Trash 
4. Sent Folder : Sent 
5. Drafts Folder : Drafts 
6. By default, move to trash : true 
7. By default, move to sent : true 
8. By default, save as draft : true 
9. List Special Folders First : true 
10. Show Special Folders Color : true 
11. Auto Expunge : true 
12. Default Sub. of INBOX : false 
13. Show 'Contain Sub.' Option : false 
14. Default Unseen Notify : 2 
15. Default Unseen Type : 2 -> ( 1-=>2 로 수정) 
16. Auto Create Special Folders : true 
17. Folder Delete Bypasses Trash : true 
18. Enable /NoSelect folder fix : false 

R Return to Main Menu 
C Turn color on 
S Save data 
Q Quit 

4 ] General Options 

1. Data Directory : ../data/ => ( /var/squirrelmail/data/ ) 로 수정 
2. Attachment Directory : $data_dir => ( /var/squirrelmail/attach/) 로 수정 
3. Directory Hash Level : 0 
4. Default Left Size : 150 
5. Usernames in Lowercase : false => ( true ) 로 수정 
6. Allow use of priority : true 
7. Hide SM attributions : false => ( true ) 로 수정 
8. Allow use of receipts : true 
9. Allow editing of identity : true 
Allow editing of name : true 
Remove username from header : false 
10. Allow server thread sort : false 
11. Allow server-side sorting : false 
12. Allow server charset search : true 
13. Enable UID support : true 
14. PHP session name : SQMSESSID 

R Return to Main Menu 
C Turn color on 
S Save data 
Q Quit 

Command >> 


6 ] Address Books 

1. Change LDAP Servers 
2. Use Javascript Address Book Search : fault => ( true ) 로 수정 
3. Global file address book : 
4. Allow writing into global file address book : false 

R Return to Main Menu 
C Turn color on 
S Save data 
Q Quit 

Command >> 

8 ] Plugins 

Installed Plugins 
1. delete_move_next 
2. spamcop 
3. administrator 
4. newmail 
5. abook_take 
6. message_details 
7. info 
8. mail_fetch 
9. translate 
10. listcommands 
11. calendar 
12. bug_report 
13. filters 
14. sent_subfolders 
15. squirrelspell 

Available Plugins: 
16. fortune 

R Return to Main Menu 
C Turn color on 
S Save data 
Q Quit 

10 ] Language preferences 

1. Default Language : en_US => ( ko_KR) 
2. Default Charset : iso-8859-1 => ( EUC-KR ) 
3. Enable lossy encoding : false 

R Return to Main Menu 
C Turn color on 
S Save data 
Q Quit 

Command >> 

cd /usr/local/src 
wget http://www.squirrelmail.org/plugins/quota_usage-1.3.1.tar.gz  (Plugins - Obsolete)
wget http://www.squirrelmail.org/plugins/compatibility-2.0.9.tar.gz  (Plugins - Miscellaneous)

cd /usr/local/apache/htdocs/squirrelmail/plugins 
tar xvzf /usr/local/src/quota_usage-1.3.1.tar.gz 
cp quota_usage/config.php.sample quota_usage/config.php 
chown -R nobody.nobody quota_usage 
chmod -R o-rx quota_usage 

vi quota_usage/functions.php 
Go to line 43 and change the value 1000000 to 1048576 
==> 43 라인 부분에서 1000000 을1048576 으로 수정, 

tar xzf /usr/local/src/compatibility-2.0.9.tar.gz 
chown -R nobody.nobody compatibility 
chmod -R o-rx compatibility 

cd ../config 
./conf.pl 

8 ] Plugins 
부분에서 
quota_usage 
compatibility 을 

-> Installed Plugins 으로 선택하여 올려준다. 

# vi /usr/local/apache/conf/httpd.conf 부분에 webmail 페이지 띄우기 위해 버추얼 호스트 설정. 

<VirtualHost *:80> 
ServerAdmin webmaster@zosen.net 
DocumentRoot /usr/local/apache/htdocs/squirrelmail 
ServerName webmail.zosen.net 
ErrorLog logs/webmail.zosen.net-error_log 
CustomLog logs/webmail.zosen.net-access_log common 
</VirtualHost> 

named 설정에서 서브도메인 'webmail'을 사용할 수 있어야 한다. (예: webmail.neulwon.com)

* 다람쥐메일 한글화 

http://www.squirrelmail.org/download.php 에서 다람쥐메일 설치버전에 맞는 언어팩설치 

cd /usr/local/apache/htdocs/squirrelmail/ 
wget http://heanet.dl.sourceforge.net/sourceforge/squirrelmail/all_locales-1.4.5-20050904.tar.gz 
tar xvzf all_locales-1.4.5-20050904.tar.gz 
cd locale ==> 부분에 ko_KR 이있는지 확인. 

==> http://webmail.도메인

반응형

댓글()

sendmail + dovecot (imap4, pop3) yum 설치

리눅스/Mail|2015. 1. 23. 09:07
반응형

다음 내용은 리눅스 환경에서 sendmail + dovecot (imap, pop3) 서비스 설치 방법에 대해서 설명하고 있다.

이 외에도 여러가지 옵션 및 설정사항들이 있으며, 좀 더 자세한 내용은 다음 홈페이지를 참고해야 한다.

 

http://www.sendmail.org

http://www.dovecot.org

 

어디까지나 본 문서는 5분안에 sendmail + dovecot (imap, pop3) 서비스를 설치하는데 있다. !!!!

 

1. sendmail 설치

sendmail을 설치하기 위해서는 여러가지 라이브러리들이 함깨 설치되어야 하는데, 다음과 같이 yum 명령어를

사용하면 그 모든 작업을 매우 수월하게 진행할 수 있다.

[root@linux ~] yum install sendmail

 

2. sendmail config 수정

[root@linux ~] vi  /etc/mail/sendmail.cf

/etc/mail/sendmail.cf 파일에 수정해야 할 곳은 딱 한 곳 뿐이다. (현재로서는 .. 2008년 3월 기준)

# SMTP daemon options
O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA

 

3. sendmail 재시작

[root@linux mail]# service sendmail restart
Shutting down sm-client:                              [  OK  ]
Shutting down sendmail:                              [  OK  ]
Starting sendmail:                                        [  OK  ]
Starting sm-client:                                        [  OK  ]

 

4. sendmail 테스트

[root@linux mail]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 linux.net ESMTP Sendmail 8.13.8/8.13.8; Tue, 11 Mar 2008 17:36:47 -0400


5. dovecot 설치

[root@linux ~] yum install dovecot

 

6. dovecot config 수정

[root@linux ~] vi  /etc/dovecot.conf

수정해야 할 부분은 딱 두 군데 뿐이다. (protocols, listen)

다음에 표시된 빨간색 protocols, listen을 참고 삼아서 똑 같이 수정한다.

# Protocols we want to be serving: imap imaps pop3 pop3s
# If you only want to use dovecot-auth, you can set this to "none".
protocols = imap imaps pop3 pop3s

# IP or host address where to listen in for connections. It's not currently
# possible to specify multiple addresses. "*" listens in all IPv4 interfaces.
# "[::]" listens in all IPv6 interfaces, but may also listen in all IPv4
# interfaces depending on the operating system.
#
# If you want to specify ports for each service, you will need to configure
# these settings inside the protocol imap/pop3 { ... } section, so you can
# specify different ports for IMAP/POP3. For example:
#   protocol imap {
#     listen = *:10143
#     ssl_listen = *:10943
#     ..
#   }
#   protocol pop3 {
#     listen = *:10100
#     ..
#   }
listen = [::]

 

7. dovecot 서비스 재시작

[root@linux ~] service dovecot restart
Stopping Dovecot Imap:                                  [  OK  ]
Starting Dovecot Imap:                                    [  OK  ]

 

8. dovecot imap4 서비스 테스트

[root@linux mail]# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
* OK Dovecot ready.

 

9. dovecot pop3 서비스 테스트

[root@linux mail]# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Dovecot ready.


※ 만약 localhost를 제외한 외부에서 sendmail 혹은 dovecot(imap, pop3)에 텔넷 연결이 되지 않을 경우

    다음 세 가지 사항을 점검해 볼 필요가 있다.

    1. iptables            25번, 110번, 143번 포트가 방화벽에서 허용되고 있는지 유/무

    2. netstat -avp     LISTENINIG 포트 체크

    3. ps -ef | grep sendmail        혹은   ps -ef | grep dovecot



[출처] https://hoguinside.blogspot.com/2014/02/sendmail-dovecot-imap4-pop3-5.html

반응형

댓글()

phpmailer 1.0.x 설치

리눅스/Mail|2015. 1. 23. 09:05
반응형

프로젝트 및 다운로드 사이트 http://sourceforge.net/projects/phpmailer

테이블 작성

* DocumentRoot 디렉토리에 압축파일을 다운받는다

# gzip -d phpmail-1.0.x.tar.gz
# tar xvf phpmail-1.0.x.tar
# cd phpmail-1.0.x



테이블 작성


* 먼저 작성된 mailuser테이블을 삭제한다

# /usr/local/mysql/bin/mysql -u phpmail -p phpmail
mysql> drop table mailuser;
mysql> exit;
# cd sql
# /usr/local/mysql/bin/mysql -u phpmail -p phpmail < phpmail-linux.sql
Enter password:
테이블이 제대로 생성됐는지 확인한다
# /usr/local/mysql/bin/mysql -u phpmail -p phpmail
mysql> show tables;

+-------------------+
| Tables_in_phpmail |
+-------------------+
| mailaddr |
| maildomn |
| mailgrup |
| mailnoti |
| mailpop3 |
| mailpost |
| mailrule |
| mailuser |
+-------------------+
8 rows in set (0.01 sec)

maildomn테이블에 도메인정보를 입력한다
mysql> insert into maildomn values ('메일서버도메인명', '회사명', '관리자아이디', '관리자메일주소', '관리자전화번호', '관리자핸드폰번호', '도메인디스크위치', '도메인당 아이디갯수', '도메인기본제한용량', '등록일자', '사용여부');
sample> insert into maildomn values ('nsets.org', 'phpmail', 'popori', 'popori@kldp.org', '02-2103-xxxx', '017-339-xxxx', '/phpmail/nsets.org', '20', 10240, '2003-04-28', 'Y');



디렉토리 생성


# mkdir -p /phpmail/nsets.org
첨부파일 업로드 디렉토리생성
# mkdir -p /phpmail/nsets.org/.upload
# chown -R nobody:nobody /phpmail



환경설정


# vi DocumentRoot/phpmail-1.0.x/lib/config.lib.html
관리자 메일주소입력
> $phpmail["admin"] = "popori@kldp.org";
편지함의 홈디렉토리 설정
> $phpmail["mhome"] = "/phpmail"; 편지함 홈디렉토리가 NFS일경우 nfs주석을 해제 선택해준다
> $phpmail["mtype"] = "local"; # $phpmail["mtype"] = "remote"; 



접속확인


브라우저를 띄우고 phpmail접속을 확인한다
http://도메인//phpmail-1.0.x

반응형

댓글()