Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Problems with "mailto" (fcrontab)
Date: Sun, 24 May 2015 10:04:17
Message-Id: 201505241104.04938.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] Problems with "mailto" (fcrontab) by Meino.Cramer@gmx.de
1 On Sunday 24 May 2015 05:46:37 Meino.Cramer@×××.de wrote:
2 > Walter Dnes <waltdnes@××××××××.org> [15-05-24 05:52]:
3 > > On Sun, May 24, 2015 at 03:34:09AM +0200, Meino.Cramer@×××.de wrote
4 > >
5 > > > What reasons disable fcron to send mail to me or root?
6 > > >
7 > > By convention, it seems that all MTAs have symlinks at
8 > >
9 > > /usr/bin/sendmail /usr/lib/sendmail and /usr/sbin/sendmail. Programs
10 > > that automatically send email, expect to find "sendmail" symlinks. Do
11 > > you have those symlinks from msmtp?
12 > >
13 > > My most embarressing linux moment was when ssmtp sent output from
14 > > verbose cron jobs to root (at me). My ssmtp was configured to simply
15 > > re-route everything to my ISP's MTA. The net result was that the output
16 > > went to root@my_ISP "They were not amused".
17
18 Well, you are meant to define root's alias address as your own
19 my_email@×××××.com equivalent, if you have set up your local mail program to
20 relay messages via your ISP's mail servers.
21
22
23 > > That was when I learned
24 > > about setting the destination for all userids < 10 to myself. I also
25 > > ran a script designed to break the symlinks and prevent portage from
26 > > making sendmail symlinks...
27 > >
28 > > rm -r /usr/bin/sendmail
29 > > rm -r /usr/lib/sendmail
30 > > rm -r /usr/sbin/sendmail
31 > > mkdir /usr/bin/sendmail
32 > > touch /usr/bin/sendmail/.keep
33 > > mkdir /usr/lib/sendmail
34 > > touch /usr/lib/sendmail/.keep
35 > > mkdir /usr/sbin/sendmail
36 > > touch /usr/sbin/sendmail/.keep
37
38 Unorthodox perhaps, but whatever works for you ... :-)
39
40
41 > > That worked great for a few years. Portage output an error message
42 > >
43 > > about being unable to symlink, but continued. Then portage changed the
44 > > failure mode to shut down portage when it was unable to create
45 > > symlinks... AAARRRGGGHHH. Now when that happens, I remove the
46 > > "sendmail" directories, run emerge to build ssmtp, and then run the
47 > > script to break the symlinks. I know that it's redundant, after setting
48 > > destination for uid < 10, but "once burned, twice shy".
49 >
50 > Hi Walter,
51 >
52 > This is, what I have found:
53 >
54 > lrwxrwxrwx 1 root root 14 Feb 11 19:25 /usr/bin/sendmail -> /usr/bin/msmtp
55 >
56 > My email address (see above) is different from my userid on my Linux
57 > box and (personally) I dont have configured anything which alias
58 > my userid to my email address or vice versa.
59
60 Have you configured your msmtp to be able to send messages? Which SMTP server
61 are you pointing it at?
62
63
64 > I will now try to let fcron to mail to me (my userid so to speak)
65 > instead of root since the fcrontab is alos mine.
66 >
67 > When I do something like this
68 >
69 > cat <file> | mail <my userid>
70 >
71 > or
72 >
73 > cat <file> | mail <my userid>@localhost
74 >
75 > I get
76 >
77 > send-mail: recipient address <my userid> not accepted by the server
78 > send-mail: server message: 501 Syntax error in parameters or arguments
79 > send-mail: could not send mail (account default from /home/<my
80 > userid>/.msmtprc) Can't send mail: sendmail process failed with error code
81 > 65
82 >
83 > send-mail: recipient address <my userid>@localhost not accepted by the
84 > server send-mail: server message: 550-Requested action not taken: mailbox
85 > unavailable send-mail: server message: 550 invalid DNS MX or A/AAAA
86 > resource record send-mail: could not send mail (account default from
87 > /home/<my userid>/.msmtprc) Can't send mail: sendmail process failed with
88 > error code 65
89 >
90 >
91 > Question for me is: Is "server" my ISP's server? Or a default error
92 > message" or something which is exspected to be installed at my Linux
93 > box?
94
95 It depends how you have configured msmtp. You are meant to point it to an
96 SMTP server which in turn is configured to accept messages from the user you
97 have defined in your msmtp configuration. So, if you are sending messages
98 from cron@localhost without having configured an alias for cron: pointing to a
99 real email account at your ISP, they will reject it because root@localhost is
100 not configured on their mailserver.
101
102 If you want to only send messages locally, then set up mailx or equivalent
103 application and create necessary local boxen to receive messages in.
104
105 --
106 Regards,
107 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature