The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how i can monitor or make log from my send and receive mail server ?

Discussion in 'E-mail Discussions' started by masternic, Apr 11, 2008.

  1. masternic

    masternic Member

    Joined:
    Sep 26, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Dear Sir

    I have linux dedicated server, please let me know
    Regards
    masternic
     
  2. masternic

    masternic Member

    Joined:
    Sep 26, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    thnx
    yes its cpanel but i got below error:
    -bash: /var/log/exim_mainlog: Permission denied
    how can i use your coomand ?
    regards
    masternic
     
  3. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    if its a cpanel server, the logs you need are:

    /var/log/exim_mainlog - Main SMTP log
    /var/log/exim_rejectlog - Rejected email transactions
    /var/log/exim_paniclog - Fatal errors

    Spamassassin/Mailscanner and pop and imap logins: /var/log/maillog
     
  4. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    You have to be root and will need to use either a text editor or querying tool to view the contents.

    e.g. vi /var/log/exim_mainlog
     
  5. masternic

    masternic Member

    Joined:
    Sep 26, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Thnx
    yes i saw that log as root acount but it has allot of data , and very hard to find sender and receiver address, i wana to see brif log include sender e-mail address and receiver e-mail address !
    please let me know how i can get it ?

    regards
    masternic
     
  6. LiNUxG0d

    LiNUxG0d Well-Known Member

    Joined:
    Jun 25, 2003
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gatineau, Quebec, Canada
    Hey there,

    A few tips I can probably just share out...

    When it comes to your exim.conf, you should use the Exim Configuration Editor in WHM to edit it, just FYI. Don't edit it using an editor.

    Ok, now that that is said, here are some extra settings you can add to your exim.conf's FIRST box in the WHM Advanced Editor for Exim:

    log_selector = +address_rewrite +all_parents +arguments +connection_reject +delay_delivery +delivery_size +queue_run +received_sender +received_recipients +retry_defer +sender_on_delivery +size_reject +skip_delivery +subject


    You can remove ANY of the options that have a plus (+) beside them if you don't want it... so you could tweak it to be like this:

    log_selector = +address_rewrite +received_sender +received_recipients +sender_on_delivery +subject

    This would give you any re-writes on the addressed, the sender when received, the recipiets when received, the sender used to deliver AND the subject of the mail.

    Chances are - if you're running the default cPanel config - you're configured for minimal logging.

    Once this is done, you can then parse your logs. If you wanted to scan your logs for specific information, from a shell as root, you can use the following command:

    exigrep

    Exigrep allows you to read the mail logs and get the appropriate message. So let's say you got a spam complaint, you could get the message ID and issue:

    Code:
    [root@server ~]# exigrep "1IvLIh-0002BL-Qn" /var/log/exim_mainlog
    2007-11-22 18:17:40 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1IvLIh-0002BL-Qn
    
    2007-11-22 18:17:40 1IvLIh-0002BL-Qn <= bob@example.com H=pool-151-198-129-44.mad.east.verizon.net [151.198.129.44] P=esmtp S=1667 id=01c82d37$8d9fcb10$2c81c697@bob T="MedsSoftTabsShipping"
    2007-11-22 18:17:41 1IvLIh-0002BL-Qn => listprof <fabio@example.com> R=localuser T=local_delivery
    2007-11-22 18:17:41 1IvLIh-0002BL-Qn Completed
    
    Here we see that a mail came in from "bob@example.com" with subject "MedsSoftTabsShipping" for fabio@example.com, a localuser. The delivery was then completed.

    Of course, changing how/where exim logs may prove to be difficult; I simply wish to turn you on to some commands that could help you in your day to day administrative activities.

    Hope this is of use to you. If not, let me know and we'll see what we can find. :)

    Regards,
     
  7. masternic

    masternic Member

    Joined:
    Sep 26, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    thnx for good information

    just a gentle question ? is there any additional software on the linux for more facility in this regard ?

    masternic
     
  8. LiNUxG0d

    LiNUxG0d Well-Known Member

    Joined:
    Jun 25, 2003
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gatineau, Quebec, Canada
    Welllll...

    It so happens I've played around with a software that parsed exim logs into pretty html and gave you stats for all the users, domains, etc. Gives you pretty good summaries, but it can take up lots of room. ;)

    Check out: http://www.enderunix.org/isoqlog/ (IsoQLog)

    It's a log analysis and compilation tool. It hasn't been worked on since what appears to be 2005, but last I checked, it worked well for me.

    Let me quote some of their features:

    Code:
    # Multi MTA support(qmail (multilog and syslog), postfix, sendmail, exim)
    # Multi-domain support: Shows quite detailed statistics for not only your main domain, but also, any domain you want.
    # Displays statistics for common mail delivery errors.
    # For each domain you specify; displays Top incoming, outgoing, total and byte based statistics for users.
    # Displays server's activity based on incoming, outgoing, total mails and size of incoming mail, for domain and its users.
    # All days', all months', all years' activities ( above ones ) are stored for future inspection.
    # Multi-language Support ( Turkish, English, German,Portuguese,Spanish ,Italian,french, Swedish, Dutch, Polish, Norwegian, Russian,Czech,Romanian,Danish)
    Not too shabby. Keeps them all up to date and all that, as long as you're logging enough data with the log_selectors. ;)

    Let me know if you have follow-up questions. I don't really support isoqlog though, so don't ask me too much about it, unless through PM. ;) We can keep the unsupported banter off-topic. ;)

    Regards,
     
Loading...

Share This Page