Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

"You have new mail in /var/mail/root" #65

Closed
phdoerfler opened this issue Feb 2, 2018 · 2 comments
Closed

"You have new mail in /var/mail/root" #65

phdoerfler opened this issue Feb 2, 2018 · 2 comments

Comments

@phdoerfler
Copy link
Contributor

phdoerfler commented Feb 2, 2018

TL;DR: What to do with local mail?

Mails sent to root@localhost are delivered to /var/mail/root in maildir format.

How do we want to deal with those? I have seen failed cron jobs put mail there and it is a common mail address for anything system related to my knowledge. In any case: I strongly recommend that we deal with them.

I have triggered one using monit reload and having set root@localhost as mail address in monit's config.

Adding root@localhost to the list of mail aliases of a vmail user (`cfg.loginAccounts."[email protected]".aliases) does work and delivers the mail to that user. Do we want to facilitate this with maybe an extra option or a note in the documentation?

This is the relevant excerpt from journalctl. It shows that the mail is correctly processed by rspamd and rspamd is smart enough to figure out that it is local mail and thus skips a number of checks:

Feb 02 15:31:34 nixos monit[14520]: Reinitializing Monit -- control file '/etc/monitrc'
Feb 02 15:31:34 nixos monit[14520]: 'nixos' Monit reloaded
Feb 02 15:31:34 nixos postfix/smtpd[24067]: connect from localhost[::1]
Feb 02 15:31:34 nixos rmilter[690]: <7a2a9b88db>; accepted connection from mail.example.com; client: ::1:43480 (localhost)
Feb 02 15:31:34 nixos postfix/smtpd[24067]: 723EC160A4D: client=localhost[::1]
Feb 02 15:31:34 nixos rmilter[690]: <7a2a9b88db>; mlfi_data: queue id: <723EC160A4D>
Feb 02 15:31:34 nixos postfix/cleanup[24069]: 723EC160A4D: message-id=<1517585494.983509235@nixos>
Feb 02 15:31:34 nixos rmilter[690]: <7a2a9b88db>; mlfi_eom: tempfile=/tmp/msg.XX86zrtA, size=619
Feb 02 15:31:34 nixos rmilter[690]: <7a2a9b88db>; spamdscan: start scanning message on /run/rspamd/rspamd.sock
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; accept_socket: accepted connection from /run/rspamd/rspamd.sock port 0, task ptr: 00000000019FE510
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; rspamd_message_parse: loaded message; id: <1517585494.983509235@nixos>; queue-id: <723EC160A4D>; size: 619; checksum: <7d63541863656266f4031eb3a8ebab88>
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; spf_symbol_callback: skip SPF checks for local networks and authorized users
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; dkim_symbol_callback: skip DKIM checks for local networks and authorized users
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; surbl_test_url: disable surbl multi.uribl.com as it is reported to be offline
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; surbl_test_url: disable surbl dbl.spamhaus.org as it is reported to be offline
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; surbl_test_url: disable surbl sbl.spamhaus.org as it is reported to be offline
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; surbl_test_url: disable surbl multi.surbl.org as it is reported to be offline
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; surbl_test_url: disable surbl uribl.rambler.ru as it is reported to be offline
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; lua; once_received.lua:71: Skipping once_received for authenticated user or local network
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; surbl_test_url: disable surbl uribl.spameatingmonkey.net as it is reported to be offline
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; surbl_test_url: disable surbl fresh15.spameatingmonkey.net as it is reported to be offline
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; surbl_test_url: disable surbl public.sarbl.org as it is reported to be offline
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; lua; dmarc.lua:99: skip DMARC checks for local networks and authorized users
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; bayes_classify: skip classification as ham class has not enough learns: 0, 200 required
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; rspamd_task_write_log: id: <1517585494.983509235@nixos>, qid: <723EC160A4D>, ip: ::1, from: <monit@nixos>, (default: F (no action): [0.40/15.00] [MID_RHS_NOT_FQDN(0.50){},MIME_GOOD(-0.10){text/plain;},FROM_EQ_ENVFROM(0.00){},FROM_NO_DN(0.00){},MID_RHS_MATCH_FROM(0.00){},RCPT_COUNT_1(0.00){},RCVD_COUNT_2(0.00){},TO_DN_NONE(0.00){},TO_MATCH_ENVRCPT_ALL(0.00){}]), len: 619, time: 6.999ms real, 4.266ms virtual, dns req: 0, digest: <7d63541863656266f4031eb3a8ebab88>, rcpts: <root@localhost>, mime_rcpt: <root@localhost>
Feb 02 15:31:34 nixos rspamd[771]: <912d6c>; task; rspamd_protocol_http_reply: regexp statistics: 69 pcre regexps scanned, 1 regexps matched, 270 regexps total, 25 regexps cached, 3.37k bytes scanned using pcre, 3.37k bytes scanned total
Feb 02 15:31:34 nixos rmilter[690]: <7a2a9b88db>; spamdscan: finish scanning message on /run/rspamd/rspamd.sock
Feb 02 15:31:34 nixos rmilter[690]: <7a2a9b88db>; spamdscan: scan, time: 0.008, server: /run/rspamd/rspamd.sock, metric: default: [0.400 / 15.000], symbols: RCPT_COUNT_1(0.00)[], MIME_GOOD(-0.10)[text/plain], MID_RHS_NOT_FQDN(0.50)[], MID_RHS_MATCH_FROM(0.00)[], FROM_NO_DN(0.00)[], TO_DN_NONE(0.00)[], TO_MATCH_ENVRCPT_ALL(0.00)[], RCVD_COUNT_2(0.00)[], FROM_EQ_ENVFROM(0.00)[]
Feb 02 15:31:34 nixos rmilter[690]: <7a2a9b88db>; msg done: queue_id: <723EC160A4D>; message id: <1517585494.983509235@nixos>; ip: ::1; from: <monit@nixos>; rcpt: <root@localhost> (1 total); user: unauthorized; spam scan: no spam; virus scan: skipped, no av servers; dkim: not signed, ignored
Feb 02 15:31:34 nixos postfix/qmgr[23152]: 723EC160A4D: from=<monit@nixos>, size=681, nrcpt=1 (queue active)
Feb 02 15:31:34 nixos postfix/smtpd[24067]: disconnect from localhost[::1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Feb 02 15:31:34 nixos postfix/local[24070]: 723EC160A4D: to=<root@localhost>, relay=local, delay=0.06, delays=0.05/0/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Feb 02 15:31:34 nixos postfix/qmgr[23152]: 723EC160A4D: removed
@r-raymond
Copy link
Owner

Hi,

couldn't you simply modify the monit address to an existing one? I feel uneasy defaulting mail to root to another email address. Or what exactly is your suggestion? Should we add a config for this?

@phdoerfler
Copy link
Contributor Author

I was merely using monit as an example for local mail (such as mail to root@localhost sent from someone else on the system e.g. a different local user or a daemon).
My question is: How do we deal with local mail? Should we?
Right now we don't and I see both pros and cons for that..

My original reason for starting this discussion is this: If one fails to have an alias for local mail in the nix config then local mail gets delivered but to a different maildir than the one in /var/vmail. If you don't specifically look there you might miss it and neither the recipient nor the sender will never know.

This being said - I am coming to the conclusion that this might be outside of the scope of this mailserver project. I'm therefore closing this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants