Portál AbcLinuxu, 14. května 2024 22:17


Dotaz: postfix: maildir access problem for UID/GID=100/100

24.10.2017 02:22 Blackpuffle
postfix: maildir access problem for UID/GID=100/100
Přečteno: 1963×
Odpovědět | Admin
Zdravím :)

Podařilo se mi podle návodu (http://www.abclinuxu.cz/serialy/stavime-postovni-server) zde na abclinuxu zprovoznit mail server, ale ne 100%. Opravil jsem snad již dost problémů a už je snad poslední překážka, se kterou bych opravdu potřeboval poradit. A to zapsání emailů do maildir.

postfix status: root@Timeproductio:/etc/postfix# postfix status /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: first_valid_uid=100 /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_sasl_auth_clients=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: last_valid_gid=100 /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: mail_location=maildir:/va /mail/virtual/%d/%n /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: first_valid_gid=100 /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: last_valid_uid=100 postfix/postfix-script: the Postfix mail system is running: PID: 13609

service postfix status: ● postfix.service - LSB: Postfix Mail Transport Agent Loaded: loaded (/etc/init.d/postfix) Drop-In: /run/systemd/generator/postfix.service.d └─50-postfix-$mail-transport-agent.conf Active: active (running) since Tue 2017-10-24 02:09:36 CEST; 3min 3s ago Process: 13480 ExecStop=/etc/init.d/postfix stop (code=exited, status=0/SUCCESS) Process: 13502 ExecStart=/etc/init.d/postfix start (code=exited, status=0/SUCCESS) CGroup: /system.slice/postfix.service ├─13609 /usr/lib/postfix/master ├─13610 pickup -l -t unix -u -c └─13611 qmgr -l -t unix -u

Oct 24 02:09:36 Timeproductio systemd[1]: Started LSB: Postfix Mail Transport Agent. Oct 24 02:09:36 Timeproductio postfix/master[13609]: daemon started -- version 2.11.3, configuration /etc/postfix Oct 24 02:09:36 Timeproductio postfix/qmgr[13611]: D3B44609C4: from=14032013@seznam.cz, size=2204, nrcpt=1 (queue active) Oct 24 02:09:36 Timeproductio postfix/qmgr[13611]: EB606609BC: from=14032013@seznam.cz, size=1754, nrcpt=1 (queue active) Oct 24 02:09:36 Timeproductio postfix/virtual[13614]: warning: maildir access problem for UID/GID=100/100: create maildir file /var/mail/virtual/timeproduction.cz/it/tmp/1508803776.P13614.Timeproductio: Permission denied Oct 24 02:09:36 Timeproductio postfix/virtual[13614]: warning: perhaps you need to create the maildirs in advance Oct 24 02:09:36 Timeproductio postfix/virtual[13614]: D3B44609C4: to=it@timeproduction.cz, relay=virtual, delay=1933, delays=1933/0.02/0/0.01, dsn=4.2.0, status=deferred (maildir delivery failed: create maildir file /var/mail/virtual/timeproduction.cz/it/tmp/1508803776.P13614.Timeproductio: Permission denied) Oct 24 02:09:36 Timeproductio postfix/virtual[13615]: warning: maildir access problem for UID/GID=100/100: create maildir file /var/mail/virtual/timeproduction.cz/it/tmp/1508803776.P13615.Timeproductio: Permission denied Oct 24 02:09:36 Timeproductio postfix/virtual[13615]: warning: perhaps you need to create the maildirs in advance Oct 24 02:09:36 Timeproductio postfix/virtual[13615]: EB606609BC: to=it@timeproduction.cz, relay=virtual, delay=2485, delays=2485/0.02/0/0, dsn=4.2.0, status=deferred (maildir delivery failed: create maildir file /var/mail/virtual/timeproduction.cz/it/tmp/1508803776.P13615.Timeproductio: Permission denied)

a nastavení postfixu (main.cf): myhostname = postak.timeproduction.cz myorigin = $mydomain

alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases

home_mailbox = Maildir/

inet_interfaces = all

biff = no delay_warning_time = 4h

local_transport = error:no local mailboxes

mynetworks = 127.0.0.0/8, [::1]/128

# spam, white list, black list smtpd_client_restrictions = permit_mynetworks, # check_sender_access hash:/etc/postfix/access, permit

smtpd_sender_restrictions = permit mynetworks, reject_non_fqdc_sender, reject_unknown_sender_domain, # check_sender_access hash:/etc/postfix/access, permit

smtpd_recipient_restrictions = permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, # check_recipient_access hash:/etc/postfix/access, permit_sasl_authenticated reject_unauth_destination, permit

smtpd_error_sleep_time = 30 smtpd_soft_error_limit = 10 smtpd_hard_error_limit = 20

smtpd_helo_required = yes disable_vrfy_command = yes

# virtuální uživatelé virtual_mailbox_domains = mysql:/etc/postfix/mysql/vdomains.cf virtual_mailbox_base = /var/mail/virtual virtual_mailbox_maps = mysql:/etc/postfix/mysql/vmailbox.cf virtual_alias_maps = mysql:/etc/postfix/mysql/virtual.cf virtual_minimum_uid = 100 virtual_uid_maps = static:100 virtual_gid_maps = static:100

mail_location = maildir:/var/mail/virtual/%d/%n first_valid_uid = 100 last_valid_uid = 100 first_valid_gid = 100 last_valid_gid = 100

# SASL smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes

Zkoušel jsem nastavovat chmod na 750, ale tak nějak to nepomohlo.. :) Pokud potřebujete ještě nejaké info, dejte vědět. Děkuji všem za solidní radu :) Přeji hezký večer :)

btw: kvůli fóru jsem musel u "from" a "to" odstranit < a > - značky nejsou povoleny
Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

24.10.2017 04:35 d.c. | skóre: 30
Rozbalit Rozbalit vše Re: postfix: maildir access problem for UID/GID=100/100
Odpovědět | | Sbalit | Link | Blokovat | Admin
Vime toho hodne, ale nevime, jaka jsou prava na ty adresare. Co primitivni postfix set-permissions?
24.10.2017 13:01 Blackpuffle
Rozbalit Rozbalit vše Re: postfix: maildir access problem for UID/GID=100/100
postfix set-permission se ale pouští v případě, kdy byl změněn atribut v main.cf mail_owner na něco jiného, než "postfix", který tam je defaultně. Nebo se pletu? :) I tak jsem příkaz spustil a vypsal akorát:

root@Timeproductio:/var/mail/virtual/timeproduction.cz# postfix set-permissions /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: first_valid_gid=100 /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: last_valid_uid=100 /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: first_valid_uid=100 /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_sasl_auth_clients=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: last_valid_gid=100 /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: mail_location=maildir:/var/mail/virtual/%d/%n chown: cannot access '/usr/lib/postfix/dict_cdb.so': No such file or directory

Každopádně ownera mám postfix:postfix s home-direm v /var/mail/virtual

a práva na adresář /var/mail: drwxr-s--- 3 postfix postfix 4096 Oct 22 16:29. na adresář /var/mail/virtual: drwxr-s--- 3 postfix postfix 4096 Oct 22 16:30 . a na adresář /var/mail/virtual/timeproduction.cz: drwxr-s--- 3 postfix postfix 4096 Oct 22 16:30 .

a jednoduše všechno pod /var/mail/ má ownera postfix postfix a práva drwxr-s---
24.10.2017 10:07 romank | skóre: 10 | blog: romank
Rozbalit Rozbalit vše Re: postfix: maildir access problem for UID/GID=100/100
Odpovědět | | Sbalit | Link | Blokovat | Admin
Ahoj,

Ak mas nastavene prepojenie a manazovanie uzvivatelov cez SQL DB,skus mozno ta to nakopne.


Ak lokalne tak tu by som zacal
The default per-user mailbox is a file in the UNIX mail spool directory (/var/mail/user or /var/spool/mail/user); the location can be specified with the mail_spool_directory configuration parameter. Specify a name ending in / for qmail-compatible maildir delivery. Alternatively, the per-user mailbox can be a file in the user's home directory with a name specified via the home_mailbox configuration parameter. Specify a relative path name. Specify a name ending in / for qmail-compatible maildir delivery. Mailbox delivery can be delegated to an external command specified with the mailbox_command_maps and mailbox_command configuration parameters. The command executes with the privileges of the recipient user (excep- tions: secondary groups are not enabled; in case of delivery as root, the command executes with the privileges of default_privs). Mailbox delivery can be delegated to alternative message transports specified in the master.cf file. The mailbox_transport_maps and mail- box_transport configuration parameters specify an optional message transport that is to be used for all local recipients, regardless of whether they are found in the UNIX passwd database. The fall- back_transport_maps and fallback_transport parameters specify an optional message transport for recipients that are not found in the aliases(5) or UNIX passwd database.


Roman
24.10.2017 13:03 Blackpuffle
Rozbalit Rozbalit vše Re: postfix: maildir access problem for UID/GID=100/100
Ahoj :)

navazování uživatelů mám přes SQL a vše už funguje.. Měl jsem hromadu chyb, že místo "hosts" jsem používal "host".. ale to vše už funguje.. Umí to uživatele správně i identifikovat, najít jeho složku, kam se má email doručit. Chyba je spíš ale v tom, že do tý složky nemůže zapisovat (jestli chápu dobře log). Už se s tím nějakou chvíli peru a stále mě nenapadá, co by mohlo být špatně, když uživatel postfix:postfix má domovský adresář v /var/mail/virtual a owner na tuto složku i všechny podsložky jsou na postfixe (práva na všechny jsou drwxr-s---)

Nenapadá tě ještě něco? :)
26.10.2017 14:27 MP
Rozbalit Rozbalit vše Re: postfix: maildir access problem for UID/GID=100/100
Protoze ty nesiko, co to neumi nastavit ani podle navodu, do adresare zapisuje delivery agent a ne primo postfix, to za prve, a za druhe, pokud pouzivas sql, tak pouzivas virtualni uzivatele, takze pro uid/gid se pouziva virtual_* v pripade main.cf.

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.