setting up sendmail???

Discussion in 'Computing and Networks' started by Mathematics!, Apr 28, 2010.

  1. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    1,022
    4
    I am trying to setup sendmail in my internal network,

    Question 1
    I did a port scan and verified that sendmail is running on smtp port 25
    then I connected to it with telnet and tried to sent an email to myself.
    I used the email account username@computername correct me if I am wrong in the @ part of the email by default I thought after the @ is the computer name you are running the sendmail service on. Note I don't have a static ip / domain name if I did I would use my @domain.name

    Question 2
    where is the emails placed when I installed sendmail it never created any mbox or mail folders in the users home directory. Are you suppose to create these manual. If so how do I do it?
    Also where are the emails being placed when I am sending them thru telnet???

    Question 3
    I have done a check in /var/mail/ and their is one file that is named my user name when I look in it I see all the emails I have been sending thru sendmail concataneted together one after the other. I am wondering is this where all the failed emails go for a user. what exactly is /var/mail directory for? (this may have answered question 2 to some extent)

    Question 4
    Does sendmail just work on smtp or can you have it do imap/pop3 stuff?
    Basically does sendmail come with a imap or pop daemon or must you download an
    additional pop / imap daemon ...etc?
    Basically I am finding it weird that I can telnet in or use a client to send mail but
    sendmail doesn't have the ability to let you view email???
    If am wrong with this please inform.

    Thanks
     
    Last edited: Apr 28, 2010
  2. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
  3. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
  4. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    1,022
    4
    thanks rjenkins

    that answered question 4.
    I do find it odd that when download sendmail they expect you to download another thing to do the pop or imap stuff.

    If I don't have pop or imap setup where does the sendmail typical put the email in???

    I just setup courier imap server running on port 143
    I tried to send an email to myself on the same computer as I have sendmail and imap installed.
    But it is not showing up in the evolution mail client?

    I don't think I have anything setup wrong in the evolution client so is their something I have to tell send mail or courier-imap to get them to work together.

    This all leads to my question where is sendmail putting the emails / what format ,...etc
    And how do I get my imap or pop services to retrevie it from their???

    Thanks
    I have looked thru the sendmail sites and google around for configurations ,...etc
    but that doesn't seem to help. Since I know the commands to set something in the .mc files
    my problem is getting the emails to work witha client / imap service so I can view them in a email client such as evolution .

    I know sendmail is sending emails since all of them are going into var/mail/usernamefile ....

    Is this what sendmail typically puts the emails being sent to a user because their is a big text file for each user under this folder
    the file names are user1 , user2 ,...etc and it seems like all the messages I have been sending go into their. Is that what is suppose to happen? I remember a while back 5 years or so ago I had an a count on a linux server and all the emails would go into my mbox.
    Which is why I am a little suprise when installing it didn't create a specfic mbox folder for each user in the /home directory.
    Maybe the new sendmail versions are putting everything into one file per each user under /var/mail...maybe that is the new way of doing thing....
    duno.
     
    Last edited: Apr 28, 2010
  5. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Sendmail doesn't recieve mail. You will need a post office daemon to handle that. Sendmail routes outgoing mail from applications or websites on your box to the handler.

    If you have a form on your webpage and you want a user to be able to email you the results, the page would use sendmail to get the info from the page into an email format and use your available daemon to route the mail.
     
  6. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    1,022
    4
    yes , I get that sendmail send mail but once it sends the mail to the proper place the other smtp (sendmail service must store it somewhere for pop/imap to retrieve later for the user).

    For instance if somebody send me an email my sendmail service must recieve that email and store it on the server someway.
    So what I was asking is it typical how does sendmail store it is it suppose to go to /var/mail .

    pop and imap is just for a mail client to retrieve or view an email.

    But sendmail is just for sending and storing emails.

    so my previous post is still not cleared up
     
  7. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Oh, the SENDMAIL Queue. The exact location is in the config file.

    That where is stays before, after and during processing.
     
  8. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    1,022
    4
    well I cann't see a setting for it in the mc files so the default for the mail must be var/mail .
    /var/spool/mqueue looks as if it just contains all the currently waiting to be sent emails
    /var/spool/mqueue-clients looks as if it just contains all the warnings and failed delivier attemps messages.

    But all the emails for a user seem to be by default placed in var/mail .

    Anyway I am trying to figure out where the settings for this are so I can change them.

    Either way I am wondering if I create a folder called mbox in under my home directory will the messages be placed in their or how I can configure it like that.

    Also I have imap running did a portscan say's 143 is open but I still cann't get evolution to import the emails?
    Do I have to some how tell it to look in var/mail or something?

    dnl is the commenting out command
    but is # also commenting out stuff as well in these mc , cf , config files?
    Curious because maybe I made a mistake in these files.

    Thanks
    I am getting closer to understanding the whole think of sendmail
    But now the main thing is getting the pop or imap service to work with it???
     
    Last edited: Apr 28, 2010
  9. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,907
    2,165
    My 2c for ya.
    Run away from sendmail and install postfix.
    http://www.postfix.org/documentation.html
    http://neil-neely.blogspot.com/2007/05/postfix-better-than-sendmail.html
     
  10. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    I use postfix. ;)
     
  11. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    1,022
    4
    I may end up doing that.

    But I don't want to use pop or pop3 I want to use imap with my smtp server.

    Either way sendmail is not the problem I can send mail to anybody on the internal network. But I have to go directly to the /var/mail/username folder and scroll down to see where it is. it is in their somewhere though.

    the imap is the problem I have it running on it's standard port but I cann't get it to work with evolution or any email client for that matter.
    When I send/receive button on envolution to test if I can send myself an email
    Server unexpectedly disconnected: Fatal error: No such file or directory: No such file or directory
    It gives me an error while scanning folders in IMAP server 192.168.1.100

    I am using courier-imap for my imap service.

    I am curious if I need to create a specific folder somewhere or something.

    EITHER WAY SENDMAIL IS NOT THE MAIN ISSUE ANY MORE
    because I can send an email using evolution and it will wind up being appended to the correct /var/mail/username file

    the problem is retrivial of of the emails from the var/mail/username file and displaying it in evolution.
     
  12. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,907
    2,165
    My main mail-server uses uw-imap. http://www.washington.edu/imap/
    http://en.wikipedia.org/wiki/UW_IMAP


    With Debian it was plug&play.

    Setup TLS/SSL for secure connections
    http://xlife.zuavra.net/index.php/32/
     
  13. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    dovecot supports imap as well as pop3, it's down to what you enable in it's config.

    Simply typing 'mail' at the command prompt should allow you to read 'your' mail from the file-based queue, without any other email program or add-ons.

    For any generic email program to work, you will have to add or enable either a pop3 or imap server and configure the mail program to connect with it.

    You may find that dovecot is installed but not running - if you are using a Redhat-based system (RHEL, Fedora, Centos etc) just type 'setup' and go to the system services list - you can see which are installed and which auto-start.

    Otherwise you may need to add it with YUM or whatever your system uses for package management.
     
  14. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    1,022
    4
    In sendmail now that I have it working in my internel network.
    I want to beable to relay or receive emails from any domain or ip address in the world?

    I was told that I have to enable open relay but I don't know what I have to put in the .mc file to do that.

    Does anybody know.

    Is all I have to do is put this in the sendmail.mc file FEATURE(promiscuous_relay)

    Will that enable me to send and receive emails from everybody?
     
  15. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    If you have the basic config correct, it should already be trying to send mail and will be capable of receiving mail from anywhere.

    As SMTP is a 'push' based protocol, other people would have to connect to your machine to send you mail. Some ISPs do support this, but the common way of doing it is to use 'fetchmail' (running every so often from cron), which connects to your ISP mail account using pop3 and transfers the mail to the local sendmail for final delivery.

    As it is, you should find that it is trying to send outgoing mail, but you get bounces - the servers you are sending to don't know you are not a random spammer.

    You definitely do not want to set it up as an open relay - it should only accept connections from other machines on your local network.

    To relay through your ISPs mail system, add their SMTP server name in your sendmail.cf file, eg. for Plusnet's outgoing mail server 'relay.plus.net'

    # "Smart" relay host (may be null)
    DSrelay.plus.net

    The DS line is usally blank.

    You may need to set up SMTP authentication as well, offhand I can't remember the details for that.
     
  16. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    1,022
    4
    Ok , but I am trying to understand somethings in the etc/mail directory.

    I have aliases , access , local-host-names, submit , trusted-users,
    address.resolve and a few others.

    What I am confused about is where I can put yahoo.com to beable to send/recieve emails from them?

    And I have a domain name for my machine but I don't know in the to: field of yahoo's web email. What to put to send it to a specific users email box on my 192.168.1.100 computer.

    Basically I know I need to use the username@my.domain.name.com but how do I link that email address to the inside email address way.
    For example to send an email to jim on my machine. I would just compose an email with the to:<jim@my-computer-name> or <jim@localhost> (that is when I am sending it from the inside not outside from the internet)

    But from outside the network you would have to use the domain name.
    such as jim@my.domain.name.com how can I link the names.

    like when ever i type jim@my.domain.com it gets sent to the jim@my-computer-name

    Do I do this in the aliases file?

    Thanks
     
  17. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,907
    2,165
    You might want to use yahoo.com as a smarthost and masquerade your hostname to make it work. http://www.elandsys.com/resources/sendmail/smarthost.html
     
  18. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    Yes, as nsaspook says, you use the masquerade command to tell your server what 'your' email domain is (for example, math.com). That must be your true, public, email domain.

    The email domain is whatever is after the @ in your email address, so for it to work it must be a domain you own.

    Any email @that domain is handled locally, any email @any other domain is sent out to the relay host.

    I think you are going to have a bit of a problem if you are on a yahoo mail account...

    The only way you can receive mail for multiple users is if you have an email account that supports multiple users; eg.

    if you had the domain 'math.com' then email addresses could be 'anything @yahoo.com'

    The 'anything' part is translated to the local username using the /etc/aliases file.

    But, if your address was 'math @yahoo.com' then that is a single email and cannot be split.

    Some ISPs do allow you to create a few alternate email addresses & have them all delivered to a single pop3 account.

    If you can receive mail to more that one email address on your basic POP3 account, you can use fetchmail to collect it and sendmail to deliver it to the various users.
    With only a single email address, you can only have one user.
     
    Last edited: May 3, 2010
  19. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    1,022
    4
    well I was asking say I have this
    I can email my users on the LAN by using

    user1@my-server
    user2@my-server

    But from the WAN/Internet I have to use port forwarding to my-server on port 25 and if I am emailing using yahoo I would need to email with a to clause of
    user1@domain.name.com
    user2@domain.name.com

    How do I link the user1@my-server to recieve the email when somebody uses the user1@domain.name.com.

    I am 90% sure that I would just have to put a line like this
    user1@my-server user1@domain.name.com
    in the aliases file.

    That was all I was asking as for sending/recieveing emails from the internet
    I would think it should totally work by just putting this FEATURE(promiscuous_relay)
    which turns off all the checking.

    I don't know what the difference between using smarthost stuff as opposed to FEATURE(promiscuous_relay) does differently???


    I am going to use devcot for my imap because I was looking at it and it seems really easy to configure/use.... much easier then this courier-imap.
     
Loading...