LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-06-2012, 05:44 PM   #1
signalman
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Rep: Reputation: Disabled
Sendmail Config--Two mail accounts from one shell user.


Hello All.

I have only a Linux user account on a certain system with a default e-mail address based on my username. However, I want to have a second mail account. The admin is willing to implement this if I can tell him how to configure sendmail for it, but he does not want to create another shell user just for the second e-mail account, even if it has no login capability. Therefore, I need to have a second, totally separate e-mail account that I can access from the same shell user account. (If it makes any difference, I would ultimately want the second e-mail account to be accessible using IMAP as well.)

Unfortunately, I hardly know anything about Linux besides how to type "ls", and the sendmail tutorial that I saw looked like Greek to me without any clear sign of containing the information that I needed. I don't even know if this is possible.

Can anyone help?

Thanks in advance,

Signalman
 
Old 06-06-2012, 08:33 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,237

Rep: Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712
This isn't a total soln, but if you initially just want the email to look as if it came from the 'other' acct, then you can use the mailx -r switch thus
Code:
(uname -a) | mailx -s "test" -r other@addr destn@destn_addr
Just try that (amend email addrs) http://linux.die.net/man/1/mailx
 
1 members found this post helpful.
Old 06-07-2012, 12:26 AM   #3
signalman
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks, Chrism01, for your prompt reply.

Am I correct in guessing that your code goes in at the shell prompt and not in the sendmail config file? If so, wouldn't I have to type it every time I want to send mail from a different address? (Sorry, I'm still very inexperienced in Linux.)

You're right, that isn't a total solution because I also want to collect incoming mail from the new address and have the messages sent to that address in a separate mailbox. It looks like this would work if I want to re-purpose the original mailbox, though.

Signalman
 
Old 06-07-2012, 02:30 AM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

as I understand it, you may want an "alias" which will use an almost unlimited addresses to a single user account.

may the examples be your guide:
- sendmail aliases
- sendmail configuration
- sendmail configuration examples

I'm sorry I don't know "sendmail" more (I use Postfix and also don't know it much)

good luck
 
1 members found this post helpful.
Old 06-07-2012, 01:03 PM   #5
signalman
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks, Lithos. I guess I have to look at the sendmail tutorials more. I'm willing to read, but I'm not sure how to efficiently search for the information I need, since perhaps I'm not describing it using the most accepted terminology.

Can anyone say that it's definitely possible to have multiple mailboxes corresponding to multiple e-mail addresses under a single shell user using Sendmail? I know how to set the MX record with the registrar, but the server needs to know what to do with the mail sent to the new address.
 
Old 06-08-2012, 01:39 AM   #6
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

I can say for sure that (on my server with postfix) aliases are working for different email addresses to one single account (local user on server).
I have a customer defined 2 domains and different email addresses to his username, so he receives emails from both addresses on his account.
That's why aliases are for.

PS: I'm sorry I don't know sendmail.
 
1 members found this post helpful.
Old 06-08-2012, 05:46 PM   #7
signalman
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks anyway. I've got the impression from different people that Sendmail is a little old fashioned or something, hence people use something else instead. As a user on the system, this is just what I have to work with.

An alias might be a temporary solution, but that sounds similar to a redirect or a forward to the same mailbox. Of course, I'm ultimately looking to have two separate mailboxes. The thing that there is only one of is the shell user account. I guess you understand that already and are just offering a partial solution based on what you know.

I haven't given up yet on the separate mailboxes. If I don't figure that out, then I will possibly pursue aliases.

Thanks again.
 
Old 06-09-2012, 01:41 AM   #8
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by signalman View Post
Thanks anyway. I've got the impression from different people that Sendmail is a little old fashioned or something, hence people use something else instead. ...
Right, Postfix is used nowadays (preferably)

Quote:
Originally Posted by signalman View Post
....
An alias might be a temporary solution, but that sounds similar to a redirect or a forward to the same mailbox. Of course, I'm ultimately looking to have two separate mailboxes. The thing that there is only one of is the shell user account. I guess you understand that already and are just offering a partial solution based on what you know.

I haven't given up yet on the separate mailboxes. If I don't figure that out, then I will possibly pursue aliases.

Thanks again.
Yes, "alias" is a redirect/forward to 1 (one) mbox,
I honestly don't know how to do it with postfix either (two mailboxes/ one user).


I hope you find a solution.

good luck
 
Old 06-12-2012, 07:06 PM   #9
signalman
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
I'll probably have to go reading some more. If anyone has a full solution, please let me know! Thanks again everyone for your information on a partial solution.

Regards,

Signalman
 
Old 06-14-2012, 01:02 AM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,237

Rep: Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712
I'm not an email expert, but I believe that email in general doesn't allow what you want.

You can fake outgoing email addrs (as per my example) & if this is automated, you can use variables, so it can generate src & destn addrs on the fly if reqd.
Its just a (bash) cmd line.
(I'm hoping this isn't a spam system)

You can have aliases that effectively re-direct, as do .fwd files (old school), so that one user can receive emails sent to other user addrs.

However, I'm reasonably sure (but could be wrong) that at the end of the day, email in general (not just sendmail) can only have one final 'real' inbox per shell acct.

Note that it would be possible (if tedious) to write a front-end that sorts differently addressed emails into different 'apparent' inboxes, so that you appear to have multiple addrs, but that wouldn't alter the underlying truth.

... waits to be corrected by a real email guru
 
1 members found this post helpful.
Old 06-23-2012, 10:55 PM   #11
signalman
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Ok, I've been reading about Sendmail configuration in the meantime, and learned quite a bit from where I started.

Assuming that I have only one mailbox, suppose I configure the following files so that I can catch mail from an alias and have sent mail appear to come from the same alias. Will using IMAP bypass the settings so that sent mail appears to come from the real address, or will it preserve the appearance of coming from the virtual address that I specified? I realize not everyone is familiar with Sendmail, but thought someone might be confident about an answer based on their general understanding of mail handing in Linux.

/etc/mail/virtusertable
/etc/mail/aliases
/etc/mail/genericstable
 
  


Reply


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
A script that creates user accounts with c-shell bartsimpsong Linux - Newbie 13 10-13-2011 12:55 AM
sendmail user accounts problem sandy6573 Linux - Server 1 01-03-2010 11:32 AM
Create user accounts from shell script? maheshkodamati Linux - Newbie 1 02-26-2008 11:46 AM
Request : set passwords for many users [user accounts exist] using a shell script bv_uma Linux - Software 3 08-19-2006 09:01 AM
New user e-mail accounts in domain. sarathmohan Linux - Newbie 2 10-17-2003 12:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:33 AM.

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
Open Source Consulting | Domain Registration