Sorry, die Maschine heißt OPENBSD - nicht TEST_OPENBSD - war ein Copy - Paste Fehler!
Zu meinen Settings auf OpenBSD:
vi /etc/mail/aliases
root: root@OPENBSD, root@UBUNTU
vi /etc/mail/smtpd.conf
listen on lo0
action "local_mail" mbox alias <aliases>
action "outbound" relay
action "relay" relay host "smtp://192.168.100.86:25"
match for any action "relay"
match from local for local action "local_mail"
match from local for any action "outbound"
Wen ich jetzt eine Mail auf OPENBSD erzeuge echo "Hello, world" | mail -s "Hi" root
sehe ich den nachfolgenden Traffic auf UBUNTU:
ethertype IPv4 (0x0800), length 78: 192.168.100.83.46532 > 192.168.100.86.25: Flags [S], seq 2238993009, win 16384, options [mss 1460,nop,nop,sackOK,nop,wscale 6,nop,nop,TS val 2351022999 ecr 0], length 0
ethertype IPv4 (0x0800), length 74: 192.168.100.86.25 > 192.168.100.83.46532: Flags [S.], seq 2458074013, ack 2238993010, win 65160, options [mss 1460,sackOK,TS val 4126245444 ecr 2351022999,nop,wscale 7], length 0
ethertype IPv4 (0x0800), length 66: 192.168.100.83.46532 > 192.168.100.86.25: Flags [.], ack 1, win 256, options [nop,nop,TS val 2351022999 ecr 4126245444], length 0
ethertype IPv4 (0x0800), length 110: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 1:45, ack 1, win 510, options [nop,nop,TS val 4126245474 ecr 2351022999], length 44: SMTP: 220 SRV-DEV-VIP-040 ESMTP Postfix (Ubuntu)
ethertype IPv4 (0x0800), length 85: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 1:20, ack 45, win 256, options [nop,nop,TS val 2351023000 ecr 4126245474], length 19: SMTP: EHLO TEST_OPENBSD
ethertype IPv4 (0x0800), length 66: 192.168.100.86.25 > 192.168.100.83.46532: Flags [.], ack 20, win 510, options [nop,nop,TS val 4126245475 ecr 2351023000], length 0
ethertype IPv4 (0x0800), length 218: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 45:197, ack 20, win 510, options [nop,nop,TS val 4126245476 ecr 2351023000], length 152: SMTP: 250-SRV-DEV-VIP-040
ethertype IPv4 (0x0800), length 76: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 20:30, ack 197, win 256, options [nop,nop,TS val 2351023000 ecr 4126245476], length 10: SMTP: STARTTLS
ethertype IPv4 (0x0800), length 96: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 197:227, ack 30, win 510, options [nop,nop,TS val 4126245477 ecr 2351023000], length 30: SMTP: 220 2.0.0 Ready to start TLS
ethertype IPv4 (0x0800), length 333: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 30:297, ack 227, win 256, options [nop,nop,TS val 2351023000 ecr 4126245477], length 267: SMTP
ethertype IPv4 (0x0800), length 1373: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 227:1534, ack 297, win 508, options [nop,nop,TS val 4126245484 ecr 2351023000], length 1307: SMTP
ethertype IPv4 (0x0800), length 72: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 297:303, ack 1534, win 256, options [nop,nop,TS val 2351023000 ecr 4126245484], length 6: SMTP
ethertype IPv4 (0x0800), length 66: 192.168.100.86.25 > 192.168.100.83.46532: Flags [.], ack 303, win 508, options [nop,nop,TS val 4126245529 ecr 2351023000], length 0
ethertype IPv4 (0x0800), length 140: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 303:377, ack 1534, win 256, options [nop,nop,TS val 2351023000 ecr 4126245529], length 74: SMTP
ethertype IPv4 (0x0800), length 66: 192.168.100.86.25 > 192.168.100.83.46532: Flags [.], ack 377, win 508, options [nop,nop,TS val 4126245529 ecr 2351023000], length 0
ethertype IPv4 (0x0800), length 321: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 1534:1789, ack 377, win 508, options [nop,nop,TS val 4126245534 ecr 2351023000], length 255: SMTP
ethertype IPv4 (0x0800), length 107: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 377:418, ack 1789, win 252, options [nop,nop,TS val 2351023000 ecr 4126245534], length 41: SMTP
ethertype IPv4 (0x0800), length 321: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 1789:2044, ack 418, win 508, options [nop,nop,TS val 4126245590 ecr 2351023000], length 255: SMTP
ethertype IPv4 (0x0800), length 66: 192.168.100.83.46532 > 192.168.100.86.25: Flags [.], ack 2044, win 256, options [nop,nop,TS val 2351023000 ecr 4126245590], length 0
ethertype IPv4 (0x0800), length 226: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 2044:2204, ack 418, win 508, options [nop,nop,TS val 4126245783 ecr 2351023000], length 160: SMTP
ethertype IPv4 (0x0800), length 119: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 418:471, ack 2204, win 256, options [nop,nop,TS val 2351023000 ecr 4126245783], length 53: SMTP
ethertype IPv4 (0x0800), length 102: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 2204:2240, ack 471, win 508, options [nop,nop,TS val 4126245796 ecr 2351023000], length 36: SMTP
ethertype IPv4 (0x0800), length 117: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 471:522, ack 2240, win 256, options [nop,nop,TS val 2351023000 ecr 4126245796], length 51: SMTP
ethertype IPv4 (0x0800), length 102: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 2240:2276, ack 522, win 508, options [nop,nop,TS val 4126245807 ecr 2351023000], length 36: SMTP
ethertype IPv4 (0x0800), length 94: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 522:550, ack 2276, win 256, options [nop,nop,TS val 2351023000 ecr 4126245807], length 28: SMTP
ethertype IPv4 (0x0800), length 125: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 2276:2335, ack 550, win 508, options [nop,nop,TS val 4126245809 ecr 2351023000], length 59: SMTP
ethertype IPv4 (0x0800), length 440: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 550:924, ack 2335, win 256, options [nop,nop,TS val 2351023000 ecr 4126245809], length 374: SMTP
ethertype IPv4 (0x0800), length 66: 192.168.100.86.25 > 192.168.100.83.46532: Flags [.], ack 924, win 506, options [nop,nop,TS val 4126245853 ecr 2351023000], length 0
ethertype IPv4 (0x0800), length 91: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 924:949, ack 2335, win 256, options [nop,nop,TS val 2351023000 ecr 4126245853], length 25: SMTP
ethertype IPv4 (0x0800), length 66: 192.168.100.86.25 > 192.168.100.83.46532: Flags [.], ack 949, win 506, options [nop,nop,TS val 4126245853 ecr 2351023000], length 0
ethertype IPv4 (0x0800), length 125: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 2335:2394, ack 949, win 506, options [nop,nop,TS val 4126245864 ecr 2351023000], length 59: SMTP
ethertype IPv4 (0x0800), length 66: 192.168.100.83.46532 > 192.168.100.86.25: Flags [.], ack 2394, win 256, options [nop,nop,TS val 2351023001 ecr 4126245864], length 0
ethertype IPv4 (0x0800), length 94: 192.168.100.83.46532 > 192.168.100.86.25: Flags [P.], seq 949:977, ack 2394, win 256, options [nop,nop,TS val 2351023021 ecr 4126245864], length 28: SMTP
ethertype IPv4 (0x0800), length 103: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 2394:2431, ack 977, win 506, options [nop,nop,TS val 4126255974 ecr 2351023021], length 37: SMTP
ethertype IPv4 (0x0800), length 66: 192.168.100.83.46532 > 192.168.100.86.25: Flags [F.], seq 977, ack 2431, win 256, options [nop,nop,TS val 2351023021 ecr 4126255974], length 0
ethertype IPv4 (0x0800), length 90: 192.168.100.86.25 > 192.168.100.83.46532: Flags [P.], seq 2431:2455, ack 978, win 506, options [nop,nop,TS val 4126255975 ecr 2351023021], length 24: SMTP
ethertype IPv4 (0x0800), length 66: 192.168.100.86.25 > 192.168.100.83.46532: Flags [F.], seq 2455, ack 978, win 506, options [nop,nop,TS val 4126255976 ecr 2351023021], length 0
ethertype IPv4 (0x0800), length 60: 192.168.100.83.46532 > 192.168.100.86.25: Flags [R], seq 2238993987, win 0, length 0
ethertype IPv4 (0x0800), length 60: 192.168.100.83.46532 > 192.168.100.86.25: Flags [R], seq 2238993987, win 0, length 0
Die Settings von UBUNTU:
apt-get install mailutils (mit der Option Internet mit Smarthost)
nano /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = UBUNTU
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, 192.168.100.86, UBUNTU, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128, 192.168.100.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
Nachricht 1 intern verschickt mit echo "test" | mail root
Nachricht 2 intern verschickt mit echo "test" | mail root@192.168.100.86
Nachricht 3 intern verschickt mit echo "test" | mail root@UBUNTU
root@UBUNTU# mail
"/var/mail/root": 3 Nachrichten 3 neue
>N 1 root Fr Nov 13 13:43 12/419
N 2 Mail Delivery Syst Fr Nov 13 13:44 69/2202 Undelivered Mail Returned to Sender
N 3 root Fr Nov 13 13:45 12/419
Ich hoffe, dass jetzt alle benötigten Informationen dabei sind.
Noch eine Frage am Rande: Warum ist matcht er immer nur den ersten Eintrag in der smtpd.conf bei OPENBSD? Ich möchte, dass er die mail auf dem OPENBSD lokal speichert und an den MailServer weiterschickt!