Strona 1 z 1

Postfix, poczta nie dochodzi gdy jest kilku odbiorców

: 18 lutego 2010, 12:22
autor: sniver
Powoli zaczynam wymiękać. Najpierw spędziłem trochę czasu aż postfix zacznie mi w ogóle wysyłać i odbierać pocztę. Udało się. Dzięki mojemu uporowi udało mi się nawet dołączyć spamassasina i porobić własne reguły itd. Powiedzmy, że to działa wszystko cacy!

Postarałem się by całość filtrowała e-maile gdy jest spam, albo jakaś niedozwolona treść czy coś kompletnie innego.

No i tu jest prawie wszystko w porządku - do czasu, gdy wysyła się wiadomość, która ma być skierowana do kilku osób. Dla przykładu wiadomość do: użytkownik1@costam.pl; użytkownik2@costam.pl; użytkownik3@costam.pl (nie jestem pewny czy to zrozumiale podałem).

W tym momencie wiadomość nie jest dostarczona. Wisi sobie w kolejce.

Ale wystarczy, że usunę regułę z master.cf i main.cf dotyczącą procmailrc i wszystko działa, ale niestety nie filtruje.

Zanim przytoczę moje wypociny dotyczące konfigów pojawił się też drugi problem. I zapewne chodzi o to samo. Ustawiłem sobie ,,cache-all'' z nieistniejących adresów e-mail na jakiś istniejący. W tym przypadku to działa - do czasu dopóki nie jest procmailrc uruchomiony w konfigach.

Proszę was o pomoc bo już powoli ślepnę szukając odpowiedzi po setkach stron i dokumentów zamieszczonych w sieci.

Plik: main.cf

Kod: Zaznacz cały

#myorigin = mail.jakisserwer.pl
#myhostname = mail.jakisserwer.pl
myorigin = jakisserwer.pl
myhostname = jakisserwer.pl
mydomain = jakisserwer.pl
mydestination =
notify_classes = resource, software, policy
inet_interfaces = all

smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)

#virtual_transport = virtual

biff = no

mailbox_size_limit = 0

smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

sender_bcc_maps = hash:/etc/postfix/bcc
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous

smtpd_recipient_restrictions = permit_mynetworks,
    permit_sasl_authenticated,
    reject_unauth_destination

#    reject_rbl_client bl.spamcop.net,
#    reject_rbl_client dnsbl.sorbs.net,
#    reject_rbl_client combined.njabl.org,
#    reject_rbl_client zen.spamhaus.org,
#    reject_rbl_client cbl.abuseat.org



smtpd_tls_security_level = none


alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
###home_mailbox= /var/mail/user
###home_mailbox = mail/


virtual_mailbox_base = /var/mail
virtual_mailbox_maps = hash:/etc/postfix/virtual

transport_maps = hash:/etc/postfix/transport


virtual_uid_maps = hash:/etc/postfix/uid_maps
virtual_gid_maps = static:1000

virtual_mailbox_limit = 0

virtual_transport = procmail
mailbox_command = /usr/bin/procmail -a -f "$EXTENSION"
Plik master.cf

Kod: Zaznacz cały

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
#===================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
#===================================================
smtp    inet    n       -       -       -       -       smtpd -o smtpd_sasl_auth_enable=yes -o content_filter=spamassassin
submission inet n       -       -       -       -       smtpd
#  -o smtpd_enforce_tls=yes
  -o smtpd_sasl_auth_enable=yes
  -o milter_macro_daemon_name=ORIGINATING
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject

#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ===================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ===================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}
spamassassin     unix  -       n       n       -       -       pipe
   user=nobody argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
procmail       unix    -       n       n       -       -       pipe
    flags=DRO user=nobody  argv=/usr/bin/procmail -t -m -f ${recipient} USER=${user} RECIPIENT=${recipient} /etc/procmailrc
 
Plik: /etc/procmailrc

Kod: Zaznacz cały

# logi
LOGFILE="/var/log/procmail.log"

# katalog glowny wiadomosci email
###MAILDIR=$HOME/mail
MAILDIR="/home/$HOST/homes/$USER/mail"
SMIETNIK=$MAILDIR/Spam

# Wiadomosci odebrane
INBOX="/var/mail/$USER.$HOST"

# Smieci systemowe
INBOX_SYSTEM="/var/mail/root.jakisserwer.pl"


# Wiadomosci systemowe
:0
* ^From [email]root@jakisserwer.pl[/email]
$INBOX_SYSTEM


# Oznaczone jako spam przez spamassassin
:0:
* ^X-Spam-Flag: YES
$SMIETNIK


# kasujemy wszystko, co zostało nadane z adresu @aol.com,
# bo to pewnie spam ;-)
:0
* ^From .*@aol\.com
$SMIETNIK

# kasujemy wszystko, co zostało wysłane przez serwer mafiagames.ru,
# bo to anonimowy remailer -- więc to pewnie spam
:0
* ^Received:.*mafiagames\.ru
$SMIETNIK

# kasujemy wszystko, co ma w treści listu "remove" *ORAZ* "opt-in",
# bo to na pewno spam ;-)
:0B
* remove
* opt-in
$SMIETNIK

# kasujemy wszystko, co zostało nadane z Rosji *LUB* Chin, bo my
# tam nie mamy znajomych -- więc to pewnie spam ;-)
# \> na końcu po to, żeby nie złapał się adres [email]lubie@ogniste.rude[/email]
:0
* ^From .*@.*\.(ru|cn)\>
$SMIETNIK


# kasujemy wszystko, co zostało nadane z adresu @hotmail.com
# za wyjątkiem [email]john.example@hotmail.com[/email] oraz [email]mary.sample@hotmail.com[/email]
:0
* ^From .*@hotmail\.com
* ! ^From john\.example@hotmail\.com
* ! ^From mary\.sample@hotmail\.com
$SMIETNIK


# kasujemy wszystko, czego nie możemy odczytać
# czyli te krzaki azjatyckie, ruskie i inne
:0:
* 0^0
* 1^0 ^Subject:.*=\?(.*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987|windows-1251|windows-1256)\?
* 1^0 ^Content-Type:.*charset="(.*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987|windows-1251|windows-1256)"
$SMIETNIK


# Wywalanie spamu z niechcianymi rzeczami - sex, viagra itp.
# :0:
# * -400^0
# * 100^0 !^From:
# * 200^0 !^To:
# * 100^0 !^Subject:
# * 200^0 Received.*(advertise|stealth|bulk|sex)
# * 50^2 ^(From|To).*(sex|adult|porn)
# * 200^0 Message-ID.*(advert|bulk|lov(e|ing)|spam)
# * 190^0 ^Subject.*(\ sex|adult|porn|gay|erotic|advert|\ xxx\ |bulk.+email|\
#         revenue|expense|profit|money|earn|cash|free|lingerie)
# * 10^0 ^Subject.*\$
# * 100^0 ^Subject.*\$\$
# * 500^0 ^Subject.*\$\$\$
# * 100^0 ^Subject.*\!\!
# * 300^0 ^Subject_*\!\!\!
# * 50^2 ^PP-Warning:
# * 20^2 \ sex|^sex|adult|erotic|gay|porn|chain.+letter|sponsor|\
#        \ xxx\ |^xxx\ |bulk|girls|\
#        hardcore|advertise|remove|revenue|expense|profit|money|\
#        marketing|targeted\ search| collect.+email|\
#        \ pay|lingerie|org(y|ies)|teens|sign\ up\ now
# * 10^2 subject.+remove
# * 10^2 remove.+(subject|request|list)
# * 10^2 reply.*remove
# * 10^2 one\ time.*(mail|message)
# * 5^2 video|pictures|earn
# $SMIETNIK


## NIEDOZWOLONE CZESCI TYTULU WIADOMOSCI
:0
* ^Subject:.*ADV:
$SMIETNIK

:0
* ^Subject:.*penis
$SMIETNIK

:0
* ^Subject: .*(Gen\*ric|V\*agra|Viagra|\$.*per .*dose)
$SMIETNIK

:0
* ^Subject: .*Cash for [a-z]*@
$SMIETNIK

:0
* ^Subject: .*(St0ck|0pportunity)
$SMIETNIK



## NIEDOZWOLONE CZESCI NAZWY NADAWCY
:0
* ^From:.*ADV:
$SMIETNIK

:0
* ^From:.*penis
$SMIETNIK

:0
* ^From: .*(Gen\*ric|V\*agra|Viagra|\$.*per .*dose)
$SMIETNIK

:0
* ^From: .*Cash for [a-z]*@
$SMIETNIK

:0
* ^From: .*(St0ck|0pportunity)
$SMIETNIK


:0
$INBOX
Bardzo was proszę o pomoc w tej gardłowej sprawie.
Z góry dziękuję.

: 20 lutego 2010, 14:07
autor: mendeczka
Czy możesz podać logi?
Czy możesz powiedzieć jakim tutorialem się kierowałeś?
Dlaczego nie masz wpisanego

Kod: Zaznacz cały

mydestination = 
?