PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Linuxkiste als Mailrelay und Fetcher für Exchange



stash
05.08.04, 12:55
Hallo @ all,

für den Mailtransfer in unserer Firma habe ich folgendes vor: Linuxkiste holt Mails per fetchmail von pop-konten Emails ab. Dann prüft er auf Viren und Spam und leitet sie an das richtige Postfach an den Exchange weiter.Hier werden die Mails dann eh an die Clients weitergeleitet. Nun meine Frage: fetchmail zum abholen... kein Problem. Postfix zum versenden der Mails die von Exchange kommen, auch kein Problem. Aber wie bring ich ihm bei, bei ankunft einer Mail diese gleich an einen Exchange-Server weiterzuleiten?

Vielen Dank schonmal für eure Antworten!

Gruß, Stash

mbo
05.08.04, 13:12
Aber wie bring ich ihm bei, bei ankunft einer Mail diese gleich an einen Exchange-Server weiterzuleiten?

Wie bringt man jemand die Suchfunktion bei? ;)



man fetchmail
smtphost -S Specify smtp host(s) to forward to
smtpaddress -D Specify the domain to be put in
RCPT TO lines

smtpadress ist für POP3- / CatchAll-Sammelkonten
Da fetchmail eh den Postfix als MTA benutzt und der Virenscanner über Postfix angesteuert wird, gibt es keine Problem im Ablauf.
Du mußt Postfix jetzt noch beibringen, daß er für Deine Domains den Exchange als relay benutzt.

cu/2 iae

MrIch
05.08.04, 13:43
die excahge geschictte regelst du in der /etc/postfix/transport

stash
05.08.04, 13:50
hallo nochmal!

Vielen Dank für die schnelle Antwort! Gesucht hab ich bereits, hab aber auf die schnelle nix gefunden. Naja, trotzdem danke!

Gruß, stash


Thread closed....

stash
10.08.04, 07:19
Hallo nochmal,

jetzt muss ich doch nochmal nachfragen:

Ich hab jetzt alles soweit aufgebaut und konfiguriert. Exchange verschickt die Mail an den Extmail (linuxkiste) der wiederum nimmt die auch an, nur versenden will er die jetzt nicht. Relay=none...
Wo kann ich die Option konfigurieren, von welchen Servern er die Mails immer annehmen soll?

Achso, dann noch ein zweites Problem: fetchmail holt die Mails ab, soweit ok. Die liegen jetzt ja im Postfach des Benutzers. Wie bekomm ich die von dort aus an den Exchange geschickt?

Danke schonmal im Voraus!

P.S.: Hier nochmal meine Log-Datei

Aug 10 09:13:37 linux postfix/smtpd[7859]: connect from unknown[192.168.1.199]
Aug 10 09:13:37 linux postfix/smtpd[7859]: 8F36016886: client=unknown[192.168.1.199]
Aug 10 09:13:37 linux postfix/cleanup[7861]: 8F36016886: message-id=<FB4E92D00824B74A9C27EFF2A064ED2E4237@sg-pdc-01.domain.de>
Aug 10 09:13:37 linux postfix/qmgr[7844]: 8F36016886: from=<hmuster@domain.de>, size=1392, nrcpt=1 (queue active)
Aug 10 09:13:37 linux postfix/smtpd[7859]: disconnect from unknown[192.168.1.199]
Aug 10 09:13:37 linux postfix/qmgr[7844]: 8F36016886: to=<m.test@gmx.de>, relay=none, delay=0, status=deferred (deferred transport)
Aug 10 09:14:06 linux postfix/smtpd[7859]: connect from unknown[192.168.1.199]
Aug 10 09:14:06 linux postfix/smtpd[7859]: 9FB1A168C0: client=unknown[192.168.1.199]
Aug 10 09:14:06 linux postfix/cleanup[7861]: 9FB1A168C0: message-id=<FB4E92D00824B74A9C27EFF2A064ED2E2587@sg-pdc-01.domain.de>
Aug 10 09:14:06 linux postfix/qmgr[7844]: 9FB1A168C0: from=<Administrator@domain.de>, size=2281, nrcpt=1 (queue active)
Aug 10 09:14:06 linux postfix/smtpd[7859]: disconnect from unknown[192.168.1.199]
Aug 10 09:14:06 linux postfix/qmgr[7844]: 9FB1A168C0: to=<mtest@gmx.de>, relay=none, delay=0, status=deferred (deferred transport)


Gruß, Stash

mbo
10.08.04, 07:29
Aug 10 09:14:06 linux postfix/smtpd[7859]: connect from unknown[192.168.1.199]
Aug 10 09:14:06 linux postfix/smtpd[7859]: 9FB1A168C0: client=unknown[192.168.1.199]
Aug 10 09:14:06 linux postfix/cleanup[7861]: 9FB1A168C0: message-id=<FB4E92D00824B74A9C27EFF2A064ED2E2587@sg-pdc-01.domain.de>
Aug 10 09:14:06 linux postfix/qmgr[7844]: 9FB1A168C0: from=<Administrator@domain.de>, size=2281, nrcpt=1 (queue active)
Aug 10 09:14:06 linux postfix/smtpd[7859]: disconnect from unknown[192.168.1.199]
Aug 10 09:14:06 linux postfix/qmgr[7844]: 9FB1A168C0: to=<mtest@gmx.de>, relay=none, delay=0, status=deferred (deferred transport)

Post doch bitte mal die .fetchmailrc (!Ohne Benutzername und Passwort!) und die /etc/postfix/transport.
Hast Du die transport mit


postmap /etc/postfix/transport

übersetzt?

cu/2 iae

stash
10.08.04, 07:53
hier das fetchmail:

poll pop.1und1.com
proto pop3
user "?????????"
pass "???????"
is *USER*
keep
fetchall
no ssl

und die Transport is ja leer, da ich noch nichts großartig gemacht habe.

Ich hab außerdem mal ein bisschen rumprobiert. Also Mails verschicken über den Smarthost (linuskiste) funzt. Nur der Server von 1und1 hat Probleme sobald ich Ihm mit einem anderen Absendernamen wie den Postfachbesitzer komme. Ich möchte ja mehrere Benutzer am Exchange betreiben und dann natürlich auch das Senden von Mails über den Smarthost ermöglichen. Was kann ich da tun?

Gruß, Stash

stash
10.08.04, 08:34
hallo!

Ich habs hinbekommen... Naja, ist ja auch klar. Ich muss die Benutzernamen, die ich zum versenden verwende ja auch als Postfach bei 1und1 haben. Der schaut ja dann einfach nach und gibt die Mail frei oder nicht. Soweit so gut.

Mein letztes Problem bis es funzt: die Transporttables.

Was muss ich da eintragen, um die Mail an den internen Exchange weiterleiten zu lassen?

Gruß, Stash

Dewitt
10.08.04, 09:10
Was muss ich da eintragen, um die Mail an den internen Exchange weiterleiten zu lassen?
http://postfix.state-of-mind.de/patrick.koetter/mailrelay/#d0e257

gruss,
Dennis

stash
10.08.04, 09:46
Ich glaub das funzt nicht...

fetchmail holt die Mail ab. Wie kommt die nun zum Exchange, der im internen Netz steht? das muss doch dann irgendwie mit fetchmail gehen oder wie läuft das sonst ab?

mbo
10.08.04, 10:01
Ich glaub das funzt nicht...

fetchmail holt die Mail ab. Wie kommt die nun zum Exchange, der im internen Netz steht? das muss doch dann irgendwie mit fetchmail gehen oder wie läuft das sonst ab?
Normalerweise so wie bei der Post:
Du holst mit fetchmail die eMails ab, der sortiert sie und übergibt diese an Postfix zum zustellen, Postfix weiß, daß er Relay für Deine Domain ist, und gibt sie an den Exchange weiter. Vorausgesetzt, Du hast Postfix richtig konfiguriert:
mail.cfg
transport

Und was steht im Log (/var/log/mail)?
Gern übersprungen:


postmap /etc/postfix/transport


cu/2 iae

stash
10.08.04, 10:08
gut, wir kommen dem Problem näher. Der Exchange steht im internen Netz. Die Linuxkiste (postfix) ist der Outermail, wenn man so will. Fetchmail holt die Mail ab und soll sie an den internen Exchange Server weiterleiten (tut er ja bis jetzt nicht). Wenn ein Benutzer eine Mail schreibt, dann wird sie über Exchange an den POstfix geschickt, der wiederum den 1&1 Server als SMTP-Relay nutzt --> Das klappt ja soweit.

Jetzt nun das Problem: Wenn ich das jetzt so konfiguriere wie du es schreibst, dann versucht POstfix die Mail die er ja von fetchmail bekommen hat zuzustellen. Allerdings fragt er dabei ja immer den einen SMTP-Relay und das ist bekanntlich der von 1und1.

Was kann ich jetzt machen?

Sag jetzt aber bitte nicht RTFM ... *gg*


Gruß, Stash

stash
10.08.04, 11:31
wo liegt denn hier der Fehler???


fetchmail: 6.2.3 querying pop.1und1.com (protocol POP3) at Tue Aug 10 12:01:20 2004: poll started
fetchmail: POP3< +OK POP3 server ready
fetchmail: POP3> CAPA
fetchmail: POP3< +OK capability list follows
fetchmail: POP3< TOP
fetchmail: POP3< USER
fetchmail: POP3< UIDL
fetchmail: POP3< PIPELINING
fetchmail: POP3< .
fetchmail: POP3> USER m36530368-12
fetchmail: POP3< +OK
fetchmail: POP3> PASS
fetchmail: POP3< +OK
fetchmail: POP3> STAT
fetchmail: POP3< +OK 1 3811
1 message for m36530368-12 at pop.1und1.com (3811 octets).
fetchmail: POP3> LIST
fetchmail: POP3< +OK
fetchmail: POP3< 1 3811
fetchmail: POP3< .
fetchmail: POP3> RETR 1
fetchmail: POP3< +OK 3811 octets
reading message m36530368-12@pop.kundenserver.de:1 of 1 (3811 octets)
fetchmail: SMTP< 220 sg-pdc-01.fbs-bergmeister.de Microsoft ESMTP MAIL Service, Version: 6.0.3790.0 ready at Tue, 10 Aug 2004 12:32:03 +0200
fetchmail: SMTP> EHLO localhost
fetchmail: SMTP< 250-sg-pdc-01.fbs-bergmeister.de Hello [192.168.1.200]
fetchmail: SMTP< 250-TURN
fetchmail: SMTP< 250-SIZE
fetchmail: SMTP< 250-ETRN
fetchmail: SMTP< 250-PIPELINING
fetchmail: SMTP< 250-DSN
fetchmail: SMTP< 250-ENHANCEDSTATUSCODES
fetchmail: SMTP< 250-8bitmime
fetchmail: SMTP< 250-BINARYMIME
fetchmail: SMTP< 250-CHUNKING
fetchmail: SMTP< 250-VRFY
fetchmail: SMTP< 250-X-EXPS GSSAPI NTLM LOGIN
fetchmail: SMTP< 250-X-EXPS=LOGIN
fetchmail: SMTP< 250-AUTH GSSAPI NTLM LOGIN
fetchmail: SMTP< 250-AUTH=LOGIN
fetchmail: SMTP< 250-X-LINK2STATE
fetchmail: SMTP< 250-XEXCH50
fetchmail: SMTP< 250 OK
fetchmail: SMTP> MAIL FROM:<priess.mathias@fbs-bergmeister.de> SIZE=3811
fetchmail: SMTP< 250 2.1.0 priess.mathias@fbs-bergmeister.de....Sender OK
fetchmail: SMTP> RCPT TO:<administrator@sg-pdc-01.fbs-bergmeister.de>
fetchmail: SMTP< 250 2.1.5 administrator@sg-pdc-01.fbs-bergmeister.de
fetchmail: SMTP> DATA
fetchmail: SMTP< 354 Start mail input; end with <CRLF>.<CRLF>
#**************************************.********** *************.**************fetchmail: SMTP>. (EOM)
fetchmail: SMTP< 250 2.6.0 <E1BuTth-0001jQ-00@mrelayng.kundenserver.de> Queued mail for delivery
flushed
fetchmail: POP3> DELE 1
fetchmail: POP3< +OK
fetchmail: POP3> QUIT
fetchmail: POP3< +OK
fetchmail: 6.2.3 querying pop.1und1.com (protocol POP3) at Tue Aug 10 12:01:28 2004: poll completed
fetchmail: SMTP> QUIT
fetchmail: SMTP< 221 2.0.0 sg-pdc-01.fbs-bergmeister.de Service closing transmission channel
fetchmail: normal termination, status 0

stash
10.08.04, 11:32
wo liegt denn hier der Fehler???


fetchmail: 6.2.3 querying pop.1und1.com (protocol POP3) at Tue Aug 10 12:01:20 2004: poll started
fetchmail: POP3< +OK POP3 server ready
fetchmail: POP3> CAPA
fetchmail: POP3< +OK capability list follows
fetchmail: POP3< TOP
fetchmail: POP3< USER
fetchmail: POP3< UIDL
fetchmail: POP3< PIPELINING
fetchmail: POP3< .
fetchmail: POP3> USER m???????-12
fetchmail: POP3< +OK
fetchmail: POP3> PASS
fetchmail: POP3< +OK
fetchmail: POP3> STAT
fetchmail: POP3< +OK 1 3811
1 message for m????????-12 at pop.1und1.com (3811 octets).
fetchmail: POP3> LIST
fetchmail: POP3< +OK
fetchmail: POP3< 1 3811
fetchmail: POP3< .
fetchmail: POP3> RETR 1
fetchmail: POP3< +OK 3811 octets
reading message m?????-12@pop.kundenserver.de:1 of 1 (3811 octets)
fetchmail: SMTP< 220 sg-pdc-01.fbs-bergmeister.de Microsoft ESMTP MAIL Service, Version: 6.0.3790.0 ready at Tue, 10 Aug 2004 12:32:03 +0200
fetchmail: SMTP> EHLO localhost
fetchmail: SMTP< 250-sg-pdc-01.fbs-bergmeister.de Hello [192.168.1.200]
fetchmail: SMTP< 250-TURN
fetchmail: SMTP< 250-SIZE
fetchmail: SMTP< 250-ETRN
fetchmail: SMTP< 250-PIPELINING
fetchmail: SMTP< 250-DSN
fetchmail: SMTP< 250-ENHANCEDSTATUSCODES
fetchmail: SMTP< 250-8bitmime
fetchmail: SMTP< 250-BINARYMIME
fetchmail: SMTP< 250-CHUNKING
fetchmail: SMTP< 250-VRFY
fetchmail: SMTP< 250-X-EXPS GSSAPI NTLM LOGIN
fetchmail: SMTP< 250-X-EXPS=LOGIN
fetchmail: SMTP< 250-AUTH GSSAPI NTLM LOGIN
fetchmail: SMTP< 250-AUTH=LOGIN
fetchmail: SMTP< 250-X-LINK2STATE
fetchmail: SMTP< 250-XEXCH50
fetchmail: SMTP< 250 OK
fetchmail: SMTP> MAIL FROM:<USER@fbs-bergmeister.de> SIZE=3811
fetchmail: SMTP< 250 2.1.0 USER@fbs-bergmeister.de....Sender OK
fetchmail: SMTP> RCPT TO:<administrator@sg-pdc-01.fbs-bergmeister.de>
fetchmail: SMTP< 250 2.1.5 administrator@sg-pdc-01.fbs-bergmeister.de
fetchmail: SMTP> DATA
fetchmail: SMTP< 354 Start mail input; end with <CRLF>.<CRLF>
#**************************************.********** *************.**************fetchmail: SMTP>. (EOM)
fetchmail: SMTP< 250 2.6.0 <E1BuTth-0001jQ-00@mrelayng.kundenserver.de> Queued mail for delivery
flushed
fetchmail: POP3> DELE 1
fetchmail: POP3< +OK
fetchmail: POP3> QUIT
fetchmail: POP3< +OK
fetchmail: 6.2.3 querying pop.1und1.com (protocol POP3) at Tue Aug 10 12:01:28 2004: poll completed
fetchmail: SMTP> QUIT
fetchmail: SMTP< 221 2.0.0 sg-pdc-01.fbs-bergmeister.de Service closing transmission channel
fetchmail: normal termination, status 0

stash
10.08.04, 11:33
die fetchmailrc für den Benutzer sieht so aus:

poll pop.1und1.com
proto pop3
user "????????-12"
pass "???????"
is administrator@sg-pdc-01.fbs-bergmeister.de
nokeep
fetchall
no ssl
smtp 192.168.1.199


Gruß, Stash

mbo
10.08.04, 12:18
die fetchmailrc für den Benutzer sieht so aus:

poll pop.1und1.com
proto pop3
user "????????-12"
pass "???????"
is administrator@sg-pdc-01.fbs-bergmeister.de
nokeep
fetchall
no ssl
smtp 192.168.1.199


Gruß, Stash
Bis jetzt sehe ich keine Fehler, mich interessiert deswegen ja auch, wie postfix konfiguriert ist, und was das maillog sagt.

cu/2 iae

stash
10.08.04, 13:13
das Maillog sagt das:

Aug 10 13:00:29 linux postfix/master[5757]: daemon started -- version 2.0.14
Aug 10 13:02:01 linux postfix/pickup[5760]: 1B13A168F8: uid=500 from=<mpriess>
Aug 10 13:02:01 linux postfix/cleanup[5875]: 1B13A168F8: message-id=<20040810110201.1B13A168F8@linux.fbs.local>
Aug 10 13:02:01 linux postfix/qmgr[5761]: 1B13A168F8: from=<priess.mathias@fbs-bergmeister.de>, size=525, nrcpt=1 (queue active)
Aug 10 13:02:01 linux postfix/local[5877]: 1B13A168F8: to=<mpriess@linux.fbs.local>, orig_to=<mpriess>, relay=local, delay=0, status=sent (mailbox)
Aug 10 13:02:04 linux postfix/pickup[5760]: 8D01C1504F: uid=500 from=<mpriess>
Aug 10 13:02:04 linux postfix/cleanup[5875]: 8D01C1504F: message-id=<20040810110204.8D01C1504F@linux.fbs.local>
Aug 10 13:02:04 linux postfix/qmgr[5761]: 8D01C1504F: from=<priess.mathias@fbs-bergmeister.de>, size=1269, nrcpt=1 (queue active)
Aug 10 13:02:04 linux postfix/cleanup[5875]: 9516315153: message-id=<20040810110204.8D01C1504F@linux.fbs.local>
Aug 10 13:02:04 linux postfix/local[5877]: 8D01C1504F: to=<root@linux.fbs.local>, orig_to=<root>, relay=local, delay=0, status=sent (forwarded as 9516315153)
Aug 10 13:02:04 linux postfix/qmgr[5761]: 9516315153: from=<priess.mathias@fbs-bergmeister.de>, size=1401, nrcpt=1 (queue active)
Aug 10 13:02:04 linux postfix/qmgr[5761]: 9516315153: to=<administrator@sg-pdc-01.fbs-bergmeister.de>, orig_to=<root>, relay=none, delay=0, status=deferred (deferred transport)
Aug 10 13:02:59 linux postfix/qmgr[5761]: 9516315153: from=<priess.mathias@fbs-bergmeister.de>, size=1401, nrcpt=1 (queue active)
Aug 10 13:03:00 linux postfix/smtp[6018]: 9516315153: to=<administrator@sg-pdc-01.fbs-bergmeister.de>, orig_to=<root>, relay=smtp.1und1.com[212.227.15.129], delay=56, status=sent (250 OK id=1BuVTF-0003Lu-00)



Gruß, Stash

stash
10.08.04, 13:15
und die main.cf sieht im wesentlichen so aus:

readme_directory = /usr/share/doc/packages/postfix/README_FILES
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
virtual_maps = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
myhostname = linux.fbs.local
program_directory = /usr/lib/postfix
masquerade_domains = fbs-bergmeister.de
mydestination = $myhostname,localhost.$mydomain,$mydomain
defer_transports = smtp
disable_dns_lookups = yes
relayhost = smtp.1und1.com
mailbox_command =
mailbox_transport =
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
strict_rfc821_envelopes = no
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtp_sasl_auth_enable = yes
smtpd_sasl_auth_enable = no
smtpd_use_tls = no
smtp_use_tls = no
alias_maps = hash:/etc/aliases
mailbox_size_limit = 0
message_size_limit = 10240000
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

stash
11.08.04, 08:13
Hallo hier ist der Stash nochmal,

was soll ich sagen: es funzt immer noch nicht. Zumindest nicht richtig.

-ich hab fetchmail so konfiguriert, dass er die Mails an einen lokalen Benutzer
schickt.

-Postfix soll diese Mail aber direkt an einen Mailserver im gleichen Netz
schicken. Postfix hat 192.168.1.199 [linux.fbs-bergmeister.de] und soll die
Mail an 192.168.1.200 [sg-pdc-01.fbs-bergmeister.de] schicken.

-damit aber nicht genug. Der interne Mailverkehr geht ja an sich über sg-pdc-
01 (Exchange). Wenn jetzt aber eine Mail an eine andere Domain geht, muss
sie über den Postfix nach draußen (sg-pdc-01 muss also irgendwie als
vertrauenswürdiger Host zum relayen eingetragen werden).

Ich poste jetzt nochmal meine main.cf:

readme_directory = /usr/share/doc/packages/postfix/README_FILES
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
virtual_maps = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
myhostname = linux.fbs-bergmeister.de
program_directory = /usr/lib/postfix
inet_interfaces = all
masquerade_domains =
mydestination = $myhostname,localhost.$mydomain,$mydomain, fbs-bergmeister.de
defer_transports = smtp
disable_dns_lookups = yes
relayhost = smtp.1und1.com
content_filter =
mailbox_command =
mailbox_transport =
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
strict_rfc821_envelopes = no
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtp_sasl_auth_enable = yes
smtpd_sasl_auth_enable = no
smtpd_use_tls = no
smtp_use_tls = no
alias_maps = hash:/etc/aliases
mailbox_size_limit = 0
message_size_limit = 10240000
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
mynetworks = 192.168.1.0/24, 127.0.0.0/8


Wenn da noch was mit transport dazu kommt: Ich hab dort bis jetzt nur rumprobiert, weil irgendwo anders was nicht stimmte und diese Einstellungen keine Wirkung gehabt haben. Jetzt hab ich sie aber leer.

Hoffe ihr könnt mir helfen... Bin hier fast schon am verzweifeln. Vor allem es lief ja schon fast. Er hatte dann nur 2 Mails verschickt eine intern an den Exchange und eine nach draußen an den 1und1-Server.

Gruß, Stash