Hallo,
Habe bisher die sortierung der eMails für unsere Firma über Procmail erledigt. Dies ist aber ein mega gewurschtel da jeder user seine eigene filter datei hat.
Angenommen wir haben 3 user hier.
Procmail verweist auf procmail rc
procmailrc -> Haupt.procmailrc -> user1.procmailrc
user2.procmailrc
user3.procmailrc -> match -> cyrus
Das ist deswegen notwendig da die filter per script eingefügt werden. und wieder gelöscht werden.
Nun habe ich versuche eine anbindung an LDAP hinzubekommen, was mir beim INTERNEN mailverkher auch gelingt, nur beim externen nicht.
procmailrc
postconf -n
master.cf
Wie gesagt, lokal bekommt die Procmailrc den richtigen user vom postfix.
aber wenn eine eMail von extern kommt ...
.. kommt als empfänger postmaster@gagaga, was mein script nicht finden kann.
Hat jemand eine ahnung wie ich das in den Griff bekommen kann???
Und bitte sagt mir jetzt nicht "Benutz sieve" wenn das schon jemand sagt, dann soll man mir auch genau sagen wie. Ich weiss wie ich scripte schreibe und wie ich sie aktiviere, aber wie bekomm ich die mails von Postfix mach sieve?
Ausserdem währe es mir so lieber.
Ach ja, die emails kommen von einem catch all account bei einem Provider. Also ist nix mit fetchmailrc -> user there is userb here, darüber hab ich auch schon nachgedacht.
danke schon mal für eure hilfe,
mfg XeN
Habe bisher die sortierung der eMails für unsere Firma über Procmail erledigt. Dies ist aber ein mega gewurschtel da jeder user seine eigene filter datei hat.
Angenommen wir haben 3 user hier.
Procmail verweist auf procmail rc
procmailrc -> Haupt.procmailrc -> user1.procmailrc
user2.procmailrc
user3.procmailrc -> match -> cyrus
Das ist deswegen notwendig da die filter per script eingefügt werden. und wieder gelöscht werden.
Nun habe ich versuche eine anbindung an LDAP hinzubekommen, was mir beim INTERNEN mailverkher auch gelingt, nur beim externen nicht.
procmailrc
Code:
USER=$2
ABSENDER=$1
# --- LDAP Anfrage fuer benutzernamen stellen --
EMPFAENGER=`ldapsearch -b ou=Users,ou=OxObjects,dc=panno,dc=com -x "(|(mail=$USER)(alias=$USER))" uid | grep "uid: " | cut -f2 -d" "`
# ---
# --- an User zustellen ---
{
:0 c
| /sbin/cyrdeliver -a -m $EMPFAENGER
}
# ---
# --- Wenn fehler dann zurueck in Queue ---
:0 e
{ EXITCODE=75 HOST }
# ---
postconf -n
Code:
alias_maps = ldap:aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
defer_transports =
fallback_transport = procmail
html_directory = /usr/share/doc/packages/postfix/html
inet_interfaces = all
local_recipient_maps = ldap:local $alias_maps
mailbox_command = /usr/lib/cyrus/bin/deliver
mailbox_transport = procmail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_domains = panno.com
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = panno.com
myhostname = mail.panno.com
mynetworks = 192.168.194.0/27, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relay_domains =
relayhost = smtp.udag.de
sample_directory = /usr/share/doc/packages/postfix/samples
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtpd_helo_required = yes
unknown_local_recipient_reject_code = 550
master.cf
Code:
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
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=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
vscan unix - n n - 10 pipe
user=vscan argv=/usr/sbin/amavis ${sender} ${recipient}
procmail unix - n n - - pipe
flags=R user=cyrus argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}
#procmail unix - n n - - pipe
# flags=R user=cyrus argv=/usr/bin/procmail -t -m /etc/procmailrc
Wie gesagt, lokal bekommt die Procmailrc den richtigen user vom postfix.
Code:
procmail: Assigning "ABSENDER=test@panno.com"
procmail: Assigning "USER=user@panno.com"
procmail: Assigning "NEXTHOP=mail.panno.com"
procmail: Assigning "EXTENSION="
procmail: Executing "ldapsearch -b ou=Users,ou=OxObjects,dc=panno,dc=com -x "(|(mail=$USER) (alias=$USER))" uid | grep "uid: " | cut -f2 -d" ""
procmail: Assigning "EMPFAENGER=user"
procmail: Skipped "{"
procmail: Assigning "LASTFOLDER=/sbin/cyrdeliver -a -m user"
procmail: Closing brace unexpected
procmail: Assigning "LASTFOLDER=/dev/null"
procmail: Opening "/dev/null"
Subject: Test
Folder: /dev/null 831
procmail: Executing "/sbin/cyrdeliver,-a,-m,user"
aber wenn eine eMail von extern kommt ...
Code:
procmail: Assigning "ABSENDER=ABSENDER"
procmail: Assigning <b>"USER=postmaster@localhost.panno.com"</b>
procmail: Assigning "NEXTHOP=mail.panno.com"
procmail: Assigning "EXTENSION="
procmail: Executing "ldapsearch -b ou=Users,ou=OxObjects,dc=panno,dc=com -x "(|(mail=$USER) (alias=$USER))" uid | grep "uid: " | cut -f2 -d" ""
procmail: Assigning "EMPFAENGER="
procmail: Skipped "{"
procmail: Assigning "LASTFOLDER=/sbin/cyrdeliver -a -m"
procmail: Closing brace unexpected
procmail: Assigning "LASTFOLDER=/dev/null"
procmail: Opening "/dev/null"
Subject: (kein Betreff)
Folder: /dev/null 1821
procmail: Executing "/sbin/cyrdeliver,-a,-m"
421-4.3.0 usage: deliver [-C <alt_config> ] [-m mailbox] [-a auth] [-r return_path] [-l] [-D]
421 4.3.0 v2.2.3
.. kommt als empfänger postmaster@gagaga, was mein script nicht finden kann.
Hat jemand eine ahnung wie ich das in den Griff bekommen kann???
Und bitte sagt mir jetzt nicht "Benutz sieve" wenn das schon jemand sagt, dann soll man mir auch genau sagen wie. Ich weiss wie ich scripte schreibe und wie ich sie aktiviere, aber wie bekomm ich die mails von Postfix mach sieve?
Ausserdem währe es mir so lieber.
Ach ja, die emails kommen von einem catch all account bei einem Provider. Also ist nix mit fetchmailrc -> user there is userb here, darüber hab ich auch schon nachgedacht.
danke schon mal für eure hilfe,
mfg XeN