avatar

Çaylak My BASH Blogs

news, diary, journal, whatever
Post Archive | Contact | Defter

Raspberry Pi postfix mail gateway

January 22, 2023 - 00:40:40 — CaylakPenguen

Bu hafta final sınavlarım vardı.

Biraz kafa dağıtmak istedim.

ISP 25 porumu içeriye doğru kapatmıyor. Yani 25 portundan mail alabiliyorum :)

Mail-in-a-Box posta sunucusunu yerel virtualbox üzerinde test ediyorum.

Bu arada Mail-in-a-Box ip adresi doğal olarak yerel ap ip adresini işaret ediyor.

192.168.0.14

Tabi bu durumda dışarıdan mail alabilmesi modem üzerinden DMZ olarak tanımlamam gerekiyordu.

DMZ de tanımlı ve çalışan Raspberry Pi 'm var.

Neden Raspberry Pi üzerindeki postfix gateway olmasındı.

Hadi eller klavyeye.

cd /etc/postfix

main.cf dosyasına aşağıdaki satırları ekleyin.

relay_domains = hash:/etc/postfix/relaydomains
transport_maps = hash:/etc/postfix/transport
/etc/postfix/relaydomains: dosya içeriği
#relay olarak kabul ettiğimiz domain adı.
ikra.caylak.tk  OK 
/etc/postfix/transport:
#gelen e-postayı nereye ileteceğimizi belirtiyoruz.
ikra.caylak.tk  smtp:192.168.0.14:25

bu iki dosyayı maplayalım.

postmap transport
postmap relaydomains

ve son olarak postfix reload edilir.

postfix reload

test için dışarıdan e-posta gönderdim.

e-posta headerinde bu ibareler gelen e-postanın Raspberry Pi üzerinden iletildiğini gösteriyor.

pi-mail-gateway.png

UYARI: Herhangi bir olası hasar veya Problem oluşması durumunda sorumluluk size aittir.

Tags: postfix, mailgateway, RaspberryPi

Comments? Tweet  

E-postamı yirmi üç yıl boyunca kendi kendime barındırdıktan sonra havluyu attım. Oligopol kazandı.

January 07, 2023 - 14:46:58 — CaylakPenguen

Yazar: Carlos Fenollosa

Birçok şirket, e-postayı tescilli hale getirerek bozmaya çalışıyor. Şimdiye kadar başarısız oldular. E-posta açık bir protokol olmaya devam ediyor. Yaşasın mı?

Yaşasın. E-posta artık dağıtılmıyor . Bu ağın başka bir birinci sınıf düğümünü oluşturamazsınız.

E-posta artık bir oligopol, net tarafsızlık ilkelerini takip etmeyen birkaç büyük şirket tarafından tutulan bir hizmet geçidi.

1999'da evde ilk geniş bant bağlantımı kurduğumdan beri e-postamı kendim barındırıyorum. Evde kişisel bir web+e-posta sunucusuna sahip olmayı kesinlikle seviyordum, statik bir IP ve insanların dışarıdan bağlanabilmesi için gerçek bir yönlendirici için fazladan ödeme yaptım. . Kendimi internetin birinci sınıf vatandaşı gibi hissettim ve çok şey öğrendim.

Zamanla, konut IP bloklarının çoğu sunucuda yasaklandığını fark ettim. E-posta sunucumu bir VPS'ye taşıdım. Şanssız. Kendi kendini barındıran e-postanın kaybedilmiş bir sebep olduğunu hemen anladım . Yine de, saf kin, inat ve aktivizm yüzünden savaşıyorum. Başka bir deyişle, yapılacak doğru şey olduğu için.

Ancak e-postalarım artık teslim edilmiyor. Bir e-posta sunucum da olmayabilir.

Yazının devamını okuyun ->

Tags: gmail, postfix, mail

Comments? Tweet  

Postfix's virtual alias maps

November 20, 2022 - 18:30:27 — CaylakPenguen

Postfix allows you to store virtual alias maps in a text file, which tells postfix how to route virtual email addresses to real users on the system. This setting and the file location is determined in the postfix configuration file /etc/postfix/main.cf like so:

virtual_alias_maps = hash:/etc/postfix/virtual

The format of the file is with the alias on one side, and the destination on the other, for example like so:

john_smith@example.com john
john-smith@example.com john
fred@example.com john

This routes all email addressed to john_smith@example.com, john-smith@example.com and fred@example.com to the real user (or system alias) john. It's possible to have a catch-all alias :x which will route anything addressed to @example.com to a particular user like so:

@example.com john

If you wanted everything to go to "john" except for mail to fred@ then you can do it like this:

@example.com john
fred@example.com fred

Just editing the /etc/postfix/virtual file is not enough to make the changes take affect. You must run the postmap command to make postfix read the file, like so:

/usr/sbin/postmap /etc/postfix/virtual

This creates a new file called /etc/postfix/virtual.db and the aliases are now loaded into postfix.

Tags: postfix

Comments? Tweet  

Postfix sender based routing.

November 20, 2022 - 18:28:03 — CaylakPenguen

If you want to use a more fine-grained model you can choose to relay the outbound traffic for domains over separate users. This allows you to apply different settings per domain, but also provides the enduser access to their own logfiles.

Create sasl_passwd file for the individual outgoing user(s):

/etc/postfix/sasl_passwd
@example.com outgoing@example.com:THEPASSWORD

Create the sender_relay file

@example.com [SMARTHOST1]:587
@example.net [SMARTHOST2]:587

Postmap both files:

postmap /etc/postfix/sasl_passwd
postmap /etc/postfix/sender_relay

Add the following part has to be added to your main.cf:

relayhost = [SMARTHOST]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay

Please note the above extract also configures serverwide, to also filter those that are not added on the sender_relay file.

If you do not want this and only want to filter specific domains remove the relayhost line from above

Restart postfix.

Tags: postfix

Comments? Tweet