LinuxHelps.com

A blog for Linux Lovers.

Archive for the ‘Exim’ Category

Posted by sibu on March 10, 2009

never_users list error in mail log.

When having trouble with email I got the following error in the exim_paniclog on a cpanel server:

User 0 set for local_delivery transport is on the never_users list

The issue appears to be with some of the libraries the following commands should fix it:

Download libdb2.so.3 from renowned site then create a symbolic link:
ln -s libdb2.so.3 libdb.so.3

/scripts/eximup –force
/etc/rc.d/init.d/exim restart

Posted by sibu on March 10, 2009

Exim Shell Commands

Print a count of the messages in the queue:
root@localhost# exim -bpc

Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient):
root@localhost# exim -bp

Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals):
root@localhost# exim -bp | exiqsumm

Print what Exim is doing right now:
root@localhost# exiwhat

Test how exim will route a given address:

root@localhost# exim -bt alias@localdomain.com
user@thishost.com
<– alias@localdomain.com
router = localuser, transport = local_delivery

root@localhost# exim -bt user@thishost.com
user@thishost.com
router = localuser, transport = local_delivery
root@localhost# exim -bt user@remotehost.com
router = lookuphost, transport = remote_smtp
host mail.remotehost.com [1.2.3.4] MX=0

Managing the exim queue

Start a queue run:
root@localhost# exim -q -v

Start a queue run for just local deliveries:
root@localhost# exim -ql -v

Remove a message from the queue:
root@localhost# exim -Mrm <message-id>

Freeze a message:
root@localhost# exim -Mf <message-id>

Force another queue run:
exim -qf

Force another queue run and attempt to flush the frozen message:
exim -qff

View the log for the message;
exim -Mvl msgid

Remove message without sending any error message;
exim -Mrm messageID

Giveup and fail message to bounce the message to the Sender:
exim -Mg messageID

How many Frozen mails in the queue:
exim -bpr | grep frozen | wc -l

Deleteing Frozen Messages:
exim -bpr | grep frozen | awk {’print $3?} | xargs exim -Mrm

Posted by sibu on March 3, 2009

Change Exim Interface IP Address

We can change exim incoming and outgoing exim mail server IPs.

Inside both incoming and outgoing exim mail server you will need to add an interface :
so just edit

pico /etc/exim_outgoing.conf

and

pico /etc/exim.conf

find
remote_smtp:
driver = smtp

and add interface = new IP address

example as shown below:

________________________
remote_smtp:
driver = smtp
interface = 22.22.22.22

_________________________

If there is an exim update when you upgrade your cpanel server you will need to re-enter the interface again.

Posted by sibu on March 3, 2009

To install domainkeys for a specific domain.

To install domainkeys for a specific domain,

1. First check that you are running the latest version ( RELEASE or CURRENT )of cPanel 11

2. Run the script

/usr/local/cpanel/bin/domain_keys_installer ‘username’

Where username is the corresponding cpanel username.

If you get an error similar to “Domain keys are not installed on this machine.” you either are not running the latest release or current version of cPanel or you have not converted yet to maildir. Maildir conversion is required before you install DomainKeys.

If you need you can use following scripts to install Domain Key for all domains on a cpanel server.
for i in `ls /var/cpanel/users` ;do /usr/local/cpanel/bin/domain_keys_installer $i ;done

Posted by sibu on March 3, 2009

Eximstats

eximstats : - generates statistics from Exim mainlog or syslog files.

eximstats [Output] [Options] mainlog1
eximstats -merge [Options] report.1.txt report.2.txt … > weekly_report.txt

Output:

-txt
Output the results in plain text to STDOUT.

-txt=filename
Output the results in plain text. Filename ‘-’ for STDOUT is accepted.

-html
Output the results in HTML to STDOUT.

-html=filename
Output the results in HTML. Filename ‘-’ for STDOUT is accepted.

Eg: #eximstats -html exim_mainlog > report.html

Options:

-ne - Don’t display error information.

-nr - Don’t display relaying information.

-nr/pattern/ - Don’t display relaying information that matches.

-qlist - List of times for queuing information single 0 item suppresses.

-t_remote_users - Include remote users in the top source/destination listings.

-include_original_destination  - Include the original destination email addresses rather than just using the final ones. Useful for finding out which of your mailing lists are receiving mail.

-show_dtlist  - Show the delivery times (DT)for all the messages.

-byhost  - Show results by sending host. This may be combined with -bydomain and/or -byemail and/or -byedomain. If none of these options are specified, then -byhost is assumed as a default.

-bydomain  - Show results by sending domain. May be combined with -byhost and/or -byemail and/or -byedomain.

-byemail  - Show results by sender’s email address. May be combined with -byhost and/or -bydomain and/or -byedomain.

-byemaildomain or -byedomain - Show results by sender’s email domain. May be combined with -byhost and/or -bydomain and/or -byemail.

-merge  - This option allows eximstats to merge old eximstat reports together. Eg:

eximstats -merge     report.*.txt > weekly_report.txt
eximstats -merge -html report.*.txt > weekly_report.html

-charts  - Create graphical charts to be displayed in HTML output. Only valid in combination with -html.

This requires the following modules which can be obtained from http://www.cpan.org/modules/01modules.index.html

GD
GDTextUtil GDGraph

To install these, download and unpack them, then use the normal perl installation procedure:

perl Makefile.PL
make
make test
make install

Posted by sibu on March 3, 2009

Exim Log Flags

The flags are:
<= message arrival
=> normal message delivery
-> additional address in same delivery
*> delivery suppressed by -N
** delivery failed; address bounced
== delivery deferred; temporary problem