On Wed, Jun 16, 2021 at 05:23:20PM -0400, Wietse Venema wrote:
> Jeremiah Rothschild:
> > Hello,
> > 
> > I have an alias that is supposed to write to a file but it is not.
> > 
> > * OS: CentOS 8.4.2105 x64 (fully updated)
> > * Kernel: 4.18.0-305.3.1.el8.x86_64
> > * Postfix: 3.5.8-1.el8.x86_64 (default config w/ verbose logging)
> > 
> > Very basic /etc/aliases:
> > [root@c8vm ~]# cat /etc/aliases
> > somealias: /tmp/somefile
> > 
> > I send a test which looks successful:
> > Jun 16 13:21:23 c8vm postfix/local[57869]: 72F0380292:
> > to=<somealias@localhost>, relay=local, delay=0.13, delays=0.09/0.01/0/0.02,
> > dsn=2.0.0, status=sent (delivered to file: /tmp/somefile)
> > 
> > but it was not:
> > [root@c8vm ~]# ls -l /tmp/somefile
> > ls: cannot access '/tmp/somefile': No such file or directory
> > [root@c8vm ~]# ls -ld /tmp
> > 4 drwxrwxrwt. 10 root root 4096 Jun 16 13:38 /tmp/
> 
> According to your logs, Postfix delivers the file as (uid 65534
> gid 65534). HOWEVER, you are looking at /tmp as a different user.

Thanks for the reply!

Yes, postfix delivers as user nobody (id 65534).

> Postfix assumes that /tmp is shared, that is, when Postfix writes
> a file to /tmp, then some other user (you) can access that same
> file by the same name.
> 
> I suspect that your system may have per-user tmpfs.

/tmp is a separate filesystem:
[root@c8vm ~]# grep tmp /etc/fstab
/dev/mapper/rootvg-tmp  /tmp                    ext4    defaults        1 2
[root@c8vm ~]# df -h /tmp
Filesystem              Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-tmp  2.0G  6.1M  1.8G   1% /tmp

and it appears the same as a root and non-root user:
[root@c8vm ~]# id
uid=0(root) gid=0(root) groups=0(root)
[root@c8vm ~]# touch /tmp/testfile
[root@c8vm ~]# su jeremiah
[jeremiah@c8vm /root]$ ls -l /tmp/testfile
-rw-r--r-- 1 root root 0 Jun 16 14:30 /tmp/testfile

Am I misunderstanding your idea?

>       Wietse
> 
> > The full verbose maillog can be viewed @ https://pastebin.com/raw/hAi1gCBA.
> > 
> > The `postconf -n` and `postconf -Mf` outputs can be viewed @
> > https://pastebin.com/raw/MDGB05CB.
> > 
> > Thanks for any help!
> > 
> > j
> > 

Reply via email to