|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
maillog problem about domain name
Hi.
I'm afraid not to be able to give precise info, but I try anyway. I have recently installed obsd 6.5, and during the installation I choosed "scuola" as hostname a void string ('') for the domain name. Later I changed the domain name in "dominio", writing /etc/myname: ******************* scuola$ cat /etc/myname scuola.dominio scuola$ ******************* Then I discovered that /var/log/maillog* files were enormous, and they filled completely the partition dedicated to /var. So I explored /var/log/maillog and I found that it was full of lines like the following: ****************************** scuola$ tail /var/log/maillog Sep 3 10:30:19 scuola smtpd[48385]: 6317e779b1d617a8 smtp connected address=local host=scuola.dominio Sep 3 10:30:19 scuola smtpd[48385]: 6317e77858eb10d0 smtp disconnected reason=quit Sep 3 10:30:19 scuola smtpd[48385]: 6317e779b1d617a8 smtp failed-command command="EHLO scuola.''" result="501 5.5.4 Invalid command arguments: Invalid domain name" Sep 3 10:30:19 scuola smtpd[48385]: 6317e77a2257e467 smtp connected address=local host=scuola.dominio Sep 3 10:30:19 scuola smtpd[48385]: 6317e779b1d617a8 smtp disconnected reason=quit Sep 3 10:30:19 scuola smtpd[48385]: 6317e77a2257e467 smtp failed-command command="EHLO scuola.''" result="501 5.5.4 Invalid command arguments: Invalid domain name" Sep 3 10:30:19 scuola smtpd[48385]: 6317e77b0abff058 smtp connected address=local host=scuola.dominio Sep 3 10:30:19 scuola smtpd[48385]: 6317e77a2257e467 smtp disconnected reason=quit Sep 3 10:30:19 scuola smtpd[48385]: 6317e77cb404533f smtp connected address=local host=scuola.dominio Sep 3 10:30:19 scuola smtpd[48385]: 6317e77b0abff058 smtp failed-command command="EHLO scuola.''" result="501 5.5.4 Invalid command arguments: Invalid domain name" scuola$ *********************************** It seems to me that smtpd still remembers the initial void string for the domain name, but I don't know where it reads this information, since I chanced /etc/myname as I showed. I hope I've been not too confusing. Thank you in advance for any suggestions. Have a good day. |
|
|||
thank you jggimi.
hostname seems correct and mailname doesn't exist: ************************************* scuola$ hostname scuola.dominio ************************************* scuola$ ls -l /etc/mail total 16 -rw-r--r-- 1 root wheel 2066 Apr 13 22:35 aliases -rw-r--r-- 1 root wheel 525 Apr 13 22:35 smtpd.conf -rw-r--r-- 1 root wheel 1223 Apr 13 22:35 spamd.conf ************************************************ Here is the content of smtpd.conf: *********************************************** scuola$ cat /etc/mail/smtpd.conf # $OpenBSD: smtpd.conf,v 1.11 2018/06/04 21:10:58 jmc Exp $ # This is the smtpd server system-wide configuration file. # See smtpd.conf(5) for more information. table aliases file:/etc/mail/aliases # To accept external mail, replace with: listen on all # listen on lo0 action "local" mbox alias <aliases> action "relay" relay # Uncomment the following to accept external mail for domain "example.org" # # match from any for domain "example.org" action "local" match for local action "local" match for any action "relay" ************************************************** ****** I don't understand. I'm sorry that I don't put the output of commands in those beautiful windows. I'm not able. |
|
||||
It is my guess that the "EHLO scuola" messages are for mail traffic still pending in your outbound queue from a time before you revised your hostname(5).
I do not believe you can revise these messages, which will be reports from daily(8) and security(8). To delete all messages from the outbound queue, you can use # smtpctl remove all . See smtpctl(8) for further information.To use the forum's code blocks, you can use the # button in the advanced editor. |
|
|||
It seems you are right, Jggimi. Thanks! You're wonderful.
Now the problem is that I'm not able to remove the messages "permanently". They appear after every reboot, and the maillog continues to grow every second. Here are my attempts. The big /var/log/maillog exists and is full of lines of the same type: Code:
scuola# ls -l maillog* -rw-r----- 1 root wheel 374010187 Sep 3 18:13 maillog -rw-r----- 1 root wheel 18079193 Sep 3 18:00 maillog.0.gz scuola# tail -3 maillog Sep 3 18:13:36 scuola smtpd[66872]: c6eedd10d3274552 smtp disconnected reason=quit Sep 3 18:13:36 scuola smtpd[66872]: c6eedd1269999d4b smtp connected address=local host=scuola.dominio Sep 3 18:13:36 scuola smtpd[66872]: c6eedd11e82db2f7 smtp failed-command command="EHLO scuola.''" result="501 5.5.4 Invalid command arguments: Invalid domain name" Code:
scuola# smtpctl show queue 4a1540a840afdcc7|local|bounce|auth|attila@attila.com|attilio.semenzato.attilio@gmail.com|attilio.semenzato.attilio@gmail.com|1567185758|1567790558|1567526888|0|inflight|409|Temporary failure in MX lookup 4a1540a8adb6aa9e|local|bounce|auth|attila@attila.com|attilio.semenzato.attilio@gmail.com|attilio.semenzato.attilio@gmail.com|1567254110|1567858910|1567526888|0|inflight|409|Envelope expired scuola# smtpctl remove all 2 envelopes removed scuola# smtpctl show queue scuola# Code:
scuola# rm /var/log/maillog* scuola# ls /var/log/ Xorg.0.log authlog.1.gz lastlog pflog xenodm.log Xorg.0.log.old daemon lpd-errs rdist xferlog authlog failedlogin messages secure authlog.0.gz ftpd messages.0.gz wtmp scuola# > /var/log/maillog scuola# chmod 640 /var/log/maillog scuola# ls -l /var/log/maillog -rw-r----- 1 root wheel 0 Sep 3 18:25 /var/log/maillog Code:
scuola# reboot ........ Code:
scuola$ tail -3 /var/log/maillog Sep 3 18:30:25 scuola smtpd[95750]: 3a1c50c58c41adb5 smtp disconnected reason=quit Sep 3 18:30:25 scuola smtpd[95750]: 3a1c50c7864a5e94 smtp connected address=local host=scuola.dominio Sep 3 18:30:25 scuola smtpd[95750]: 3a1c50c61d720aa5 smtp failed-command command="EHLO scuola.''" result="501 5.5.4 Invalid command arguments: Invalid domain name" scuola$ tail -3 /var/log/maillog Sep 3 18:30:31 scuola smtpd[95750]: 3a1c739817368dd4 smtp failed-command command="EHLO scuola.''" result="501 5.5.4 Invalid command arguments: Invalid domain name" Sep 3 18:30:31 scuola smtpd[95750]: 3a1c73973ce8987b smtp disconnected reason=quit Sep 3 18:30:31 scuola smtpd[95750]: 3a1c7399a0623c0b smtp connected address=local host=scuola.dominio Code:
scuola# smtpctl show queue 4a1540a840afdcc7|local|bounce|auth|attila@attila.com|attilio.semenzato.attilio@gmail.com|attilio.semenzato.attilio@gmail.com|1567185758|1567790558|1567528160|0|inflight|167|Temporary failure in MX lookup 4a1540a8adb6aa9e|local|bounce|auth|attila@attila.com|attilio.semenzato.attilio@gmail.com|attilio.semenzato.attilio@gmail.com|1567254110|1567858910|1567528160|0|inflight|167|Envelope expired |
|
||||
You can inspect the contents of the messages with
# smtpctl show <message number> . This may show you if they are some sort of reflective "bounce" message or if they are reports from security(8) or daily(8).I assume the messages must be locally produced, since the only listen directive in your smtpd.conf(5) is for the loopback interface lo0. You can (temporarily) stop smtpd from processing these messages with the smtpctl(8) pause command. |
|
|||
thank you
|
|
||||
Quote:
I don't see any external relay host. How is outgoing mail supposed be relayed? Directly to the recipient's domain from what I assume is private dial up? |
|
|||
Thank you fvgit
I didn't configure anything about mail service, so any conf file is as it comes from the installation. The two messages (now one, I don't know what happened...) that cause the problem were probably generated by me, with a stupid attempt to send a test mail with mail(1) command. One recipient was real (my email address in gmail) and the other not. I would be happy to understand the components of a mail service, how they interact and how to configure them, but I don't have basic concepts about how it works and man pages are too difficult for me. Can you suggest me any simple tutorial? By now, I disabled smtpd with rcctl, but I'm not happy of this solution. Ciao! (Italian greeting) |
|
||||
Now we're getting somewhere. So you're on a private dial-up line and want to send/receive emails from your openbsd box using your gmail address.
Quote:
No they're not. I understand they can be overwhelming at first but the OpenBSD man pages are actually very good. Quote:
Don't worry, here comes a bit of hand holding. As a general introduction read the first four and rather short paragraphs of smtpd.conf(5). Now scroll down to the EXAMPLES section all the way at the end and read the first two paragraphs (which consist of two short sentences in total). The first paragraph explains what the default smtpd.conf does and the second paragraph explains the first example and how it differs from the default config. The first example consists of four lines dealing with the file /etc/mail/secrets plus a ten line (or eleven if you count the line break in line seven as an extra line) smtpd.conf. First look at the smtpd.conf and compare it with the default one. Just to get a feel for the differences that were just mentioned. Now to the crucial part. The smtpd.conf in the first example has four types of directives (the words at the beginning of each line):
Now you should be able to repeat these steps for the match directive. The options to look up under the match section are
A few important remarks: As you're on a dialup connection your Computer can't receive mail directly. So you'll have to fetch it. This is usually done either via POP3 or IMAP with tools like getmail or fetchmail which are available as packages for OpenBSD. I'm not familiar with the particulars of using a gmail account (which port numbers, tls options etc.), but I'm sure some of the forum regulars can weigh in on that. Pro-tip: once you have understood the keywords add your own comments to the smtpd.conf explaining to yourself what's what. This will help you and speed things up if you have to revisit the configuration at a later date. Last edited by fvgit; 4th September 2019 at 01:31 PM. Reason: Some minor typos. |
|
|||
My (two cents worth) concerning fetching mail referring to the comment above by fvgit
For Me "getmail" is fairly easy to understand and set-up for fetching your email from say a Gmail account (available in OpenBSD) In addition, I find it works well with "mutt" Last edited by frcc; 4th September 2019 at 12:32 PM. Reason: clarify and expand |
|
||||
Regarding using the Gmail mail servers to relay mail. Google will restrict the use of what they consider "less secure apps" and will refuse the connection until you change a setting in your Google account. See here for further information.
__________________
dc -e '[q]sa[ln0=aln256%Pln256/snlbx]sb12247225403800449909543746snlbxq' |
|
||||
Quote:
Procmail(1) can be set up from within smtpd.conf(5) by use of the "mda" directive.
__________________
dc -e '[q]sa[ln0=aln256%Pln256/snlbx]sb12247225403800449909543746snlbxq' |
|
|||
Thank you fvgit.
Please dont' think I'm not used to read man pages. I am indeed. I follow Teo's raccomendation: "read the man pages!". But these man pages are difficult to me because I feel that many things interact in a manner I don't know. Mail transfer agent, pop3 server, google with his particular rules and so on. Every man page describes how a single component of this set works, But I don't know how the components work together. But anyway, you, ip6ix and frcc illuminated me citing getmail and fetchmail, that I didn't know. Ok, after a very long (and patient!) reply as that of fvgit, I must work it out! I don't log in this forum very often but, when I do, I always find kindness and competence. Ciao! |
|
||||
The basic interoperations are not that complicated. For a very basic home user scenario here's the gist of it:
Outgoing mail MUA (Mail User Agent) e.g. mail(1), mutt, pine, Thunderbird, etc. sends msg on localhost via SMTP (Port 25) to: MTA (Mail Transfer Agent) e.g. smtpd(8), sendmail, postfix, etc. who in turn sends the msg via SMTP (encrypted with SSL to protect your authentication data: username & password) to: Relay server (another MTA) at your internet provider or e-mail-provider (like Gmail) From there the msg gets forwarded to the recipient MTAs over the internet. Incoming mail Your internet provider's or e-mail-provider's (like Gmail) mail server received a msg to you from other mail servers over the internet and is storing it either on a POP3 or IMAP server from which your MRA (Mail Retrieval Agent) like fetchmail or getmail retrieves it via POP3 or IMAP (encrypted with SSL to protect your authentication data: username & password) and passes it on locally either to your MTA (e.g. smtpd(8)) via SMTP (Port 25) or alternatively directly to a MDA (Mail Delivery Agent) sometimes also called LDA (Local Delivery Agent) like procmail or maildrop who may drop it directly to your mailbox. Some programs can have multiple roles. For instance MTAs can also work as MDAs. Or some MUAs can directly talk to Relay servers effectively bypassing your MTA (Thunderbird for example). The same goes for retrieval: many MUAs can directly fetch mails via POP3 or IMAP from POP3/IMAP servers without the need for an MRA. Last edited by fvgit; 4th September 2019 at 09:46 PM. Reason: Fixed man page links |
|
|||
Wonderfull fvgit!!
I needed just a description like this. It's perfect. Thanks a lot. |
|
|||
Quote:
When using mutt i normally select that option at Google to allow the download of mail via getmail, which for years have not experienced problems of any kind other than Google's warning. |
|
|||
Hi fvgit.
I did the homeworks, but something doesn't go as it shoud. I set google account to allow less secure apps access. I changed /etc/mail/smtpd.conf Code:
scuola$ cat /etc/mail/smtpd.conf # $OpenBSD: smtpd.conf,v 1.11 2018/06/04 21:10:58 jmc Exp $ # This is the smtpd server system-wide configuration file. # See smtpd.conf(5) for more information. ### this file has benn modified by attilio ### changes are commented with triple # table aliases file:/etc/mail/aliases ### next line defines username and password in credenziali, preceeded by the label "attila" according to the format indicated in table(5) table credenziali file:/etc/mail/credenzialigmail # To accept external mail, replace with: listen on all # listen on lo0 action "local" mbox alias <aliases> ### the action "relay" now relays to smtp server of google, using username and password defined in credenziali action "relay" relay host smtp+tls://attila@smtp.gmail.com auth <credenziali> # Uncomment the following to accept external mail for domain "example.org" # # match from any for domain "example.org" action "local" match for local action "local" ### the default match action has been conservated for reference #match for any action "relay" ### all messages not for local are relayed; the first match shoud win (man smtpd.conf) and I could use "match for all" ### but I prefer not to risk a local message goes out of my machine match ! for local action "relay" something goes wrong. Code:
scuola$ mail attilio.semenzato.attilio@gmail.com Subject: test non local message this is the text of a non local message EOT scuola$ Code:
scuola$ tail -20 /var/log/maillog Sep 5 20:35:38 scuola smtpd[5049]: 3f56c058936ba280 smtp envelope evpid=ec98a76826274250 from=<ciccio@scuola.dominio> to=<attilio.semenzato.attilio@gmail.com> Sep 5 20:35:38 scuola smtpd[5049]: 3f56c058936ba280 smtp disconnected reason=quit Sep 5 20:35:48 scuola smtpd[5049]: 3f56c057cf4551ff mta error reason=Connection timeout Sep 5 20:35:48 scuola smtpd[5049]: smtp-out: Disabling route [] <-> 64.233.166.108 (wm-in-f108.1e100.net) for 15s Sep 5 20:35:48 scuola smtpd[5049]: smtp-out: No valid route for [connector:[]->[relay:smtp.gmail.com,smtp+tls,auth=credenziali:attila,mx],0x0] Sep 5 20:35:55 scuola smtpd[5049]: 0000000000000000 mta delivery evpid=eb816a44f4d138d4 from=<ciccio@scuola.dominio> to=<attilio.semenzato.attilio@gmail.it> rcpt=<-> source="-" relay="smtp.gmail.com" delay=8m2s result="TempFail" stat="Network error on destination MXs" Sep 5 20:35:55 scuola smtpd[5049]: 0000000000000000 mta delivery evpid=ec98a76826274250 from=<ciccio@scuola.dominio> to=<attilio.semenzato.attilio@gmail.com> rcpt=<-> source="-" relay="smtp.gmail.com" delay=17s result="TempFail" stat="Network error on destination MXs" Sep 5 20:36:03 scuola smtpd[5049]: smtp-out: Enabling route [] <-> 64.233.166.108 (wm-in-f108.1e100.net) Sep 5 20:39:55 scuola smtpd[5049]: 3f56c05ccb06b2f5 mta connecting address=smtp+tls://64.233.166.108:25 host=wm-in-f108.1e100.net Sep 5 20:41:10 scuola smtpd[5049]: 3f56c05ccb06b2f5 mta error reason=Connection timeout Sep 5 20:41:10 scuola smtpd[5049]: smtp-out: Disabling route [] <-> 64.233.166.108 (wm-in-f108.1e100.net) for 15s Sep 5 20:41:10 scuola smtpd[5049]: smtp-out: No valid route for [connector:[]->[relay:smtp.gmail.com,smtp+tls,auth=credenziali:attila,mx],0x0] Sep 5 20:41:16 scuola smtpd[5049]: 0000000000000000 mta delivery evpid=78741a17a5dcaf32 from=<ciccio@scuola.dominio> to=<attilio.semenzato.attilio@gmail.com> rcpt=<-> source="-" relay="smtp.gmail.com" delay=1h48m1s result="TempFail" stat="Network error on destination MXs" Sep 5 20:41:25 scuola smtpd[5049]: smtp-out: Enabling route [] <-> 64.233.166.108 (wm-in-f108.1e100.net) Sep 5 20:42:18 scuola smtpd[5049]: 3f56c05f004108ec mta connecting address=smtp+tls://64.233.166.108:25 host=wm-in-f108.1e100.net Sep 5 20:43:33 scuola smtpd[5049]: 3f56c05f004108ec mta error reason=Connection timeout Sep 5 20:43:33 scuola smtpd[5049]: smtp-out: Disabling route [] <-> 64.233.166.108 (wm-in-f108.1e100.net) for 15s Sep 5 20:43:33 scuola smtpd[5049]: smtp-out: No valid route for [connector:[]->[relay:smtp.gmail.com,smtp+tls,auth=credenziali:attila,mx],0x0] Sep 5 20:43:39 scuola smtpd[5049]: 0000000000000000 mta delivery evpid=ec98a76826274250 from=<ciccio@scuola.dominio> to=<attilio.semenzato.attilio@gmail.com> rcpt=<-> source="-" relay="smtp.gmail.com" delay=8m1s result="TempFail" stat="Network error on destination MXs" Sep 5 20:43:48 scuola smtpd[5049]: smtp-out: Enabling route [] <-> 64.233.166.108 (wm-in-f108.1e100.net) scuola$ |
|
||||
Hi attilio,
I only had a cursory glance, but I'm pretty sure you have to relay to Gmail over port 587. Try changing your relay directive to: Code:
action "relay" relay host smtp+tls://attila@smtp.gmail.com:587 auth <credenziali> |
|
|||
It works. Yeah!
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenBSD5.4 in win domain | dizzappear | OpenBSD General | 3 | 28th February 2014 03:06 PM |
DNS and purpose of .my.domain on a LAN | frcc | OpenBSD General | 2 | 19th July 2013 02:40 AM |
My domain name as my IRC hostname? | guitarscn | General software and network | 6 | 15th September 2010 02:43 PM |
How to set reverse DNS to my domain? | guitarscn | General software and network | 1 | 12th September 2010 04:58 PM |
Problem with my domain name reacing my machine | whispersGhost | General software and network | 0 | 6th June 2008 03:28 AM |