Configure Sendmail in SuSE

Source: Internet
Author: User
Tags dsn imap starttls

Address: http://blog.csdn.net/njhwwgc/article/details/5719602

 

The procedure is as follows:
1. Is Sendmail software installed using the RPM command?
Suining :~ # Rpm-Qa | grep sendmail
Sendmail-devel-8.12.10-162.1
Sendmail-8.12.10-162.1
Suining :~ #
If the above information is used, the system has been installed. If no information is provided, YaST is used for installation. During this period, the system will prompt you to insert the corresponding installation disk.

2. I have installed it here. Next
Run the RPM command to verify that IMAP is installed.
Suining :~ # Rpm-Qa | grep IMAP
Php4-imap-4.3.4-43.8
Imap-lib-2002e-92.1
Imap-2002e-92.1
Imap-devel-2002e-92.1
If the above information is used, the system has been installed. If no information is provided, YaST is used for installation. During this period, the system will prompt you to insert the corresponding installation disk.
Run the RPM command to confirm that pop is installed.
Suining:/etc/xinetd. D # rpm-Qa | grep pop
Popt-1.7-176.7
Qpopper-4.0.5-175.1
If the above information is used, the system has been installed. If no information is provided, YaST is used for installation. During this period, the system will prompt you to insert the corresponding installation disk.

3. Modify the/etc/sysconfig/mail configuration file, which can be used by people other than the local machine by email, as shown below:
Suining:/etc/sysconfig # more mail
# Path: Network/mail/General
# Description:
# Type: String
# Default :""
# Config: Postfix
# Servicereload: Sendmail, Postfix
#
# From:-line in email and news Postings
# (Otherwise the FQDN is used)
#
From_header = ""
# Path: Network/mail/General
# Description: general configuration of mail Interface
# Type: yesno
# Default: Yes
# Config: Sendmail, Postfix
#
# If you don't want to let suseconfig generate your
# Configuration file, set this to no
#
Mail_create_config = "yes"

# Type: yesno
# Default: No
# Config: Postfix
#
# Set this to "yes" if mail from remote shocould be accepted
# This is necessary for any mail server.
# If set to "no" or empty then only mail from localhost
# Will be accepted.
#
Smtpd_listen_remote = "yes" ---- it was originally no. You must change it to yes so that other external PCs can use the emial server to send emails.

4. Modify the Linux. Mc configuration file and edit the/etc/mail/Linux. Mc file.
In section 83%:
DNL feature ('authinfo', 'hash-O' auth _ dir'/auth-info') DNL
To:
Feature ('Access _ db', 'hash-T <tmpf>-O/etc/mail/access. db') d
NL
In section 86%:
DNL trust_auth_mech ('place _ here_your_auth_mechanic ') DNL
DNL define ('confauth _ mechanisms ', 'place _ here_your_auth_mechanic') DNL
To:
Trust_auth_mech ('place _ here_your_auth_mechanic ') DNL
Define ('confauth _ mechanisms ', 'place _ here_your_auth_mechanism') DNL

Then:
Suining:/etc/mail # M4/etc/mail/Linux. MC>/etc/sendmail. cf
Generate available sendmail. cf

5. Edit the/etc/sendmail. cf file as follows:
In section 13%:
# SMTP client options
# O clientportoptions = family = Inet, address = 0.0.0.0
To:
# SMTP client options
O clientportoptions = family = Inet, address = 10.38.223.195 --- local IP Address

6. edit/etc/mail/Local-host-names and add the local domain name.
# Format:
#
# <Aliases for local host>

Mail.sina.com
Sina.com

7. edit/etc/mail/access and add
# Default for loop back is relay
127 Relay
10.38.223 Relay
Allow Email Forwarding in the 10.38.223 address segment
Then:
Suining:/etc/mail # makemap hash/etc/mail/access. DB </etc/mail/Access
Convert the file content in access to the/etc/mail/access. DB database

8. Suining:/etc/mail # chkconfig -- level 35 Sendmail on
Suining:/etc/mail #
Run the sendmail service at level 3 and 5 and load it automatically upon startup.

9. Check/etc/services to ensure:
SMTP 25/tcp mail # Simple Mail Transfer
SMTP 25/udp mail # Simple Mail Transfer
And
POP3 110/tcp # Post Office Protocol-Version 3
POP3 110/udp # Post Office Protocol-Version 3
The # before is not commented out

10. Edit the IMAP file under/etc/xinetd. D and modify it as follows:

# Imap-IMAP mail daemon
#
Service IMAP
{
Disable = Yes --------- change to no
Socket_type = stream
Protocol = TCP
Wait = No
User = root
Server =/usr/sbin/imapd
Flags = IPv4
}
Edit the Qpopper file under/etc/xinetd. D and modify it as follows:
# Qpopper-POP3 mail daemon
#
Service POP3
{
Disable = Yes ---------- change to no
Socket_type = stream
Protocol = TCP
Wait = No
User = root
Server =/usr/sbin/popper
Server_args =-S
Flags = IPv4
}
~

Then restart xinetd.
Suining:/etc/init. d #./xinetd restart
Shutting down xinetd: Done
Starting Inet services. (xinetd) done
Suining:/etc/init. d #

Run the following command to view the status:
Suining:/usr/sbin #./ipop3d status
+ OK POP3 Suining. js v2003.83 Server Ready

Suining:/usr/sbin #./imapd status
* OK [capability imap4rev1 LOGIN-REFERRALS starttls LoginDisabled] Suining. js imap4rev1 2003.339 at Sun, 6 Jul 2008 14:30:06-0700 (PDT)

11. Restart the sendmail service.

Suining:/etc/init. d #./sendmail start
Initializing SMTP port (Sendmail) done
Suining:/etc/init. d #

12. Local test first:
Suining :~ # Telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape Character is '^]'.
220 Suining. js ESMTP Sendmail 8.12.10/8.12.10/Suse Linux 0.7; Sun, 6 Jul 2008 14:41:47-0700
EHLO AA
250-suining.js Hello localhost [127.0.0.1], pleased to meet you
250-enhancedstatuscodes
250-pipelining
250-8bitmime
December 250-size
250-dsn
250-etrn
250-deliverby
250 help
Quit
221 2.0.0 Suining. js closing connection
Connection closed by foreign host.
Indicates that the service is successfully started and can be used on the local machine.

Suining :~ # Telnet 10.38.223.195 25
Trying 10.38.223.195...
Connected to 10.38.223.195.
Escape Character is '^]'.
220 Suining. js ESMTP Sendmail 8.12.10/8.12.10/Suse Linux 0.7; Sun, 6 Jul 2008 14:42:35-0700
EHLO bb
250-suining.js Hello Suining. js [10.38.223.195], pleased to meet you
250-enhancedstatuscodes
250-pipelining
250-8bitmime
December 250-size
250-dsn
250-etrn
250-deliverby
250 help
Quit
221 2.0.0 Suining. js closing connection
Connection closed by foreign host.

It indicates that other PCs can use this IP address to use the email service.

Suining :~ # Telnet mail.sina.com 25
Trying 10.38.223.195...
Connected to mail.sina.com.
Escape Character is '^]'.
220 Suining. js ESMTP Sendmail 8.12.10/8.12.10/Suse Linux 0.7; Sun, 6 Jul 2008 14:43:41-0700
EHLO CC
250-suining.js Hello Suining. js [10.38.223.195], pleased to meet you
250-enhancedstatuscodes
250-pipelining
250-8bitmime
December 250-size
250-dsn
250-etrn
250-deliverby
250 help
Quit
221 2.0.0 Suining. js closing connection
Connection closed by foreign host.
Instructions can be used through domain names

Then you can create a user and use the Windows Outlook client for testing.

Remember: you must add lines similar to the following in/etc/hosts.
192.168.1.106 study.zzjtlxs.com Study

Address: http://blog.csdn.net/njhwwgc/article/details/5719602

 

The procedure is as follows:
1. Is Sendmail software installed using the RPM command?
Suining :~ # Rpm-Qa | grep sendmail
Sendmail-devel-8.12.10-162.1
Sendmail-8.12.10-162.1
Suining :~ #
If the above information is used, the system has been installed. If no information is provided, YaST is used for installation. During this period, the system will prompt you to insert the corresponding installation disk.

2. I have installed it here. Next
Run the RPM command to verify that IMAP is installed.
Suining :~ # Rpm-Qa | grep IMAP
Php4-imap-4.3.4-43.8
Imap-lib-2002e-92.1
Imap-2002e-92.1
Imap-devel-2002e-92.1
If the above information is used, the system has been installed. If no information is provided, YaST is used for installation. During this period, the system will prompt you to insert the corresponding installation disk.
Run the RPM command to confirm that pop is installed.
Suining:/etc/xinetd. D # rpm-Qa | grep pop
Popt-1.7-176.7
Qpopper-4.0.5-175.1
If the above information is used, the system has been installed. If no information is provided, YaST is used for installation. During this period, the system will prompt you to insert the corresponding installation disk.

3. Modify the/etc/sysconfig/mail configuration file, which can be used by people other than the local machine by email, as shown below:
Suining:/etc/sysconfig # more mail
# Path: Network/mail/General
# Description:
# Type: String
# Default :""
# Config: Postfix
# Servicereload: Sendmail, Postfix
#
# From:-line in email and news Postings
# (Otherwise the FQDN is used)
#
From_header = ""
# Path: Network/mail/General
# Description: general configuration of mail Interface
# Type: yesno
# Default: Yes
# Config: Sendmail, Postfix
#
# If you don't want to let suseconfig generate your
# Configuration file, set this to no
#
Mail_create_config = "yes"

# Type: yesno
# Default: No
# Config: Postfix
#
# Set this to "yes" if mail from remote shocould be accepted
# This is necessary for any mail server.
# If set to "no" or empty then only mail from localhost
# Will be accepted.
#
Smtpd_listen_remote = "yes" ---- it was originally no. You must change it to yes so that other external PCs can use the emial server to send emails.

4. Modify the Linux. Mc configuration file and edit the/etc/mail/Linux. Mc file.
In section 83%:
DNL feature ('authinfo', 'hash-O' auth _ dir'/auth-info') DNL
To:
Feature ('Access _ db', 'hash-T <tmpf>-O/etc/mail/access. db') d
NL
In section 86%:
DNL trust_auth_mech ('place _ here_your_auth_mechanic ') DNL
DNL define ('confauth _ mechanisms ', 'place _ here_your_auth_mechanic') DNL
To:
Trust_auth_mech ('place _ here_your_auth_mechanic ') DNL
Define ('confauth _ mechanisms ', 'place _ here_your_auth_mechanism') DNL

Then:
Suining:/etc/mail # M4/etc/mail/Linux. MC>/etc/sendmail. cf
Generate available sendmail. cf

5. Edit the/etc/sendmail. cf file as follows:
In section 13%:
# SMTP client options
# O clientportoptions = family = Inet, address = 0.0.0.0
To:
# SMTP client options
O clientportoptions = family = Inet, address = 10.38.223.195 --- local IP Address

6. edit/etc/mail/Local-host-names and add the local domain name.
# Format:
#
# <Aliases for local host>

Mail.sina.com
Sina.com

7. edit/etc/mail/access and add
# Default for loop back is relay
127 Relay
10.38.223 Relay
Allow Email Forwarding in the 10.38.223 address segment
Then:
Suining:/etc/mail # makemap hash/etc/mail/access. DB </etc/mail/Access
Convert the file content in access to the/etc/mail/access. DB database

8. Suining:/etc/mail # chkconfig -- level 35 Sendmail on
Suining:/etc/mail #
Run the sendmail service at level 3 and 5 and load it automatically upon startup.

9. Check/etc/services to ensure:
SMTP 25/tcp mail # Simple Mail Transfer
SMTP 25/udp mail # Simple Mail Transfer
And
POP3 110/tcp # Post Office Protocol-Version 3
POP3 110/udp # Post Office Protocol-Version 3
The # before is not commented out

10. Edit the IMAP file under/etc/xinetd. D and modify it as follows:

# Imap-IMAP mail daemon
#
Service IMAP
{
Disable = Yes --------- change to no
Socket_type = stream
Protocol = TCP
Wait = No
User = root
Server =/usr/sbin/imapd
Flags = IPv4
}
Edit the Qpopper file under/etc/xinetd. D and modify it as follows:
# Qpopper-POP3 mail daemon
#
Service POP3
{
Disable = Yes ---------- change to no
Socket_type = stream
Protocol = TCP
Wait = No
User = root
Server =/usr/sbin/popper
Server_args =-S
Flags = IPv4
}
~

Then restart xinetd.
Suining:/etc/init. d #./xinetd restart
Shutting down xinetd: Done
Starting Inet services. (xinetd) done
Suining:/etc/init. d #

Run the following command to view the status:
Suining:/usr/sbin #./ipop3d status
+ OK POP3 Suining. js v2003.83 Server Ready

Suining:/usr/sbin #./imapd status
* OK [capability imap4rev1 LOGIN-REFERRALS starttls LoginDisabled] Suining. js imap4rev1 2003.339 at Sun, 6 Jul 2008 14:30:06-0700 (PDT)

11. Restart the sendmail service.

Suining:/etc/init. d #./sendmail start
Initializing SMTP port (Sendmail) done
Suining:/etc/init. d #

12. Local test first:
Suining :~ # Telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape Character is '^]'.
220 Suining. js ESMTP Sendmail 8.12.10/8.12.10/Suse Linux 0.7; Sun, 6 Jul 2008 14:41:47-0700
EHLO AA
250-suining.js Hello localhost [127.0.0.1], pleased to meet you
250-enhancedstatuscodes
250-pipelining
250-8bitmime
December 250-size
250-dsn
250-etrn
250-deliverby
250 help
Quit
221 2.0.0 Suining. js closing connection
Connection closed by foreign host.
Indicates that the service is successfully started and can be used on the local machine.

Suining :~ # Telnet 10.38.223.195 25
Trying 10.38.223.195...
Connected to 10.38.223.195.
Escape Character is '^]'.
220 Suining. js ESMTP Sendmail 8.12.10/8.12.10/Suse Linux 0.7; Sun, 6 Jul 2008 14:42:35-0700
EHLO bb
250-suining.js Hello Suining. js [10.38.223.195], pleased to meet you
250-enhancedstatuscodes
250-pipelining
250-8bitmime
December 250-size
250-dsn
250-etrn
250-deliverby
250 help
Quit
221 2.0.0 Suining. js closing connection
Connection closed by foreign host.

It indicates that other PCs can use this IP address to use the email service.

Suining :~ # Telnet mail.sina.com 25
Trying 10.38.223.195...
Connected to mail.sina.com.
Escape Character is '^]'.
220 Suining. js ESMTP Sendmail 8.12.10/8.12.10/Suse Linux 0.7; Sun, 6 Jul 2008 14:43:41-0700
EHLO CC
250-suining.js Hello Suining. js [10.38.223.195], pleased to meet you
250-enhancedstatuscodes
250-pipelining
250-8bitmime
December 250-size
250-dsn
250-etrn
250-deliverby
250 help
Quit
221 2.0.0 Suining. js closing connection
Connection closed by foreign host.
Instructions can be used through domain names

Then you can create a user and use the Windows Outlook client for testing.

Remember: you must add lines similar to the following in/etc/hosts.
192.168.1.106 study.zzjtlxs.com Study

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.