<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Moin zusammen,</p>
<p>ich betreibe einen kleinen mail server unter postfix und dovecot.</p>
<p>Sieve ist installiert und funktioniert grundsätzlich.</p>
<p>Nun hat sich eine neue Aufgabe gestellt, bei der ich eingehende
E-Mails an ein anderes Postfach weiterleiten muss.</p>
<p>Der Befehl "redirect" ist im Einsatz.</p>
<p>Leider funktioniert das bislang nicht. Zwar wird die E-Mail
korrekt bearbeitet und an den SMTP Dienst zur Übermittlung
übergeben, aber es wird nicht der konfigurierte Smart-Host als
Relay verwendet, sondern immer das entfernte Mailgateway
angesprochen, was aus offensichtlichen Gründen nicht funktioniert.</p>
<p>Ich habe die beschriebene Problemstellung zwar per Google im Netz
gefunden -ich bin also nicht der erste/einzige der dieses Phänomen
hat, aber eine Lösung erschließt sich mir nicht.</p>
<p>Ein Lösungsansatz in einem Fall war es, daß in der Postfix
Konfiguration "mydestination" mit der eigenen Domäne ergänzt
werden sollte.<br>
Das funktioniert bei mir nicht, da ich mit virtuellen Mailboxen
arbeite.<br>
Die Fehlermeldung im mail.log gibt dann das zurück:</p>
<p>May 14 14:30:06 dersapp005 postfix/trivial-rewrite[3929]:
warning: do not list domain ****.** in BOTH mydestination and
virtual_mailbox_domains</p>
<p>Hier noch der aktuelle Versuch des Sieve Script:</p>
<p>#####</p>
<p>require ["fileinto", "subaddress", "editheader", "envelope",
"imap4flags", "variables", "regex", "include", "vacation"];<br>
<br>
keep;<br>
<br>
if envelope :matches "From" "*" {<br>
deleteheader "Reply-To";<br>
addheader "Reply-To" "${1}";<br>
deleteheader "From";<br>
addheader "From" "max mustermann <a
class="moz-txt-link-rfc2396E" href="mailto:max@meinedomain.de"
moz-do-not-send="true"><max@meinedomain.de></a>";<br>
deleteheader "To";<br>
addheader "To" "max mustermann <a class="moz-txt-link-rfc2396E"
href="mailto:maxmustermann@googlemail.com"
moz-do-not-send="true"><maxmustermann@googlemail.com></a>";<br>
deleteheader "DKIM-Signature";<br>
deleteheader "DomainKey-Signature";<br>
deleteheader "X-DKIM";<br>
deleteheader "X-DomainKeys";<br>
redirect <a class="moz-txt-link-rfc2396E"
href="mailto:maxmustermann@googlemail.com"
moz-do-not-send="true">"maxmustermann@googlemail.com"</a>;<br>
}<br>
</p>
<p>####</p>
<p>Und einmal das Maillog zu einem Test (die fälschlich benutzen
relay in <b>FETT</b>):<br>
</p>
<p>############</p>
<p>May 14 14:48:57 dersapp005 postfix/qmgr[3922]: 5433DE09F7: from=<a
class="moz-txt-link-rfc2396E"
href="mailto:somebody@somewhere.tld" moz-do-not-send="true"><somebody@somewhere.tld></a>,
size=17789, nrcpt=1 (queue active)<br>
May 14 14:48:57 dersapp005 postfix/smtpd[4074]: disconnect from
mail-japaneastazon11013041.outbound.protection.outlook.com[52.101.127.41]
ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7<br>
May 14 14:48:57 dersapp005 dovecot:
lda(<a class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:MaxMustermann@meinedomain.de"
moz-do-not-send="true">MaxMustermann@meinedomain.de</a>)<4087><AcqCDDmRJGj3DwAA5gidrQ>:
sieve:
msgid=<a class="moz-txt-link-rfc2396E"
href="mailto:FR6P281MB36126E31D065D5195D9AF794F791A@FR6P281MB3612.DEUP281.PROD.OUTLOOK.COM"
moz-do-not-send="true"><FR6P281MB36126E31D065D5195D9AF794F791A@FR6P281MB3612.DEUP281.PROD.OUTLOOK.COM></a>:
stored mail into mailbox 'INBOX'<br>
May 14 14:48:57 dersapp005 postfix/pipe[4079]: 5D611E0606: to=<a
class="moz-txt-link-rfc2396E"
href="mailto:MaxMustermann@meinedomain.de"
moz-do-not-send="true"><MaxMustermann@meinedomain.de></a>,
relay=dovecot, delay=1.1, delays=0.78/0.01/0/0.29, dsn=2.0.0,
status=sent (delivered via dovecot service)<br>
May 14 14:48:57 dersapp005 postfix/qmgr[3922]: 5D611E0606: removed<br>
May 14 14:48:58 dersapp005 postfix/smtp[4084]: 5433DE09F7: to=<a
class="moz-txt-link-rfc2396E"
href="mailto:CarlaMusterfrau@googlemail.com"
moz-do-not-send="true"><CarlaMusterfrau@googlemail.com></a>,
<b>relay=gmail-smtp-in.l.google.com[74.125.133.27]:25</b>,
delay=0.91, delays=0.09/0/0.22/0.6, dsn=5.7.26, status=bounced
(host gmail-smtp-in.l.google.com[74.125.133.27] said: 550-5.7.26
Your email has been blocked because the sender is unauthenticated.
550-5.7.26 Gmail requires all senders to authenticate with either
SPF or DKIM. 550-5.7.26 550-5.7.26 Authentication results:
550-5.7.26 DKIM = did not pass 550-5.7.26 SPF [somewhere.tld]
with ip: [92.117.15.38] = did not pass 550-5.7.26 550-5.7.26 For
instructions on setting up authentication, go to 550 5.7.26 <a
class="moz-txt-link-freetext"
href="https://support.google.com/mail/answer/81126#authentication"
moz-do-not-send="true">https://support.google.com/mail/answer/81126#authentication</a>
ffacd0b85a97d-3a1f5c1b493si10109148f8f.809 - gsmtp (in reply to
end of DATA command))<br>
May 14 14:48:58 dersapp005 postfix/cleanup[4078]: 3DD27E09AD:
message-id=<a class="moz-txt-link-rfc2396E"
href="mailto:20250514124858.3DD27E09AD@smtp.meinedomain.de"
moz-do-not-send="true"><20250514124858.3DD27E09AD@smtp.meinedomain.de></a><br>
May 14 14:48:58 dersapp005 postfix/qmgr[3922]: 3DD27E09AD:
from=<>, size=20809, nrcpt=1 (queue active)<br>
May 14 14:48:58 dersapp005 postfix/bounce[4085]: 5433DE09F7:
sender non-delivery notification: 3DD27E09AD<br>
May 14 14:48:58 dersapp005 postfix/qmgr[3922]: 5433DE09F7: removed<br>
May 14 14:49:00 dersapp005 postfix/smtp[4084]: 3DD27E09AD: to=<a
class="moz-txt-link-rfc2396E"
href="mailto:somebody@somewhere.tld" moz-do-not-send="true"><somebody@somewhere.tld></a>,
<b>relay=somewhere-tld.mail.protection.outlook.com[52.101.137.2]:25</b>,
delay=1.9, delays=0.05/0.01/1.5/0.42, dsn=5.7.1, status=bounced
(host somewhere-tld.mail.protection.outlook.com[52.101.137.2]
said: 550 5.7.1 Service unavailable, Client host [92.117.15.38]
blocked using Spamhaus. To request removal from this list see <a
class="moz-txt-link-freetext"
href="https://www.spamhaus.org/query/ip/92.117.15.38"
moz-do-not-send="true">https://www.spamhaus.org/query/ip/92.117.15.38</a>
AS(1450) [SG1PEPF000082E2.apcprd02.prod.outlook.com
2025-05-14T12:48:59.855Z 08DD8B2C46BE2A4F] (in reply to RCPT TO
command))<br>
May 14 14:49:00 dersapp005 postfix/qmgr[3922]: 3DD27E09AD: removed<br>
</p>
<p>############</p>
<p>Und so sieht es aus, wenn eine Mail aus dem Mailclient gesendet
wird (hier das korrekte Relay in <b>FETT</b>):</p>
<p>############</p>
<p>May 14 15:26:07 dersapp005 postfix/smtpd[4244]: connect from
MeinDesktop.meinedomain.de[10.10.10.197]<br>
May 14 15:26:08 dersapp005 postfix/smtpd[4244]: DA9C4E09AD:
client=MeinDesktop.meinedomain.de[10.10.10.197],
sasl_method=PLAIN, <a
class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:sasl_username=MaxMustermann@meinedomain.de"
moz-do-not-send="true">sasl_username=MaxMustermann@meinedomain.de</a><br>
May 14 15:26:08 dersapp005 postfix/cleanup[4247]: DA9C4E09AD:
message-id=<a class="moz-txt-link-rfc2396E"
href="mailto:995232a9-f8f5-446c-b616-ad9213bc2d66@meinedomain.de"
moz-do-not-send="true"><995232a9-f8f5-446c-b616-ad9213bc2d66@meinedomain.de></a><br>
May 14 15:26:08 dersapp005 postfix/qmgr[3922]: DA9C4E09AD: from=<a
class="moz-txt-link-rfc2396E"
href="mailto:MaxMustermann@meinedomain.de"
moz-do-not-send="true"><MaxMustermann@meinedomain.de></a>,
size=660, nrcpt=1 (queue active)<br>
May 14 15:26:09 dersapp005 dovecot: imap(<a
class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:MaxMustermann@meinedomain.de"
moz-do-not-send="true">MaxMustermann@meinedomain.de</a>)<4241></8Luexg1wd4KCgrF>:
Disconnected: Logged out in=796 out=2855 deleted=0 expunged=0
trashed=0 hdr_count=2 hdr_bytes=579 body_count=0 body_bytes=0<br>
May 14 15:26:09 dersapp005 postfix/smtp[4248]: DA9C4E09AD: to=<a
class="moz-txt-link-rfc2396E"
href="mailto:CarlaMusterfrau@googlemail.com"
moz-do-not-send="true"><CarlaMusterfrau@googlemail.com></a>,
relay=<b>smtp.kontent.com[31.47.255.221]</b>:25, delay=0.53,
delays=0.09/0.03/0.37/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok:
queued as 58A151A204E9)<br>
May 14 15:26:09 dersapp005 postfix/qmgr[3922]: DA9C4E09AD: removed<br>
</p>
<p>############<br>
</p>
<p>Wie kann ich das Lösen?</p>
<p>Carsten<br>
</p>
</body>
</html>