PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Sendmail konfigurieren



brave_snoopy
21.05.06, 14:03
Hi,
ich versuche verzweifelt sendmail so zu konfigurieren, das die Mails per smtp an meinen Provider gesendet werden. Doch mitlerweile kann ich nicht mal mehr lokal mails zustellen.

Zum einen, wenn ich in der shell sendmail root hallo eintrage dauert es ewig, also bestimmt 5 Minuten bis ich wieder einen Prompt habe. Wenn ich Sendmail neustarte dauert es auch etwa 3-5 Minuten.
Ist das alles korrekt? Ich glaube nicht, oder?

Mein System ist ubuntu 5.10 server.

In der sendmail.mc hab ich folgendes geändert:

dnl steht für kommentar oder?

OSTYPE(`debian')dnl
DOMAIN(`swendrich.net')dnl

FEATURE(`authinfo')dnl
MASQUERADE_AS(`swendrich.net')

MAILER(`local')dnl
MAILER(`smtp')dnl

define(`SMART_HOST',`smtp:mail.swendrich.net')dnl

in der access datei hab ich folgendes reingeschrieben

AuthInfo:mail.swendrich.net U:username P:kennwort M:PLAIN

dann habe ich noch eine datei authinfo angelegt und das gleiche wie in der access datei reingeschrieben.
danach habe ich mit make alles neu konfiguriert und versucht mit sendmail swendrich hallo

oder sendmail swendrich@tiscali.de hallo

ne mail an mcih lokal zu schrieben oder an mein anderes mailkonto bei meinem dsl provider.

Doch irgendwie klappt hier gar nix mehr...
Wo ist mein Fehler, was hab ich falsch gemacht?

brave_snoopy
21.05.06, 15:35
ich habe grade festgestellt, also die lokale mailzustellung funktioniert. auch das maskieren.

sendmail swendrich
hallo
.

dann klappt es. Es dauert aber einige Zeit.
Nur wie mach ich es nun, das externe Mails an meinen Provider mit Authentifizierung gesendet werden?

edit: Ich habe per root eine mai lversucht an swendrich@tiscali.de zu senden:

sendmail swendrich@tiscali.de
hall ovon sendmail
.

es hat lange gedauert und dann kam der prompt wieder. un es lag eine mail im postfach für den Benutzer swendrich:



root@ubuntu:~# cat /var/mail/swendrich
From root@ubuntu Sun May 21 15:40:32 2006
Return-Path: <root@ubuntu>
Received: from ubuntu (localhost.localdomain [127.0.0.1])
by ubuntu (8.13.4/8.13.4/Debian-3) with ESMTP id k4LDeWCm006126
for <swendrich@ubuntu>; Sun, 21 May 2006 15:40:32 +0200
Received: (from root@localhost)
by ubuntu (8.13.4/8.13.4/Submit) id k4LDeWJE006096
for swendrich; Sun, 21 May 2006 15:40:32 +0200
Date: Sun, 21 May 2006 15:40:32 +0200
From: root <root@swendrich.net>
Message-Id: <200605211340.k4LDeWJE006096@ubuntu>
To: undisclosed-recipients:;

hallo wie geht es dir

From MAILER-DAEMON Sun May 21 15:41:45 2006
Return-Path: <MAILER-DAEMON>
Received: from localhost (localhost)
by ubuntu (8.13.4/8.13.4/Debian-3) id k4LDfjiU006136;
Sun, 21 May 2006 15:41:45 +0200
Date: Sun, 21 May 2006 15:41:45 +0200
From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <200605211341.k4LDfjiU006136@ubuntu>
To: <root@ubuntu>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="k4LDfjiU006136.1148218905/ubuntu"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--k4LDfjiU006136.1148218905/ubuntu

The original message was received at Sun, 21 May 2006 15:41:41 +0200
from localhost.localdomain [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<swendrich@tiscali.de>
(reason: 504 <root@ubuntu>: Sender address rejected: need fully-qualified address)

----- Transcript of session follows -----
... while talking to mail.swendrich.net.:
>>> DATA
<<< 504 <root@ubuntu>: Sender address rejected: need fully-qualified address
554 5.0.0 Service unavailable
<<< 554 Error: no valid recipients

--k4LDfjiU006136.1148218905/ubuntu
Content-Type: message/delivery-status

Reporting-MTA: dns; ubuntu
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Sun, 21 May 2006 15:41:41 +0200

Final-Recipient: RFC822; swendrich@tiscali.de
Action: failed
Status: 5.5.4
Remote-MTA: DNS; mail.swendrich.net
Diagnostic-Code: SMTP; 504 <root@ubuntu>: Sender address rejected: need fully-qualified address
Last-Attempt-Date: Sun, 21 May 2006 15:41:44 +0200

--k4LDfjiU006136.1148218905/ubuntu
Content-Type: text/rfc822-headers

Return-Path: <root@ubuntu>
Received: from ubuntu (localhost.localdomain [127.0.0.1])
by ubuntu (8.13.4/8.13.4/Debian-3) with ESMTP id k4LDffiU006134
for <swendrich@tiscali.de>; Sun, 21 May 2006 15:41:41 +0200
Received: (from root@localhost)
by ubuntu (8.13.4/8.13.4/Submit) id k4LDffZn006131
for swendrich@tiscali.de; Sun, 21 May 2006 15:41:41 +0200
Date: Sun, 21 May 2006 15:41:41 +0200
From: root <root@ubuntu>
Message-Id: <200605211341.k4LDffZn006131@ubuntu>
To: undisclosed-recipients:;

--k4LDfjiU006136.1148218905/ubuntu--

root@ubuntu:~#


und hier mal die letzten einträge in der mail.err




May 19 01:13:15 ubuntu sm-msp-queue[9032]: unable to qualify my own domain name (ubuntu) -- using short name
May 19 01:13:15 ubuntu sm-mta[9041]: k4INDFKO009041: SYSERR(root): collect: Cannot write ./dfk4INDFKO009041 (bfcommit, uid=0, gid=110): Permission denied
May 19 01:13:15 ubuntu sm-mta[9047]: k4INDFvB009047: SYSERR(root): collect: Cannot write ./dfk4INDFvB009047 (bfcommit, uid=0, gid=110): Permission denied
May 19 01:13:15 ubuntu sm-mta[9048]: k4INDFw5009048: SYSERR(root): collect: Cannot write ./dfk4INDFw5009048 (bfcommit, uid=0, gid=110): Permission denied
May 19 01:13:18 ubuntu sm-mta[9038]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA-v4: cannot bind: Address already in use
May 19 01:13:18 ubuntu sm-mta[9038]: daemon MTA-v4: problem creating SMTP socket
May 19 01:13:23 ubuntu sm-mta[9038]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA-v4: cannot bind: Address already in use
May 19 01:13:23 ubuntu sm-mta[9038]: daemon MTA-v4: problem creating SMTP socket
May 19 01:13:28 ubuntu sm-mta[9038]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA-v4: cannot bind: Address already in use
May 19 01:13:28 ubuntu sm-mta[9038]: daemon MTA-v4: problem creating SMTP socket
May 19 01:13:33 ubuntu sm-mta[9038]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA-v4: cannot bind: Address already in use
May 19 01:13:33 ubuntu sm-mta[9038]: daemon MTA-v4: problem creating SMTP socket
May 19 01:13:38 ubuntu sm-mta[9038]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA-v4: cannot bind: Address already in use
May 19 01:13:38 ubuntu sm-mta[9038]: daemon MTA-v4: problem creating SMTP socket
May 19 01:13:43 ubuntu sm-mta[9038]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA-v4: cannot bind: Address already in use
May 19 01:13:43 ubuntu sm-mta[9038]: daemon MTA-v4: problem creating SMTP socket
May 19 01:13:48 ubuntu sm-mta[9038]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA-v4: cannot bind: Address already in use
May 19 01:13:48 ubuntu sm-mta[9038]: daemon MTA-v4: problem creating SMTP socket
May 19 01:13:53 ubuntu sm-mta[9038]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA-v4: cannot bind: Address already in use
May 19 01:13:53 ubuntu sm-mta[9038]: daemon MTA-v4: problem creating SMTP socket
May 21 15:11:07 ubuntu sm-mta[5633]: My unqualified host name (ubuntu) unknown; sleeping for retry
May 21 15:11:09 ubuntu sm-msp-queue[5638]: My unqualified host name (ubuntu) unknown; sleeping for retry
May 21 15:12:07 ubuntu sm-mta[5633]: unable to qualify my own domain name (ubuntu) -- using short name
May 21 15:12:09 ubuntu sm-msp-queue[5638]: unable to qualify my own domain name (ubuntu) -- using short name
May 21 15:12:34 ubuntu sendmail[5981]: My unqualified host name (ubuntu) unknown; sleeping for retry
May 21 15:13:34 ubuntu sendmail[5981]: unable to qualify my own domain name (ubuntu) -- using short name
May 21 15:20:01 ubuntu sm-msp-queue[6083]: My unqualified host name (ubuntu) unknown; sleeping for retry
May 21 15:21:02 ubuntu sm-msp-queue[6083]: unable to qualify my own domain name (ubuntu) -- using short name
May 21 15:39:32 ubuntu sendmail[6096]: My unqualified host name (ubuntu) unknown; sleeping for retry
May 21 15:40:01 ubuntu sm-msp-queue[6125]: My unqualified host name (ubuntu) unknown; sleeping for retry
May 21 15:40:32 ubuntu sendmail[6096]: unable to qualify my own domain name (ubuntu) -- using short name
May 21 15:40:40 ubuntu sendmail[6131]: My unqualified host name (ubuntu) unknown; sleeping for retry
May 21 15:41:01 ubuntu sm-msp-queue[6125]: unable to qualify my own domain name (ubuntu) -- using short name
May 21 15:41:41 ubuntu sendmail[6131]: unable to qualify my own domain name (ubuntu) -- using short name
root@ubuntu:~#

und hier meine komplette sendmail.mc Datei




root@ubuntu:/etc/mail# cat sendmail.mc
divert(-1)dnl
#-----------------------------------------------------------------------------
# $Sendmail: debproto.mc,v 8.13.4 2005-06-04 09:31:03 cowboy Exp $
#
# Copyright (c) 1998-2005 Richard Nelson. All Rights Reserved.
#
# cf/debian/sendmail.mc. Generated from sendmail.mc.in by configure.
#
# sendmail.mc prototype config file for building Sendmail 8.13.4
#
# Note: the .in file supports 8.7.6 - 9.0.0, but the generated
# file is customized to the version noted above.
#
# This file is used to configure Sendmail for use with Debian systems.
#
# If you modify this file, you will have to regenerate /etc/mail/sendmail.cf
# by running this file through the m4 preprocessor via one of the following:
# * `sendmailconfig`
# * `make`
# * `m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf`
# The first two options are preferred as they will also update other files
# that depend upon the contents of this file.
#
# The best documentation for this .mc file is:
# /usr/share/doc/sendmail-doc/cf.README.gz
#
#-----------------------------------------------------------------------------
divert(0)dnl
#
# Copyright (c) 1998-2005 Richard Nelson. All Rights Reserved.
#
# This file is used to configure Sendmail for use with Debian systems.
#
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.13.4-3 2005-06-04 09:31:03 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`swendrich.net')dnl
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
undefine(`confHOST_STATUS_DIRECTORY')dnl #DAEMON_HOSTSTATS=
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
dnl #
dnl # General defines
dnl #
dnl # SAFE_FILE_ENV: [undefined] If set, sendmail will do a chroot()
dnl # into this directory before writing files.
dnl # If *all* your user accounts are under /home then use that
dnl # instead - it will prevent any writes outside of /home !
dnl # define(`confSAFE_FILE_ENV', `')dnl
dnl #
dnl # Daemon options - restrict to servicing LOCALHOST ONLY !!!
dnl # Remove `, Addr=' clauses to receive from any interface
dnl # If you want to support IPv6, switch the commented/uncommentd lines
FEATURE(`no_default_msa')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, Addr=127.0.0.1')dnl
dnl #
dnl # Be somewhat anal in what we allow
define(`confPRIVACY_FLAGS',dnl
`needmailhelo,needexpnhelo,needvrfyhelo,restrictqr un,restrictexpand,nobodyreturn,authwarnings')dnl
dnl #
dnl # Define connection throttling and window length
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl
dnl #
dnl # Features
dnl #
dnl # The access db is the basis for most of sendmail's checking
FEATURE(`access_db', , `skip')dnl
dnl #
dnl # The greet_pause feature stops some automail bots - but check the
dnl # provided access db for details on excluding localhosts...
FEATURE(`greet_pause', `1000')dnl 1 seconds
dnl #
dnl # Delay_checks allows sender<->recipient checking
FEATURE(`delay_checks', `friend', `n')dnl
dnl #
dnl # If we get too many bad recipients, slow things down...
define(`confBAD_RCPT_THROTTLE',`3')dnl
dnl #
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
FEATURE(`authinfo')dnl
MASQUERADE_AS(`swendrich.net')dnl
dnl #
dnl # If you're on a dialup link, you should enable this - so sendmail
dnl # will not bring up the link (it will queue mail for later)
dnl define(`confCON_EXPENSIVE',`True')dnl
dnl #
dnl # Default Mailer setup
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl

define(`SMART_HOST',`smtp:mail.swendrich.net')
root@ubuntu:/etc/mail#



ich hoffe ihr könnt mir nun helfen:

RichieX
22.05.06, 09:46
In die sendmail.mc solltest du noch folgende Zeilen aufnehmen, wenn du dich bei deinem Provider authentifizieren möchtest:


define(`confAUTH_OPTIONS', `A')dnl
TRUST_AUTH_MECH(`EXTERNAL PLAIN DIGEST-MD5 CRAM-MD5 LOGIN')dnl
define(`confAUTH_MECHANISMS',`EXTERNAL GSSAPI PLAIN DIGEST-MD5 CRAM-MD5 LOGIN')dnl
define(`SMART_HOST',`dein.provider.net')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl

Möchtest du nicht nur von localhost Mails versenden solltest du diese Zeile so ändern:


DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl


Die access sieht dann so aus:


AuthInfo:dein.provider.net "U:username" "P:password"


Überlege dir genau, ob du maskieren möchtest. Einzelne Mail-Adressen kannst du auch mit dem Feature genericstable umwandeln.