Virtualmin mails not receiving. Two mailfolders in home directory - vps

I've installed a vps on ubuntu 18.04 with virtualmin as control panel. Once I create a user in a virtual server, the server automatically creates a 'mail' directory besides the 'Maildir' folder (which is normally used for storing mails via IMAP). The server makes use of postfix.
My folder structure in the user folder is now like this:
root#server01:/home/tuppr/homes/dprins# ls -al
total 28
drwxr-x--- 7 dprins#tuppr.nl tuppr 4096 Jan 11 21:02 .
drwxr-xr-x 3 tuppr tuppr 4096 Jan 11 21:01 ..
drwx------ 3 dprins#tuppr.nl tuppr 4096 Jan 11 21:02 mail
drwx------ 9 dprins#tuppr.nl tuppr 4096 Jan 11 21:01 Maildir
drwx------ 2 dprins#tuppr.nl tuppr 4096 Jan 11 21:02 .spamassassin
drwxr-xr-x 2 dprins#tuppr.nl tuppr 4096 Jan 11 21:04 .tmp
drwx------ 7 dprins#tuppr.nl tuppr 4096 Jan 11 21:02 .usermin
The problem is that incoming mails are strangely enough stored in the 'Maildir' directory, but email clients and webmail don't see it.
My postfix main.cf looks like this:
root#server01:/home/tuppr/homes/dprins# cat /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = server01.dennisprins.nl
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, server01.dennisprins.nl, localhost.dennisprins.nl, , localhost
#relayhost =
relayhost = vps.transip.email:587
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
#smtp_tls_security_level = may
allow_percent_hack = no
In the 'mail' directory I usually only find some 'dovecot' log files, but no real e-mails. Those are stored in the 'Maildir', but for some reason every e-mailclient I tried doesn't seem to discover the mails stored in that folder. Like it's ignoring those. The webmail client also doesn't see any incoming mails. But they are physically stored in 'Maildir'.
Sending mails, however, is going well. Every mail I sent using a third party email client (on my Mac for example) are stored on the server and the webmail client also sees them in the 'Sent' folder.
My dovecot configuration is also pointing towards 'Maildir'. Executing a grep command for '/mail' doesn't show up anything rather than outcommented rules in dovecot.
My usermin mailbox configuration looks like this:
root#server01:/etc/dovecot# cat /etc/usermin/mailbox/config
spam_always=0
folder_types=local,ext,pop3,imap
no_mailer=0
server_attach=0
top_buttons=1
mail_dir=/var/spool/mail
mail_dir_qmail=Maildir
mail_file=mbox
shortindex=0
mail_system=4
from_format=1
smtp_ssl=0
pop_locks=1
nologout=1
wrap_width=80
spam_report=
perpage=20
folder_virts=virt,comp
show_to=0
mail_style=0
no_orig_ip=1
html_base64=0
edit_from=0
no_crlf=0
sendmail_path=/usr/lib/sendmail
noindex_hostname=1
from_map=/etc/postfix/virtual
mail_qmail=
pop3_server=localhost
send_mode=localhost
server_name=
smtp_pass=
global_address=
ldap_login=
ldap_quotas=
ldap_base=
smtp_user=
max_attach=
global_address_group=
smtp_port=
ldap_host=
ldap_tls=
max_quota=
ldap_pass=
smtp_auth=
ldap_port=
I also read and tried this article:
https://www.virtualmin.com/node/35887
https://www.virtualmin.com/node/36027
I checked literally everything but I can't find out why it's not working. All DNS records are perfectly fine. SPF records as well. Those are already checked. Whenever I delete the 'mail' directory, it's coming back as soon as I use the e-mailaccount (whether it's via a mail client or webmail)
Do you guys have any idea why it's behaving like this?

Hello your configuration is wrong when you do the email configuration, there is no local host, but the DNS you configured for POP3 or SMTP.
they must have SSL configuring.
  Also, the type of sending is not localhost. You must also have a configured port. Whether for SMTP or POP3.
Well basically this file you sent is missing a lot of information
I checked your server to see if there was any wrong configuration. But in reality there is no configuration in this domain that you have posted.
Below are the main settings you should make in your DNS
http tuppr.nl The remote name could not be resolved: 'tuppr.nl' (http://tuppr.nl)
spf tuppr.nl DNS Record not found
dmarc tuppr.nl DNS Record not found
mx tuppr.nl No DMARC Record found
mx tuppr.nl DNS Record not found
dns tuppr.nl DNS Record not found
mx tuppr.nl DMARC Quarantine / Reject policy not enabled
send your feedback

Related

How to create a FTP connection and send a file in OMNeT++

I want to create a FTP connection and send a big file via it and see its effect in my network. In order to do that, I wrote the following lines in OMNet++ scenario file. I am not sure whether this is a correct way of creating a FTP connection or not. I set "thinkTime" and "IdleInterval" parameters to zero to send the FTP data immediately and in one session. Since the file size is too big for my current simulation, I think I would have only one session through the whole simulation time. However the throughput of my FTP connection is too low and I am not sure. Can someone help me? All suggestions or FTP examples are welcome.
# FTPclusterMember FTP
**.clusterMember[0].tcpApp[1].typename = "TCPBasicClientApp"
**.clusterMember[0].tcpApp[1].connectAddress = "FTPserver"
**.clusterMember[0].tcpApp[1].connectPort = 21
# Download Scenario requestLength < replyLength
**.clusterMember[0].tcpApp[1].requestLength = 100B
**.clusterMember[0].tcpApp[1].replyLength = 1500MB
**.clusterMember[0].tcpApp[1].thinkTime = 0s
**.clusterMember[0].tcpApp[1].idleInterval = 0s
# FTPserver Settings
**.FTPserver.numTcpApps = 1
**.FTPserver.tcpApp[0].typename = "TCPSinkApp"
**.FTPserver.tcpApp[0].localAddress = "FTPserver"
**.FTPserver.tcpApp[0].localPort = 21
Since FTP uses TCP in transport layer, we can use "TCPBasicClientApp" and "TCPGenericSrvApp" for FTP client and server respectively. For simulating behavior of FTP protocol, we set the port to 21. In addition, for simulation upload and download scenario, you just need to change the size of request length and reply length. As an example, please take a look at codes below;
# FTPclusterMember FTP
**.clusterMember[0].numTcpApps = 1
**.clusterMember[0].tcpApp[0].typename = "TCPBasicClientApp"
**.clusterMember[0].tcpApp[0].connectAddress = "FTPserver"
**.clusterMember[0].tcpApp[0].connectPort = 21
# Download Scenario requestLength < replyLength
# Upload Scenario requestLength > replyLength
**.clusterMember[0].tcpApp[0].requestLength = 1500MB
**.clusterMember[0].tcpApp[0].replyLength = 100B
**.clusterMember[0].tcpApp[0].thinkTime = 0s
**.clusterMember[0].tcpApp[0].idleInterval = 0s
# FTPserver Settings
**.FTPserver.numTcpApps = 1
**.FTPserver.tcpApp[0].typename = "TCPGenericSrvApp"
**.FTPserver.tcpApp[0].localAddress = "FTPserver"
**.FTPserver.tcpApp[0].localPort = 21
As you can see, I set "idleInterval" abd "thinktime" to zero. With these values, you can be sure that you have a constant transmission of FTP packets during your simulation time.

send email via telnet ruby script

I'm new with ruby and need to send an email via telnet using a relay host with no authentication. I can do it with a linux shell but I need to put it in a script so I can "simplify" its use, I know it's not the best way but I can't find other since the server where i'm working on it's severely restricted and limited.
require 'net/telnet.rb'
mail = Net::Telnet::new(
"Host" => "domain.ip", # default: "localhost"
"Port" => 25, # default: 23
"Output_log" => "output_log", # default: nil (no output)
"Dump_log" => "dump_log", # default: nil (no output)
"Prompt" => /[$%#>] \z/n, # default: /[$%#>] \z/n
"Telnetmode" => true, # default: true
"Timeout" => 10, # default: 10
"Waittime" => 0, # default: 0
)
mail.cmd('helo MYDOMAIN'){ |c| print c }
mail.cmd('mail from: test#domain.com')
mail.cmd('rcpt to: test2#domain.com')
mail.cmd('data')
mail.cmd("subject: test cmd \n\n mensaje de prueba\n\n")
mail.cmd(".\n")
mail.close
I found the net/telnet.rb ruby class and this is my try... after mail.cmd('helo MYDOMAIN') I can't keep writing other commands, what I get is:
220 mail.server.com ESMTP
250 mail.server.com
After this I'm suposed to write mail from, etc. to create the mail. But I can't in the ruby script. I have try using:
mail.puts('mail from: test...')
mail.write('mail from: test...')
mail.print('mail from: test...')
mail.cmd('mail from: test...')
As written in documentation
Also I don't get the telnetmode(true|false) command maybe you could explain it to me please.
-- Edit --
Shell code trying to emulate:
telnet domain.ip 25
#=> Trying domain.ip...
#=> Connected to domain.ip.
#=> Escape character is '^]'.
#=> 220 mail.server.com ESMTP
helo MYDOMAIN
#=>250 mail.server.com
mail from:test#mydomain.com
#=> 250 2.1.0 Ok
rcpt to:test2#mydomain.com
#=> 250 2.1.0 Ok
data
#=> 354 End data with <CR><LF>.<CR><LF>
subject: test mail
test mail body
.
#=> 250 2.0.0 =k: queued as B6F08480D12
quit
#=> 221 2.0.0 Bye
#=> Connection closed by foreign host.
The telnet protocol is really, really rudimentary which is why the telnet command is useful for testing TCP/IP based services such as SMTP or HTTP. It does not mean those services actually use the telnet protocol, as they don't. They're conveniently plain-text in nature which means it's practical to use telnet for simple tests.
You should not be using the Telnet module for anything other than connecting to telnet services, though given it's 2017 it's unlikely you'll find any of those around.
You should be using something like Socket to connect. This can create a bare TCP/IP connection with full control over sending. As this is a wrapper around a regular POSIX filehandle you can use all the IO methods on it for reading, writing, and other control functions, like a proper socket shutdown.
Writing an SMTP adapter is not as easy as it seems, there's a lot of tricky things to tackle with regard to IO. You'll need to use IO.select to properly test for new data, plus that the socket is clear to write your email.
Here's a new stub:
require 'socket'
mail = TCPSocket.new("smtp.example.com", 25)
mail.write("HELO example.com\r\n")
Another note is that when you call require you should never specify the file extension. It's always handled for you.
Thanks to the help of the user ddubs how suggest the net\smtp gem (One that I didn't know) I was able to create a simple mail sender and using the mailfactory gem
Is it a strict requirement that you use telnet? Using ruby-doc.org/stdlib-2.0.0/libdoc/net/smtp/rdoc/Net/SMTP.html will turn your "difficult to maintain" script into something that is much easier to maintain. Even for someone who is completely new to Ruby. – ddubs
Here is the code sample
require 'net/smtp'
require 'mailfactory'
mail_body_HTML = '<h1> mail title</h1> your text in <b>HTML</b>'
mail_body_PLAIN = 'this is plain text'
mail_subject = 'test email'
mail_from = 'noreply#mydomain.com'
mail_to = 'user#otherdomain.com'
# mail_filePath = ''
mail = MailFactory.new()
mail.to = mail_to
mail.from = mail_from
mail.subject = mail_subject
mail.html = mail_body_HTML
# mail.text = mail_body_PLAIN
# mail.attach(mail_filePath)
relay_ip = x.x.x.x
Net::SMTP.start(relay_ip,25) do |smtp|
smtp.send_message(mail.to_s, mail_from, mail_to)
end

Setting up mutt

I am a newbie to linux and need some help on using mutt for my office MS exchange server.
I have installed mutt 1.5.23 with configure options: --enable-imap --with-ssl and --enable-hcache.
I think, I am able to login to my exchange account, but can not go beyond (read or send mails). Mutt logs in and then says connection closed with message
--Mutt: (no mailbox) [Msgs:0] --- (date/date) ----------(all)
Is there a problem with my .muttrc or .msmtprc? I have no idea. I am pasting contents of both the files:
.muttrc:
source /usr/local/etc/Muttrc
set realname = "Ashish Goel"
set from = "ashish.goel#abc.com"
set envelope_from = yes
set imap_user = "ashish.goel#abc.com"
set folder = "imaps://owa.abc.com/owa/INBOX"
set imap_authenticators = "login"
set mbox = "imaps://owa.abc.com/owa/INBOX"
set spoolfile = "imaps://owa.abc.com/owa/INBOX"
set record = "imaps://owa.abc.com/owa/Sent Items"
set postponed = "imaps://owa.abc.com/owa/Drafts"
set copy=yes
set smtp_url = "smtps://ashish.goel#abc.com#owa.abc.com/owa"
mailboxes !
set header_cache = ~/.mutt/headers
set message_cachedir = ~/.mutt/cache/bodies
set certificate_file = /etc/ssl/certs
set imap_check_subscribed = yes
set imap_keepalive = 300
set imap_passive = no
set mail_check = 60
set timeout = 15
set sendmail = "/usr/bin/msmtp"
set ssl_verify_host = no
set ssl_verify_dates = no
.msmtprc:
account work
host owa.abc.com/owa
port 587
from ashish.goel#abc.com
user ashish.goel#abc.com
auth ntml
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
ntlmdomain MYDOMAIN
protocol smtp
account default : work
I had this problem with an Exchange 2010 server both on this and later versions of mutt. In the end, I found the problem went away after I reset my subscribed folders in IMAP. I did this by using our web mail gateway which also uses IMAP. If you don't have such a facility, try the tips here to generate a list of subscribed folders, change it, and see if the updated list now works for you..
These are my functioning configuration files:
.muttrc:
set sendmail="/usr/bin/esmtp"
set envelope_from=yes
set realname="Kitone Elvis Peter"
set from="Kitone Elvis Peter <elviskitone#gmail.com>"
set use_from=yes
set edit_headers=yes
set smtp_url = "smtp://elviskitone#gmail.com#smtp.gmail.com:587/"
set smtp_pass =""
set imap_user = "elviskitone#gmail.com"
set imap_pass = ""
set mail_check = 30
set move = no
set imap_keepalive = 900
set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
I used esmtprc instead of msmtprc.
.esmtprc:
identity "elviskitone#gmail.com"
hostname "smtp.gmail.com:587"
username "elviskitone#gmail.com"
password ""
starttls required
You also need to enable IMAP on your email if you haven't already. Plus, you need to give access to insecure or third party applications on your email, in email settings.

Doesn't get Access_accept packet from freeradius server

1.From client:
root#amsys-LIFEBOOK-AH502:/home/amsys# radtest -t chap usr password 127.0.0.1 0 testing123
This is how,the way i sended a packet access-request packet from the client (here,loop back only).
2.From server.
the server responds to client as shown as below:
Ready to process requests.
Ignoring request to auth address * port 1812 as server default from unknown client 127.0.0.1 port 34962 proto udp
3.server to client
Sending Access-Request of id 67 from 0.0.0.0 port 47852 to 127.0.0.1 port 1812
User-Name = 'usr'
User-Password = 'password'
NAS-IP-Address = 127.0.1.1
NAS-Port = 0
Message-Authenticator = 0x00
radclient: no response from server for ID 67 socket 3
if anybody would aware about this thing,please give your prompt response and pleased me.thanking you.!

How to connect to ftps site using microsoft internet transfer control 6.0 in vb6

In my exisiting visual basic 6 application I was connecting to an ftp site. Now the other side changed protocol to ftps and changed the port to 22.
My code do not work properly. I get error vb FTP run-time error '35753' "protocol not supported for this method".
I only changed the port in my code and the url
my old url was like ftp.xxx.com.tr
I changed the url to
sftps://ftp.xxx.com.tr
I am trying to connect to the same location using filezilla and it changes the url to sftps://ftp.xxx.com.tr so I copied it. There are similar questions in stackover (Transfer PDF file to ftp server in MS access 2007) but not for ftps. This is my code
With xControl
.AccessType = icDirect
.Protocol = icFTP
.RemotePort = 22
.RequestTimeout = 50
.url = xURL
.UserName = xUserName
.Password = xPassword
.Cancel
.Execute , "DIR " & xFileName
Do While .StillExecuting
DoEvents: DoEvents: DoEvents
Loop
gLogonFtp = "Connected to Host"
End With
Thank you for your time,
Ferda
I used psftp as – wqw (Mar 11 at 13:53) suggested on his comment. Here is my new code.
This is my script file
cd to_remotedir
lcd C:\path2 'local dir
mget * *
quit
result = ChangeFileContent("*", xOnlyFileName) //here I change the content of my script file psftpcommand.bat to get a specific file
Sleep 1000
Shell "C:/path/psftp.exe -v -pw " & xPassword & " " & xUserName & "#" & xURL & ":22 -b C:/path/psftpcommands.bat"
Sleep 1000
result = ChangeFileContent(xOnlyFileName, "*")//here I rechanged the content of the file. Change file name to ->*
'In the below I check if the requested file has come
Sleep 1000
If Dir("C:\path2\" & xOnlyFileName) <> "" Then
gLogonFtp = "Successful"
frmDataTransfers.lblTransferInfoDownLoad.Caption = "Dosya Çekildi " & xOnlyFileName
frmDataTransfers.lblTransferInfoDownLoad.Refresh
End If
That's all.
Thank you for your help.
Ferda

Resources