Ana sayfa » Sunucu Yönetimi » Linux » Exim Cheatsheet
Linux Sunucu Yönetimi

Exim Cheatsheet

Exim Cheatsheet

cPanel sunucularımızda [abbr title=”Message/Mail Transfer Agent”]MTA[/abbr] olarak Exim kullanıyoruz. Derlemiş olduğum exim notlarımı bu şekilde bir yazı haline getireyim istedim. Elbette ki yazıda bahsedilmeyen birçok detay var. Fikirlerinizi veya önemli olduğu halde unuttuğumu düşündüğünüz detayları lütfen yorum olarak eklemekten çekinmeyin.

Kuyrukta olan e-posta listesi

exim -bpc

Örnek sonuç:

root@x12x63 [~]# exim -bpc
3

Kuyrukta olan mesajların listesi (kuyruk saati, boyut, mesaj id, gönderici, alıcı):

exim -bp

Örnek sonuç:

root@x12x63 [~]# exim -bp
21h  3.2K 1VrZ0R-0000ZQ-G9 <> *** frozen ***
          [email protected]

18h  3.1K 1VrcF7-00017F-Df <> *** frozen ***
          [email protected]

 4h  1.1K 1VrpcA-0005BV-JP <[email protected]>
          [email protected]

Exim’in o anda ne yaptığını öğrenmek için

exiwhat

Örnek sonuç:

root@x12x63 [~]# exiwhat
289606 running queue: waiting for 1VrBZ9-003azR-JN (311187)
311187 delivering 1VrBZ9-003azR-JN (queue run pid 289606)
338653 daemon: -q1h, listening for SMTP on port 25 (IPv6 and IPv4) port 587 (IPv6 and IPv4) and for SMTPS on port 465 (IPv6 and IPv4)

Tüm exim konfigürasyonunu listeleyin

exim -bP

Örnek sonuç:

root@x12x63 [~]# exim -bP
accept_8bitmime
acl_not_smtp = acl_not_smtp
acl_not_smtp_mime =
acl_not_smtp_start =
acl_smtp_auth =
acl_smtp_connect = acl_smtp_connect
acl_smtp_data = acl_smtp_data
acl_smtp_dkim =
acl_smtp_etrn =
acl_smtp_expn =
acl_smtp_helo =
acl_smtp_mail = acl_smtp_mail
acl_smtp_mailauth =
acl_smtp_mime =
acl_smtp_notquit = acl_smtp_notquit
acl_smtp_predata =
acl_smtp_quit = acl_smtp_quit
acl_smtp_rcpt = acl_smtp_rcpt
acl_smtp_starttls =
acl_smtp_vrfy =
admin_groups =
no_allow_domain_literals
no_allow_mx_to_ip
no_allow_utf8_domains
auth_advertise_hosts = *
auto_thaw = 1w
av_scanner = clamd:/var/clamd
bi_command =
bounce_message_file =
bounce_message_text =
bounce_return_body
bounce_return_message
bounce_return_size_limit = 100K
bounce_sender_authentication =
callout_domain_negative_expire = 1h
callout_domain_positive_expire = 1w
callout_negative_expire = 1h
callout_positive_expire = 1d
callout_random_local_part = $primary_hostname-$tod_epoch-testing
check_log_inodes = 0
check_log_space = 0
check_rfc2047_length
check_spool_inodes = 0
check_spool_space = 0
daemon_smtp_ports = 25 : 465 : 587
daemon_startup_retries = 9
daemon_startup_sleep = 30s
delay_warning = 1d
delay_warning_condition = ${if or {{ !eq{$h_list-id:$h_list-post:$h_list-subscribe:}{} }{ match{$h_precedence:}{(?i)bulk|list|junk} }{ match{$h_auto-submitted:}{(?i)auto-generated|auto-replied} }} {no}{yes}}
no_deliver_drop_privilege
deliver_queue_load_max = 24.0
delivery_date_remove
no_disable_ipv6
dkim_verify_signers = $dkim_signers
dns_again_means_nonexist =
dns_check_names_pattern = (?i)^(?>(?(1)\.|())[^\W](?>[a-z0-9/_-]*[^\W])?)+(\.?)$
dns_csa_search_limit = 5
dns_csa_use_reverse
dns_dnssec_ok = -1
dns_ipv4_lookup =
dns_retrans = 0s
dns_retry = 0
dns_use_edns0 = -1
no_drop_cr
dsn_from = Mail Delivery System <Mailer-Daemon@$qualify_domain>
envelope_to_remove
errors_copy =
errors_reply_to =
exim_group = mail
exim_path = /usr/sbin/exim
exim_user = mailnull
extra_local_interfaces =
extract_addresses_remove_arguments
finduser_retries = 0
freeze_tell =
gecos_name =
gecos_pattern =
no_gnutls_allow_auto_pkcs11
no_gnutls_compat_mode
gnutls_require_kx =
gnutls_require_mac =
gnutls_require_protocols =
header_line_maxsize = 0
header_maxsize = 1048576
headers_charset = ISO-8859-1
helo_accept_junk_hosts = *
helo_allow_chars =
helo_lookup_domains = @ : @[]
helo_try_verify_hosts =
helo_verify_hosts =
hold_domains =
host_lookup =
host_lookup_order = bydns:byaddr
host_reject_connection =
hosts_connection_nolog =
hosts_treat_as_local =
ignore_bounce_errors_after = 1d
ignore_fromline_hosts =
no_ignore_fromline_local
keep_malformed = 4d
no_local_from_check
local_from_prefix =
local_from_suffix =
local_interfaces = <; ::0 ; 0.0.0.0
local_scan_timeout = 5m
no_local_sender_retain
localhost_number =
log_file_path = /var/log/exim_%slog
log_selector = +incoming_port +smtp_connection -retry_defer +subject +arguments +received_recipients
no_log_timezone
lookup_open_max = 25
max_username_length = 0
message_body_newlines
message_body_visible = 5000
message_id_header_domain =
message_id_header_text =
message_logs
message_size_limit = 50M
no_mua_wrapper
never_users = root
openssl_options =
percent_hack_domains =
no_perl_at_start
perl_startup = do '/etc/exim.pl'
pid_file_path =
pipelining_advertise_hosts = *
no_preserve_message_logs
primary_hostname = x12x63.mtahta.com
no_print_topbitchars
process_log_path = /var/spool/exim/exim-process.info
prod_requires_admin
qualify_domain = x12x63.mtahta.com
qualify_recipient = x12x63.mtahta.com
queue_domains =
queue_list_requires_admin
no_queue_only
queue_only_file =
queue_only_load = 48.0
queue_only_load_latch
queue_only_override
no_queue_run_in_order
queue_run_max = 5
queue_smtp_domains =
receive_timeout = 0s
received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}{${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}(Exim $version_number)\n\t${if def:sender_address {(envelope-from <$sender_address>)\n\t}}id $message_exim_id${if def:received_for {\n\tfor $received_for}}
received_headers_max = 30
recipient_unqualified_hosts =
recipients_max = 0
no_recipients_max_reject
remote_max_parallel = 10
remote_sort_domains =
retry_data_expire = 1w
retry_interval_max = 1d
return_path_remove
rfc1413_hosts = *
rfc1413_query_timeout = 0s
sender_unqualified_hosts =
smtp_accept_keepalive
smtp_accept_max = 100
smtp_accept_max_nonmail = 10
smtp_accept_max_nonmail_hosts = *
smtp_accept_max_per_connection = 1000
smtp_accept_max_per_host =
smtp_accept_queue = 0
smtp_accept_queue_per_connection = 30
smtp_accept_reserve = 0
smtp_active_hostname =
smtp_banner = ${primary_hostname} ESMTP Exim ${version_number} #${compile_number} ${tod_full} \nWe do not authorize the use of this system to transport unsolicited, \nand/or bulk e-mail.
smtp_check_spool_space
smtp_connect_backlog = 50
no_smtp_enforce_sync
smtp_etrn_command =
smtp_etrn_serialize
smtp_load_reserve =
smtp_max_synprot_errors = 3
smtp_max_unknown_commands = 3
smtp_ratelimit_hosts =
smtp_ratelimit_mail =
smtp_ratelimit_rcpt =
smtp_receive_timeout = 2m45s
smtp_reserve_hosts =
no_smtp_return_error_details
spamd_address = 127.0.0.1 783
spf_guess = v=spf1 a/24 mx/24 ptr ?all
split_spool_directory
spool_directory = /var/spool/exim
srs_config =
srs_hashlength = 6
srs_hashmin = -1
srs_maxage = 31
srs_secrets =
srs_usehash
srs_usetimestamp
no_strict_acl_vars
no_strip_excess_angle_brackets
no_strip_trailing_dot
syslog_duplication
syslog_facility =
syslog_processname = exim
syslog_timestamp
system_filter = /etc/cpanel_exim_system_filter
system_filter_directory_transport =
system_filter_file_transport =
system_filter_group = cpaneleximfilter
system_filter_pipe_transport =
system_filter_reply_transport =
system_filter_user = cpaneleximfilter
tcp_nodelay
timeout_frozen_after = 5d
timezone =
tls_advertise_hosts = *
tls_certificate = /etc/exim.crt
tls_crl =
tls_dh_max_bits = 2236
tls_dhparam =
tls_on_connect_ports = 465
tls_privatekey = /etc/exim.key
no_tls_remember_esmtp
tls_require_ciphers = ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
tls_try_verify_hosts =
tls_verify_certificates =
tls_verify_hosts =
trusted_groups =
trusted_users =
unknown_login =
unknown_username =
untrusted_set_sender = *
uucp_from_pattern = ^From\s+(\S+)\s+(?:[a-zA-Z]{3},?\s+)?(?:[a-zA-Z]{3}\s+\d?\d|\d?\d\s+[a-zA-Z]{3}\s+\d\d(?:\d\d)?)\s+\d\d?:\d\d?
uucp_from_sender = $1
warn_message_file =
write_rejectlog

Mail kuyruğunu yönetmek

exiqrep ile mail kuyruğunu yönetirken işinize yarayabilecek bazı yöntemleri aşağıda listeledim.

-f ile bir e-posta adresinden çıkan e-postaları listeleyin

exiqgrep -f [email protected]

-r ile belirtilen adrese gönderilen e-postaları listeleyin

exiqgrep -r [email protected]

Frozen mesajları temizleyin

exiqgrep -z -i | xargs exim -Mrm

Belirli bir günden önce gönderilmiş tüm mesajları temizleyin. Örneğin 3 gün için hesaplayacak olursak, bir gün 86400 saniye, 86400 * 3 = 259200 saniye.

exiqgrep -o 259200 -i | xargs exim -Mrm

Belirli bir göndericiden gönderilen kuyruktaki mesajları dondurun

exiqgrep -i -i [email protected] | xargs exim -Mf

Mesajın header kısmını görüntüleyin

exim -Mvh <mesaj-id>

Mesajın body kısmını görüntüleyin

exim -Mvl <mesaj-id>

Belirli bir göndericiden çıkan tüm mailleri silin. Sanırım en çok işe yarayanlardan birisi de bu.

exiqgrep -i -f '<[email protected]>' | xargs exim -Mrm

cPanel sunucunuzun mail kuyruğunu sorunsuz bir şekilde temizleyin

/etc/init.d/exim stop;
sleep 10;
killall -9 exim eximd
sleep 5;

#mail kuyruğu temizleniyor
find /var/spool/exim -mindepth 2 -type f -exec rm -rf {} \;

#mail db dosyaları temizleniyor
find /var/spool/exim/db -type f -exec rm -rf {} \;

#eximstats db tabloları resetleniyor
echo “truncate table sends;” | mysql eximstats
echo “truncate table defers;” | mysql eximstats
echo “truncate table failures;” | mysql eximstats
echo “truncate table smtp;” | mysql eximstats
#tekrar başlatıyoruz
/etc/init.d/exim restart

Çok detaylı bir cheatsheet değil, takip eden günlerde fırsat buldukça güncelleyeceğim. Eklemek istediğiniz detaylar olur ise yorum olarak ekleyebilirsiniz, ben de yazıyı sizi referans göstererek güncelleyebilirim.

Kaynaklar

[unordered_list style=”green-dot”] [/su_list]

Yazar hakkında

Mehmet Tahta

Egenin gözbebeği İzmir'de yaşıyor, Dokuz Eylül Üniversitesi Yönetim Bilişim Sistemleri yüksek lisans öğrencisi. DMOZ, GNU, WordPress, jQuery ve Ubuntu projelerine katkıda bulunur; ayda yılda bir de bu blog sayfasını günceller.

Yorum ekle

Yorum eklemek ister misiniz?

Yazılar E-posta Adresinize Gelsin

Abone olmak için aşağıdaki forma e-posta adresinizi yazıp gönderilen onay e-postasını onaylamanız yeterlidir.

İletişim bilgileriniz hiçbir şekilde 3. parti uygulama ile paylaşılmamaktadır.