LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 07-03-2010, 06:09 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Rep: Reputation: 49
TO ANYONE USING MAILX (mailx 12.1).


Hi:
How do I create an account with mailx? I do
$ mailx -v
? account foo1 {
[here I type the data]
}
? account foo1
? account
[mailx prints here the data I entered above]
? quit
$ mailx -v
? account
?

That is, the last command, 'account', did not get any output. OK. Then I have no account! But what did I do wrong? That's all. Thanks for reading.

Last edited by stf92; 07-03-2010 at 07:21 PM.
 
Old 07-03-2010, 06:37 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
When kmail (KDE3) asks for an "Account name" I just give the name of the ISP I am setting up a connection to. It's not relevant to your username or login, it's just a "Name" for the (?) file that holds the details for that particular connection.

I have more than one ISP, and I find this functionality useful: I can reconfigure different accounts for different ISPs, each with their own login details. I can then use them individually, or together.

HTH
 
1 members found this post helpful.
Old 07-03-2010, 06:41 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
Thanks. Then I'll try putting in an arbitrary name and see what happens. Regards.
 
Old 07-04-2010, 06:40 PM   #4
RandomTroll
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 304

Rep: Reputation: 32
mailx has no accounts: systems have accounts. If a system has an account named manuel, when manuel logs in mailx fetches the mail from /var/spool/mail/manuel; when manuel sends a message mailx identifies the sender as manuel. If you want to add a user you use the script useradd (as root) to add a user to the system. (useradd is Slackware's script; some distributions use 'adduser' - or even something else.)
 
Old 07-05-2010, 12:04 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
Thanks for your reply, RandomTroll. When I log in as root, the system says I have mail. I can read it with mailx or directly print the files in /var/spool/mail/. These files have been placed here by the slackware installer. Do I have, then, an account named root? If I log in as semoi the system says 'No mail'. But then semoi also has an account, has he? Regards.

Edit: I now think I understand. In useradd's man, the word 'account' is explicitly used. And so, yes: I have two accounts; namely root and semoi. Now, I don't understand why 'mailx -s "Test" juan@hotmail.com' followed by ^D does not send the message. Because it doesn't. Anyway, the main thing here is that I have grasped the concept of account.

By the way, I am reading The Linux Networks Administrators' Guide, chapter Electronic Mail and trying to understand something about this intrincate matter. Edit END

Last edited by stf92; 07-05-2010 at 12:27 PM.
 
Old 07-06-2010, 12:22 AM   #6
RandomTroll
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 304

Rep: Reputation: 32
Quote:
Originally Posted by stf92 View Post
When I log in as root, the system says I have mail. I can read it with mailx or directly print the files in /var/spool/mail/. These files have been placed here by the slackware installer. Do I have, then, an account named root?
Yes. Every *nix system has an account named root. It's the root account, the account of the superuser or system administrator. It's created automatically.


Quote:
Originally Posted by stf92 View Post
If I log in as semoi the system says 'No mail'. But then semoi also has an account, has he?
Yes, but no mail. /var/spool/mail/semoi either doesn't exist or has size 0. The Slackware installation program sends 2 messages to root, why root has mail.

Quote:
Originally Posted by stf92 View Post
I don't understand why 'mailx -s "Test" juan@hotmail.com' followed by ^D does not send the message.
How do you know it doesn't? Do you own juan@hotmail.com? Try the same thing using semoi (no domain). I just tried it, and it worked for me.

Do you run sendmail as a daemon? If you don't, you won't send any mail.

ps ax | grep sendmail

will return a 'sendmail: accepting connections' line if you are. If you aren't, and you want to, run /etc/rc.d/rc.sendmail start. You may not want to run sendmail as a daemon: it receives mail, too, a possible security hole.
 
1 members found this post helpful.
Old 07-06-2010, 12:35 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
Linux kernel 2.6, Slackware 12.0.
Code:
root@darkstar:/etc/rc.d# sendmail -d0.1
Version 8.14.1
 Compiled with: DNSMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7
                NAMED_BIND NETINET NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF
                SOCKETMAP STARTTLS TCPWRAPPERS USERDB XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = darkstar
  (canonical domain name) $j = darkstar.mach6p
         (subdomain name) $m = mach6p
              (node name) $k = darkstar
========================================================

Recipient names must be specified
Hi:
Thank you for your explanatory notes about the account concept in *nix. I ran ps and saw sendmail wasn't running. I did what you said: I ran /etc/rc.d/rc.sendmail start and then ps ax|grep sendmail said 'Sendmail: accepting connections'. So I did mailx -s "Test" semoi from a root console and, to my surprise, /var/spool/mail/semoi contained the message and semoi was notified.
In sendmail's manual there is no mention of rc.sendmail; not even under the FILES section!

Unfortunately, mailx -s "Test2" exxxxxxxxxxxi@yahoo.com.ar did not reach my Yahoo mail box. Neither does mailx -s "Test3" exxxxxxxxxxx4@fibertel.com.ar (this is my email address in Kmail). And Kmail always receives my correspondence. Just in case I'm not bothering too much, I am here transcripting rc.sendmail and /var/log/maillog along with rc.sendmail's output:
Code:
root@darkstar:/etc/rc.d# source ./rc.sendmail start
Starting sendmail MTA daemon:  /usr/sbin/sendmail -L sm-mta -bd -q25m
Starting sendmail MSP queue runner:  /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m
root@darkstar:/etc/rc.d#
Code:
root@darkstar:~# cat /etc/rc.d/rc.sendmail
#!/bin/sh
# Start/stop/restart sendmail.

# Start sendmail:
sendmail_start() {
  if [ -x /usr/sbin/sendmail ]; then
    echo "Starting sendmail MTA daemon:  /usr/sbin/sendmail -L sm-mta -bd -q25m"
    /usr/sbin/sendmail -L sm-mta -bd -q25m
    echo "Starting sendmail MSP queue runner:  /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m"
    /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m
  fi
}

# Stop sendmail:
sendmail_stop() {
  killall sendmail
}

# Restart sendmail:
sendmail_restart() {
  sendmail_stop
  sleep 1
  sendmail_start
}

case "$1" in
'start')
  sendmail_start
  ;;
'stop')
  sendmail_stop
  ;;
'restart')
  sendmail_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac
You have new mail in /var/spool/mail/root
root@darkstar:~#
And, after
root@darkstar:~# mailx -s "Test2" exxxxxxxxxxxxxxxi@yahoo.com.ar
root@darkstar:~# mailx -s "Test3" exxxxxxxxxxxx4@fibertel.com.ar
Code:
root@darkstar:~# tail -n15 /var/log/maillog
Jul  6 11:59:31 darkstar sendmail[4315]: o66ExVtg004315: from=root, size=235, class=0, nrcpts=1, msgid=<201007061459.o66ExVtg004315@darkstar.mach6p>, relay=root@localhost
Jul  6 11:59:32 darkstar sm-mta[4319]: o66ExV3t004319: from=<root@darkstar.mach6p>, size=480, class=0, nrcpts=1, msgid=<201007061459.o66ExVtg004315@darkstar.mach6p>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jul  6 11:59:32 darkstar sendmail[4315]: o66ExVtg004315: to=exxxxxxxxxxxxxxi@yahoo.com.ar, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30235, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o66ExV3t004319 Message accepted for delivery)
Jul  6 11:59:35 darkstar sm-mta[4321]: o66ExV3t004319: to=<exxxxxxxxxxxxxi@yahoo.com.ar>, ctladdr=<root@darkstar.mach6p> (0/0), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120480, relay=f.mx.mail.yahoo.com. [98.137.54.237], dsn=2.0.0, stat=Sent (ok dirdel)
Jul  6 12:00:03 darkstar sendmail[4323]: o66F03QA004323: from=root, size=231, class=0, nrcpts=1, msgid=<201007061500.o66F03QA004323@darkstar.mach6p>, relay=root@localhost
Jul  6 12:00:04 darkstar sm-mta[4327]: o66F0355004327: from=<root@darkstar.mach6p>, size=472, class=0, nrcpts=1, msgid=<201007061500.o66F03QA004323@darkstar.mach6p>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jul  6 12:00:04 darkstar sendmail[4323]: o66F03QA004323: to=exxxxxxxxxxxxx4@fibertel.com.ar, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30231, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o66F0355004327 Message accepted for delivery)
Jul  6 12:00:06 darkstar sm-mta[4329]: o66F0355004327: to=<exxxxxxxxx4@fibertel.com.ar>, ctladdr=<root@darkstar.mach6p> (0/0), delay=00:00:03, xdelay=00:00:02, mailer=esmtp, pri=120472, relay=mx1.fibertel.com.ar. [24.232.0.226], dsn=5.6.0, stat=Data format error
Jul  6 12:00:06 darkstar sm-mta[4329]: o66F0355004327: o66F0655004329: DSN: Data format error
Jul  6 12:00:06 darkstar sm-mta[4329]: o66F0655004329: to=<root@darkstar.mach6p>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31687, dsn=2.0.0, stat=Sent
root@darkstar:~#
One thing I don't understand --assuming I understand something, is which MTA Kmail is utilizing, given that... Perhaps Kmail starts sendmail not as a daemon. I don't know about this, but it is certain Kmail is unable to send messages whereas it always receives them. But this is perhaps another matter and may be I have not set the identities and the account properly. I have just referred to Kmail as a diagnostics tool, as I am willing to dispose of it.
Also, reviewing /var/log/messages I see sendmail isn't run at boot time. In relation to your warning about possible security hole, I've noticed rc.sendmail invokes sendmail with argument -bd.
Again, thanks for your kind reply. Regards,

Enrique.

Last edited by stf92; 07-07-2010 at 04:57 PM.
 
Old 07-06-2010, 03:20 PM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Firstly, please don't go back to your Original Post (OP) and edit it after people (like myself) have already replied to it because now my reply at #2 looks, ... well... stupid and irrelevant. I am sure it was relevant to the OP.

Don't worry, I am "over it" now but please think about how confusing this can be for people reading these threads later (Google is very interested in posts to LQ, and re-indexes them within minutes).

Quote:
One thing I don't understand --assuming I understand something, is which MTA Kmail is utilizing,
OK, now you are talking about kmail again.

kmail uses itself, and your ISP to send and receive emails. It does not need, or use by default, mailx or sendmail. kmail uses POP3 / SMTP to exchange mail with your ISP's mailserver.

This is set up in Kmail - Settings - Configure Kmail - Accounts. There you will see tabs for "Sending mail" and "Receiving mail". These can be selected and edited.

In kmail, "Accounts" refer to accounts with an ISP, not local linux usernames. Kmail will fetch mail from your ISP(s) and put it in the local user's (that's to say the user who is running this instance of kmail) InBox.

Why mailx uses the term "Account" when it perhaps means "Username" (see the above posts) escapes me, but I have no experience with mailx.

HTH
 
Old 07-06-2010, 03:42 PM   #9
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
I'm very sorry to have messed up things. I too saw your post seemed kind of irrelevant after my editing. Take it as an LQ newbie mistake. It won't happen again.

About the "account" meaning, I take notice and it's kind of you to signal it. It's a pity KDE applications online help (manuals), for instance Kmail's, are so sober. In fact, it almost limits itself to describe the pull-down menus, but what is says about them is practically the same as the submenu title! Putting this aside, I have tried over and over again to set the identities and accounts in Kmail>Configure Kmail>Accounts/Identities but the result is always the same: I cannot send mail.

I'm reluctant to reinstall the whole o.s., especially when most probably I shall have the same problem again. This is not to blame Slackware. My experience as a programmer has taught me the mistake is mine almost invariably. Regards,

Enrique.

Last edited by stf92; 07-06-2010 at 03:51 PM.
 
Old 07-06-2010, 04:23 PM   #10
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
I'm very sorry to have messed up things.
Next time just add a post "I didn't mean that, what I meant was this". Meanwhile you have learnt and you are forgiven. End of story

Quote:
I have tried over and over again to set the identities and accounts in Kmail>Configure Kmail>Accounts/Identities but the result is always the same: I cannot send mail.
I expect there is some problem with your ISP and how it authenticates you.

My ISP recently became a lot more careful about how I identified myself ( a good thing ).
I used to be able to use kmail to send emails apparently from foo@bar.com, and tease my colleagues, but this isn't allowed any more ( a very good thing ).

Check how you are authenticating with your ISP. kmail has a button to "Check what the server supports", and then choose the most secure.

Failing that, try each one, one at a time, until it finally works.

ISPs are relaxed about you receiving email, but they are waking up to the fact that they do not want you to be sending spam. Not a problem (usually) for linux users, but we have to carry the fallout from all those windows PCs that are now acting as spambots.

If you are just running a home PC / network for your family, you don't need mailx or sendmail. In fact, I suggest you uninstall them. sendmail (I know, I haven't used it) has the reputation of being difficult to set up, and if you set up an "open relay" by accident, your ISP will probably disconnect you from the net. Not fun.

You don't say if you are running KDE3 (I have experience) or KDE4 ( I will not allow it on my PC, so have switched to gnome to keep my kernel up to date). Gnome's evolution email handler was surprisingly easy and painless to set up.

Quote:
It's a pity KDE applications online help (manuals), for instance Kmail's, are so sober.
Hmmmm.

That's the way it is. Developers are so focussed on developing their applications, that the documentation always lags behind.

It's human nature: "I'm so busy re-writing the code so it works MUCH better, that I don't have the time to write the documentation for the "old" version (that everybody is using), because, soon, it's all going to be different and much better".

That's life.

Meanwhile, all we users can do, is try different things out until it works, and it usually does

Persevere. It's worth it.
 
Old 07-06-2010, 05:25 PM   #11
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
KDE 3.5.7. is my version. My ISP is one of the worst all over the world. When I ask Kmail to check what the server supports (authentication, SMTP) it brings back ONLY ONE: PLAIN. And it offers no encryption. Talking with them on the telephone I couldn't learn a thing about the authentication method they use, but Kmail makes it clear.

One of the main reasons why I've tried to relay on mailx/sendmail, is that of using a black & white screen, with fonts (those provided by the char ROM generator) which I find more legible than "drawn" fonts. Childish, isn't it? On the other hand, there is elm (text mode), which maybe is a frontend for sendmail, but certainly more friendly than mailx.

I first got in contact with linux through a version bootable from Window$, which afterwards I managed to place in its own disk partitition.
After this portentous feat, it was a long time before I realized I could have a GUI (how to read PDFs after all?). Nowadays almost all linuxes boot directly into the GUI, but at that moment I had to read a lot of documentation and, by trial and error, find the way to put the screen into graphical mode. And there it was Gnome.

I want to switch over to Gnome too, but I haven't got the complete distro disk set. So I lack it. Regards.

Last edited by stf92; 07-06-2010 at 05:33 PM.
 
Old 07-06-2010, 05:56 PM   #12
RandomTroll
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 304

Rep: Reputation: 32
I'm having a hard time figuring out what you want to do. I'll address your misunderstandings.

maillog shows that recipient domains rejected your messages. I suspect they rejected your messages either because the sending domain doesn't exist (a common tactic of spamsters) or because they lacked bodies. Change your sending domain to one that exists (either in /etc/HOSTNAME or sendmail.cf) and include a body with your message.

rc.sendmail is a short script Slackware uses to start/stop/restart sendmail as a daemon (the -bd switch). Other distributions do it some other way. If you want sendmail to load as a daemon at boot edit /etc/rc.d/rc.M.

I like mailx - then again, I started using e-mail before we had anything other than its predecessor, mail. If you don't want to use mailx then, perhaps, you should start another thread with a different title, perhaps in the Slackware forum (or not - I haven't figured out what you want yet.)
 
Old 07-06-2010, 07:00 PM   #13
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
Hi:
Well, from the beginning it's been my intention to use but one MUA: mailx. This point having been clarified, I'm positive about my canonical hostname being darkstar.mach6p. I set it with netconfig and it is what is in /etc/HOSTNAME. No other lines in /etc/HOSTNAME. darkstar is the hostname and mach6p is the domain, if I am correct.

I have just look into my yahoo.com inbox and there is, although in folder spam, a message with sender= root@darkstar.mach6p dated today 14.54 UTC. I am not as much interested in why in spam as what I did that made the message reach there. A moment ago I send a new message (with a non empty body) to the same address but I don't see it in yahoo, spam folder or not! I'm sure I did not touch anything. Of course I sent a mail to yahoo at 11.54. But I've done it many a time before and it never get into yahoo, IFAIK.
Thanks for your patience and regards,

Enrique.

Last edited by stf92; 07-07-2010 at 05:23 AM.
 
Old 07-07-2010, 01:15 AM   #14
RandomTroll
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 304

Rep: Reputation: 32
Quote:
Originally Posted by stf92 View Post
from the beginning it's been my intention to use but one UMA: xmail.
xmail? not mailx? You mean MUA (Mail User Agent), not UMA (es UMA en espanol?)


Quote:
Originally Posted by stf92 View Post
I'm positive about my canonical hostname being darkstar.mach6p.
I'm positive about that too. I'm also positive that it's not a registered domain name. Every spam filter I know of will identify a message from an unregistered domain as spam: it was one of the common tricks of the first spamsters. If you don't mind I don't. Many relaying servers reject mail from unregistered domains.

Quote:
Originally Posted by stf92 View Post
I have just look into my yahoo.com inbox and there is, although in folder spam, a message with sender= root@darkstar.mach6p
That much worked.

You can spend some time evaluating the data error sendmail put in /var/log/maillog for the failed message, and compare it to the success message of the message that worked.
 
Old 07-07-2010, 06:50 AM   #15
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
I meant mailx. And MUA, of course. My mistake. (En wikipedia en espanol, figura tambien como MUA.) In my ISP I am registered as exxxxxxx4@fibertel.com.ar. Perhaps, I must useradd a user exxxxxxx4 and replace the contents of /etc/HOSTNAME, whose current contents is 'darkstar.mach6p', by 'fibertel.com.ar'. Then, login as estefan34. Or use the -r argument in mailx.

I do mind about mail originated by me being filtered out as spam. I mean, I want it to be delivered as normal mail. I have the feeling I am walking like a blind man here. My level of knowledge is well below what you probably think. And in this way I could be stealing valuable time. Thank you for your reply and regards from

Enrique.

Last edited by stf92; 07-07-2010 at 05:04 PM.
 
0 members found this post helpful.
  


Reply

Tags
mailx


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Procmail: forwarding mail to remote mail account Cadmium Linux - Software 2 01-14-2010 02:05 PM
How to transfer mail server(all mail account, message of all user) to another machine addil Linux - Newbie 4 04-13-2009 09:02 AM
Sending root mail to an external mail account aquaboot Debian 13 01-09-2009 08:23 PM
How to configure sendmail only to send mail to external mail account Nivix Linux - Newbie 2 10-23-2008 01:46 AM
How to have limited mail on a linux server that support unlimited e-mail account mmh Linux - General 3 03-15-2006 07:52 AM


All times are GMT -5. The time now is 12:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration