For my link archive: [WayBack] Forced routing of selective emails to ISP SMTP via Mikrotik Routing | Syed Jahanzaib Personal Blog to Share Knowledge !
–jeroen
Posted by jpluimers on 2021/01/14
For my link archive: [WayBack] Forced routing of selective emails to ISP SMTP via Mikrotik Routing | Syed Jahanzaib Personal Blog to Share Knowledge !
–jeroen
Posted in Development, MikroTik, Power User, RouterOS, Routers, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2020/11/13
Archiving Google Product Forum URLs is a pain in the butt for a couple of reasons:
So the trick for saving is:
/forum/#!topic/
based URL to the /d/topic/
based onearchive.is/?run=1&url=
, then save–jeroen
Posted in Conference Topics, Conferences, Event, Internet, InternetArchive, Power User, WayBack machine | Leave a Comment »
Posted by jpluimers on 2020/11/04
Multi-WAN routing always involves marking incoming connections to the replies go out on the same connection: [WayBack] Mikrotik Remote Access via Multiple WAN Links | Syed Jahanzaib Personal Blog to Share Knowledge !
# Mirkotik IP Firewall Mangle Section
/ ip firewall mangle
# Mark traffic coming via WAN-1 link
add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_incoming_conn
# Mark traffic coming via WAN-2 link
add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_incoming_conn
# Mark traffic routing mark for above marked connection for WAN-1 , so that mikrotik will return traffic via same interface it came in
add chain=output connection-mark=WAN1_incoming_conn action=mark-routing new-routing-mark=to_WAN1
# Mark traffic routing mark for above marked connection for WAN-2, so that mikrotik will return traffic via same interface it came in
add chain=output connection-mark=WAN2_incoming_conn action=mark-routing new-routing-mark=to_WAN2
# Finally Add appropriate routes in ROUTE section
/ ip route
add dst-address=0.0.0.0/0 gateway=1.1.1.2 routing-mark=to_WAN1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=2.2.2.2 routing-mark=to_WAN2 check-gateway=ping
Related:
–jeroen
Posted in Development, Internet, MikroTik, Power User, RouterOS, Routers, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2020/10/15
Postfix has documentation on primary MX and secondary MX, but not on tertiary MX.
If the primary MX is down, you have a series of secondary MX and tertiary MX that configured the same way, MX DNS priority for primary, the series of secondary MX and tertiary MX have increasing numbers, and the primary MX goes down, then senders can get “too many hops” as secondary and tertiary MX are looping.
I had a hard time finding a good and easy solution as these queries do not return many meaningful results:
Here are some links that helped getting this solved:
Short answer: this message means that mail is probably looping. If you see this after you turned on Postfix content filtering, then you have made a mistake that causes mail to be filtered repeatedly. This is cured by appropriate use of content_filter=, header_checks=, and body_checks=.
Long answer: the message has too many
Received:
message headers. A received header is added whenever Postfix (or any MTA) receives a message. A large number ofReceived:
message headers is an indication that mail is looping around.Side comment: email uses the opposite of the technique that is used to avoid IP forwarding loops. With IP, the sender sets a TTL (time to live) field in the IP header. The field is decremented by each router. When the TTL reaches zero the packet is discarded and an ICMP error message is returned to the sender.
In case you or anyone else was/is wondering about the
mydestination = localhost
thing, the reason it has to be set to just localhost is because MIAB uses Postfix’s “virtual domain hosting” (http://www.postfix.org/VIRTUAL_README.html) support. Per the documentation formydestination
at http://www.postfix.org/postconf.5.html#mydestination:Do not specify the names of virtual domains – those domains are specified elsewhere. See VIRTUAL_README for more information.
(in the context of MIAB every domain is a virtual domain).
In my case a series of these:
Received: from mwgp.xs4all.nl (mwgp.xs4all.nl [80.101.239.92]) by fiber24315337242.heldenvannu.net (Postfix) with ESMTP id 26395200FE for <jeroen@pluimers.com>; Fri, 29 Jun 2018 11:01:02 +0200 (CEST) Received: from fiber24315337242.heldenvannu.net (unknown [37.153.243.246]) by mwgp.xs4all.nl (Postfix) with ESMTP id 077A5E937 for <jeroen@pluimers.com>; Fri, 29 Jun 2018 11:01:02 +0200 (CEST)
Specifying the transport will likely help me solve this problem:
This all came down to editing /etc/postfix/transport
adding lines for each relayed domain like this one:
example.org smtp:[mx-a-record.example.org]
Lines like it direct to use the smtp
transport and use a specific host (normally, the relay
transport is being used).
After this:
# postmap /etc/postfix/transport
# rcpostfix reload
I choose not to configure [WayBack] Postfix Configuration Parameters: relay_recipient_maps
, but might if I had an automated way of replicating lists of valid (and invalid) users.
Another option was confirmed at [WayBack] Software-update: Postfix 3.4.0 / 3.3.3 / 3.2.8 / 3.1.11 / 3.0.15 – Computer – Downloads – Tweakers by [WayBack] menocchio. Thanks!
Dat is volgens mij eenvoudig op te lossen met relay_transport of transport_maps. Zie ook: Postfix transport table format.
Daarmee dwing je de secondary servers de mail altijd af te willen leveren bij de primary server (en dus niet bij een andere secondary). En als de primary niet online is, dan wacht ie netjes tot dat wel het geval is :-)
Bijvoorbeeld:
relay_transport = smtp:[primarymx.domain.tld]
Likely relevant: [WayBack] The Book of Postfix
Maybe relevant in the future:
mydestination
relay_domains
and relayhost
The second part of this document presents additional configurations for hosts in specific environments.
Found on my hunt for the above:
Create a file named
transport
in /etc/postfix and add the following text,gmail.com smtp:smtp.yourisp.com:25
googlemail.com smtp:smtp.yourisp.com:25Remember to swap “smtp.yourisp.com” for the address of your ISP’s smtp relay server.
Now we need to compile this file using the postmap command,
postmap /etc/postfix/transport
Edit /etc/postfix/main.cf and add this line at the bottom,
transport_maps = hash:/etc/postfix/transport
Restart postfix and you should find all mail addressed to @gmail.com or @googlemail.com will be redirected to your smtp relay.
Optional list of relay hosts for SMTP destinations that can’t be found or that are unreachable. With Postfix 2.3 this parameter is renamed to smtp_fallback_relay.
Optional list of relay hosts for SMTP destinations that can’t be found or that are unreachable. With Postfix 2.2 and earlier this parameter is called fallback_relay.
Try not to make typo’s: [WayBack] postfix appears not finding MX records or host names from DNS
Interesting thought, but not sure how smart SPAM bots are now: [Archive.is] Spam relaying through secondary MX… – Google Groups
To archive this:
–jeroen
Posted in Communications Development, Development, DevOps, DNS, Infrastructure, Internet, Internet protocol suite, Power User, SMTP | Leave a Comment »