Posts Tagged Postfix Mail Server

Postfix Statistics

Posted by Filed Under Statistics with 1 Comment

It is important to understand what your mail server is doing.  Statistics can be warnings about problems that are developing but also provide you with information that will help you make decisions about hardware and management.  One program that provides some insight into the hard work your mail server is doing is pflogsumm.

pflogsumm
pflogsumm.pl is designed to provide an over-view of postfix activity and produce a log summary of the data that is in the system logs.

You can download the script from here:

http://jimsun.linxnet.com/postfix_contrib.html

Pflogsumm requires the Date::Calc module.  You can download and install the Date::Calc module from CPAN.  It can be found at:

http://search.cpan.org/search?module=Date::Calc

Usage
When you want to run the program just invoke the command and provide log that it should evaluate.

./pflogsumm.pl /var/log/maillog

Example Results

Grand Totals
————
messages

144   received
159   delivered
0   forwarded
0   deferred
24   bounced
357   rejected (69%)
0   reject warnings
0   held
0   discarded (0%)

1219k  bytes received
1070k  bytes delivered
127   senders
108   sending hosts/domains
5   recipients
4   recipient hosts/domains

Per-Day Traffic Summary
date          received  delivered   deferred    bounced     rejected
——————————————————————–
Sep  7 2008        33         41          0          4        102
Sep  8 2008        70         76          0         10        202
Sep  9 2008        41         42          0         10         53

Per-Hour Traffic Daily Average
time          received  delivered   deferred    bounced     rejected
——————————————————————–
0000-0100           2          2          0          0          2
0100-0200           2          2          0          1          3
0200-0300           0          0          0          0          3
0300-0400           2          3          0          0          3
0400-0500           1          1          0          1          3
0500-0600           2          2          0          0          4
0600-0700           3          3          0          1          6
0700-0800           4          5          0          0          6
0800-0900           4          5          0          0          5
0900-1000           2          2          0          1          6
1000-1100           3          4          0          1          6
1100-1200           4          4          0          1          9
1200-1300           3          4          0          1          6
1300-1400           2          2          0          1          6
1400-1500           2          2          0          0          5
1500-1600           2          2          0          0          4
1600-1700           2          2          0          0          3
1700-1800           2          1          0          1          7
1800-1900           1          1          0          0          5
1900-2000           2          2          0          1          7
2000-2100           1          1          0          0          6
2100-2200           1          1          0          0          3
2200-2300           1          1          0          1          7
2300-2400           1          1          0          0          4

Host/Domain Summary: Message Delivery
sent cnt  bytes   defers   avg dly max dly host/domain
——– ——-  ——-  ——- ——- ———–
73   325657        0    11.9 s   57.0 s  somedomain.net
71      679k       0    11.1 s    1.3 m  gmail.com
14    72076        0     4.6 s   21.0 s  hotmail.com
1     2053        0     1.0 s    1.0 s  anotherdomain.com

Host/Domain Summary: Messages Received
msg cnt   bytes   host/domain
——– ——-  ———–
10    10580   mail.goo.ne.jp
8    21551   itextron.com
5    14784   paypal.com
3    12234   yeah.net
3     7758   ebay.com
3     6151   gmail.com
3     5754   yahoo.com
2    13567   yahoo.com.cn
2    10367   sales12.com
2     7080   hotmail.com
2     2607   waiuj.info
2     2470   gojen.info
2     1924   greatezleads.com
2     1767   infoseek.jp
1   170371   mail333.com

Senders by message count
————————
8   govclaimdpt1@itextron.com
3   aw-confirm@ebay.com
3   payment@paypal.com
2   cjyoujsd@yahoo.com.cn
2   noreply@greatezleads.com
2   service@paypal.com
2   kosher@sales12.com
2   kamishinmeiki@infoseek.jp
1   hulawrence@yahoo.com.ar

Recipients by message count
—————————
73   tom@somedomain.net
44   some_user@gmail.com
27   another_user@gmail.com
14   some_user@hotmail.com

Senders by message size
———————–
170371   avrsem@mail333.com
147883   KingCity@kingscity6.com
107654   Sharon@korinet2.com
68373   mefike@muzar6.com
59184   MAROM_TEUFA@marom2.com
45149   root@mast1.nettransactions.com
43467   test@relay05.reunion.com
39630   Dell_Small_Business@busenetwork.net
29044   sintera@mitug12.com
28028   return_0_17181861818_17179873120@tauckworlddiscovery.fbmta.com
26748   zt_mailer_17@zt40.broadcasttoemail.com
23793   newsbites@sans.org
23547   no_reply@gruppolife.net
21551   govclaimdpt1@itextron.com

Recipients by message size
————————–
402222   some_user@gmail.com
325657   some_user@somedomain.net
293876   another_user@gmail.com
72076   some_user@hotmail.com

message deferral detail: none
message bounce detail (by relay)
——————————–
somedomain.net.s6a1.psmtp.com[164.18.15.160]:25 (total: 11)
2   MAIL FROM:<kosher@sales12.com> (in reply to RCPT TO command)
1   <arc_sakurapv6@ss-td.yoshi-ss.info> (in reply to RCPT TO command)
1   MAIL FROM:<tatumi-2@doreamtf.info> (in reply to RCPT TO command)
1   MAIL FROM:<Sharon@korinet2.com> (in reply to RCPT TO command)
1   MAIL FROM:<KingCity@kingscity6.com> (in reply to RCPT TO command)
1   MAIL FROM:<sintera@mitug12.com> (in reply to RCPT TO command)
1   MAIL FROM:<fondorger@windson.info> (in reply to RCPT TO command)
1   MAIL FROM:<MAROM_TEUFA@marom2.com> (in reply to RCPT TO command)
1   MAIL FROM:<mefike@muzar6.com> (in reply to RCPT TO command)
1   <theophiluso@mackone.freeserve.co.uk> (in reply to RCPT TO comm…

none (total: 12)
9   Host not found
3   Host found but no data record of requested type

message reject detail
———————
RCPT
blocked using sbl-xbl.spamhaus.org (total: 234)
16   125.187.32.174
11   rr.com
9   verizon.net
5   qwest.net
4   66.199.236.122
4   charter.com

Helo command rejected: need fully-qualified hostname (total: 46)
3   117.104.245.36
2   219.130.135.222
2   24.139.224.228
2   117.104.245.37

Recipient address rejected: User unknown in virtual alias table (total: 32)
4   buhgalter@somedomain.com
4   office@somedomain.com
3   director@somedomain.com
2   buhg@somedomain.com
2   buhgalteria@somedomain.com
Recipient address rejected: User unknown in virtual mailbox table (total: 1)
1   contact@somedomain.com
Relay access denied (total: 39)
4   samsung.co.kr
3   hundred-acre-retrievers.com
3   ppp83-237-120-194.pppoe.mtu-net.ru
2   147.202.65.172
2   google.com
2   adsl-dyn213.78-98-40.t-com.sk
1   64.18.134.189
1   220.248.128.162

Sender address rejected: Bad Network (total: 5)
1   ghwjbotsecg@brandbox.com
1   mag@cybr01.com
1   sylvester@ciberaula.infase.es

message reject warning detail: none

message hold detail: none

message discard detail: none

smtp delivery failures: none

Warnings
——–
smtpd (total: 152)
4   66.199.236.122: hostname 66-199-236-122.reverse.ezzi.net verifi…
4   61.29.115.50: hostname dsl-61-29-115-50.request.com.au verifica…
4   Unable to look up MX host for yamabiko-do.net: Host not found
3   117.104.245.36: hostname 36.245.104.117.ids.service.eastern-tel…
3   Unable to look up MX host for pure1-mail.net: Host not found
3   Unable to look up MX host for treasure-boxes.jp: Host not found
1   Unable to look up MX host imail.interainc.com for Sender addres…

trivial-rewrite (total: 423)

virtual (total: 2)
1   database /etc/postfix/virtual_gid_map.db is older than source f…
1   database /etc/postfix/virtual_uid_map.db is older than source f…

Fatal Errors: none

Panics: none

Master daemon messages
———————-
1   reload configuration /etc/postfix

Postfix With Multiple Domains

Posted by Filed Under Multiple Domains with Comments Off

Postfix Mail Server will allow you to set a base domain and add any number of virtual domains.  Virtual domains can either be virtual alias domains which are the domains that your server is the final destination for and also virtual mailbox domains which do not have local accounts and only pick up mail through IMAP or POP3.

The canonical name on a system refers to the local domain of the system; including localhost, $myhostname, $mydomain and the IP Address of the mail server. That means there are 4 possibilities for an entry as canonical domain.

Virtual domains are totally different domains than the localhost. When you set up virtual domains, you need to consider two important aspects in how the mail to the virtual domain will be delivered.

1. Shared Domain – Does each mail namespace such as mike go to each domain. In other words, if an email is sent to mike@example.com is it the same user as mike@myexample.com?
2. Virtual Accounts – Does each user have a real account on the mail server? Users who pick up their mail locally may have an account on the mail server, but those on virtual domains do not need to log into a local account, they just need access to pick up their mail through POP3 or IMAP.

In order to use virtual mailbox domains the master daemon needs to be able to run the virtual daemon. Look for this like to verify it can do this in the master.cf. Do not run this chrooted.
virtual unix – n n – - virtual

Separate Domains with Virtual Accounts

This type of setup allows you to configure domains and the users of those domains so they do not log into the local system. You do not need to maintain local accounts, the users on these domains may pick up their mail using POP3 or IMAP. In fact, this will add a level of security as users will not be logging into the system nor will accounts have access to the /etc/passwd file. The virtual delivery agent, which manages the accounts, depends entirely upon map types.

To set this up you need to configure a directive for virtual mailbox accounts.

virtual_mailbox_domains = someexample.com, myexample.com

If you had a great number of domains you may not want to list them here but create a file, so it would look like this:

virtual_mailbox_domains = /etc/postfix/virtual_domains

You would need to create the file virtual_domains with one domain listed per line.

# # /etc/postfix/virtual_domains # someexample.com myexample.com

These virtual accounts will be delivered to the virtual delivery agent.

One other aspect of setup is that you will need to create a directory system that will facilitate your virtual domains. There will need to be a directory for each virtual domain listed in the /var/spool/vhosts.

This is how the directory structure should look:

/var/spool/vhosts/example.com
/var/spool/vhosts/myexample.com

The main.cf must be edited to reflect this change. This line should be added:

virtual_mailbox_base = /var/spool/vhosts

Each user for these domains must have a email address mapping to mailbox. In order to set this up you must use the directive for virtual_mailbox_recipients in the main.cf.

virtual_mailbox_recipients = hash:/etc/postfix/virtual_mailbox_recipients

Now if the /etc/postfix/virtual_mailbox_recipients file is not created you need to create it. The file has two entries which are separated by a TAB. Place the fully qualified email address in the left and the corresponding mailbox on the right.

sales@example.com example.com/sales/
tech@myexample.com myexample.com/tech/

Here you see two email addresses which are needed and mapped to their necessary mailboxes. Once this file is set up or if you make changes to the virtual file run this command:

postmap hash:/etc/postfix/virtual_mailbox_recipients

Create the necessary mail directories for domains.
mkdir /var/spool/vhosts/example.com
mkdir /var/spool/vhosts/myexample.com

Create the necessary mail directories for users.
mkdir /var/spool/vhosts/example.com/sales
mkdir /var/spool/vhosts/myexample.com/tech

Create the necessary mail directories for users boxes since this is the MailDir format.
mkdir /var/spool/vhosts/example.com/sales new cur tmp
chmod 700 /var/spool/vhosts/example.com/tech new cur tmp

Copyright CyberMontana Inc. and Postfixmail.com

All rights reserved. Cannot be reproduced without written permission. Box 1262 Trout Creek, MT 59874

Clients with TLS

Posted by Filed Under Mail Client with Comments Off

If you want to use TLS, encrypted communication between the server and client, you will be very frustrated with Linux options.  Evolution will not recognize port 993 or 995 which are used with TLS.  Thunderbird is supposed to work, but I could never get it to connect correctly.  An excellent option is Zimbra Desktop.  You can download Zimbra Desktop from HERE

If you choose to install in Linux you will need to execute the command to install for each user.

sh zdesktop_0_90_build_1278_linux_i686.sh

This will execute the script and it will begin installation.


Be sure to set up a Desktop icon so it is easy to start.

One nice feature is you can add a number of web clients and combine them all into the desktop.  In other words, you can manage all of your email accounts into one.

If you want to set up TLS select IMAP and port 993 to connect securely to your mail server.


Copyright CyberMontana Inc. and Postfixmail.com
All rights reserved. Cannot be reproduced without written permission. Box 1262 Trout Creek, MT 59874

  Newer Entries »